Upload: switch requires to imports

This commit is contained in:
Alex Gleason 2023-10-13 11:09:04 -05:00
parent 558d19e244
commit 39de868383
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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 { List as ImmutableList } from 'immutable';
import React, { useState } from 'react';
@ -12,14 +21,6 @@ import Motion from 'soapbox/features/ui/util/optional-motion';
import { useAppDispatch } from 'soapbox/hooks';
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> = {
'application/x-freearc': fileZipIcon,
'application/x-bzip': fileZipIcon,
@ -163,7 +164,7 @@ const Upload: React.FC<IUpload> = ({
{(withPreview && mediaType !== 'unknown' && Boolean(media.url)) && (
<IconButton
onClick={handleOpenModal}
src={require('@tabler/icons/zoom-in.svg')}
src={zoomInIcon}
theme='dark'
className='hover:scale-105 hover:bg-gray-900'
iconClassName='h-5 w-5'
@ -173,7 +174,7 @@ const Upload: React.FC<IUpload> = ({
{onDelete && (
<IconButton
onClick={handleUndoClick}
src={require('@tabler/icons/x.svg')}
src={xIcon}
theme='dark'
className='hover:scale-105 hover:bg-gray-900'
iconClassName='h-5 w-5'