extensions refactor

This commit is contained in:
Jan Prochazka
2020-11-21 20:12:33 +01:00
parent 3009724a82
commit 5ec39054a3
18 changed files with 200 additions and 227 deletions

View File

@@ -1,8 +1,8 @@
import React from 'react';
import styled from 'styled-components';
import { fileformats } from './fileformats';
import { FontIcon } from './icons';
import useTheme from './theme/useTheme';
import useExtensions from './utility/useExtensions';
const TargetStyled = styled.div`
position: fixed;
@@ -40,6 +40,7 @@ const TitleWrapper = styled.div`
export default function DragAndDropFileTarget({ isDragActive, inputProps }) {
const theme = useTheme();
const { fileFormats } = useExtensions();
return (
!!isDragActive && (
<TargetStyled theme={theme}>
@@ -50,7 +51,7 @@ export default function DragAndDropFileTarget({ isDragActive, inputProps }) {
<TitleWrapper>Drop the files to upload to DbGate</TitleWrapper>
<InfoWrapper>
Supported file types:{' '}
{fileformats
{fileFormats
.filter((x) => x.readerFunc)
.map((x) => x.name)
.join(', ')}