Upload: switch requires to imports
This commit is contained in:
parent
558d19e244
commit
39de868383
1 changed files with 11 additions and 10 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
import bookIcon from '@tabler/icons/book.svg';
|
||||||
|
import fileCodeIcon from '@tabler/icons/file-code.svg';
|
||||||
|
import fileSpreadsheetIcon from '@tabler/icons/file-spreadsheet.svg';
|
||||||
|
import fileTextIcon from '@tabler/icons/file-text.svg';
|
||||||
|
import fileZipIcon from '@tabler/icons/file-zip.svg';
|
||||||
|
import defaultIcon from '@tabler/icons/paperclip.svg';
|
||||||
|
import presentationIcon from '@tabler/icons/presentation.svg';
|
||||||
|
import xIcon from '@tabler/icons/x.svg';
|
||||||
|
import zoomInIcon from '@tabler/icons/zoom-in.svg';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { List as ImmutableList } from 'immutable';
|
import { List as ImmutableList } from 'immutable';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
@ -12,14 +21,6 @@ import Motion from 'soapbox/features/ui/util/optional-motion';
|
||||||
import { useAppDispatch } from 'soapbox/hooks';
|
import { useAppDispatch } from 'soapbox/hooks';
|
||||||
import { Attachment } from 'soapbox/types/entities';
|
import { Attachment } from 'soapbox/types/entities';
|
||||||
|
|
||||||
const bookIcon = require('@tabler/icons/book.svg');
|
|
||||||
const fileCodeIcon = require('@tabler/icons/file-code.svg');
|
|
||||||
const fileSpreadsheetIcon = require('@tabler/icons/file-spreadsheet.svg');
|
|
||||||
const fileTextIcon = require('@tabler/icons/file-text.svg');
|
|
||||||
const fileZipIcon = require('@tabler/icons/file-zip.svg');
|
|
||||||
const defaultIcon = require('@tabler/icons/paperclip.svg');
|
|
||||||
const presentationIcon = require('@tabler/icons/presentation.svg');
|
|
||||||
|
|
||||||
export const MIMETYPE_ICONS: Record<string, string> = {
|
export const MIMETYPE_ICONS: Record<string, string> = {
|
||||||
'application/x-freearc': fileZipIcon,
|
'application/x-freearc': fileZipIcon,
|
||||||
'application/x-bzip': fileZipIcon,
|
'application/x-bzip': fileZipIcon,
|
||||||
|
@ -163,7 +164,7 @@ const Upload: React.FC<IUpload> = ({
|
||||||
{(withPreview && mediaType !== 'unknown' && Boolean(media.url)) && (
|
{(withPreview && mediaType !== 'unknown' && Boolean(media.url)) && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={handleOpenModal}
|
onClick={handleOpenModal}
|
||||||
src={require('@tabler/icons/zoom-in.svg')}
|
src={zoomInIcon}
|
||||||
theme='dark'
|
theme='dark'
|
||||||
className='hover:scale-105 hover:bg-gray-900'
|
className='hover:scale-105 hover:bg-gray-900'
|
||||||
iconClassName='h-5 w-5'
|
iconClassName='h-5 w-5'
|
||||||
|
@ -173,7 +174,7 @@ const Upload: React.FC<IUpload> = ({
|
||||||
{onDelete && (
|
{onDelete && (
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={handleUndoClick}
|
onClick={handleUndoClick}
|
||||||
src={require('@tabler/icons/x.svg')}
|
src={xIcon}
|
||||||
theme='dark'
|
theme='dark'
|
||||||
className='hover:scale-105 hover:bg-gray-900'
|
className='hover:scale-105 hover:bg-gray-900'
|
||||||
iconClassName='h-5 w-5'
|
iconClassName='h-5 w-5'
|
||||||
|
|
Loading…
Reference in a new issue