diff --git a/interface/src/AppRouting.tsx b/interface/src/AppRouting.tsx index df857d07e..a8268a897 100644 --- a/interface/src/AppRouting.tsx +++ b/interface/src/AppRouting.tsx @@ -1,5 +1,4 @@ import { useContext, useEffect } from 'react'; -import type { FC } from 'react'; import { Navigate, Route, Routes, useLocation } from 'react-router-dom'; import { toast } from 'react-toastify'; @@ -14,7 +13,7 @@ interface SecurityRedirectProps { signOut?: boolean; } -const RootRedirect: FC = ({ message, signOut }) => { +const RootRedirect = ({ message, signOut }: SecurityRedirectProps) => { const authenticationContext = useContext(AuthenticationContext); useEffect(() => { signOut && authenticationContext.signOut(false); @@ -23,26 +22,11 @@ const RootRedirect: FC = ({ message, signOut }) => { return ; }; -export const RemoveTrailingSlashes = () => { - const location = useLocation(); - return ( - location.pathname.match('/.*/$') && ( - - ) - ); -}; - -const AppRouting = () => { +export default function AppRouting() { const { LL } = useI18nContext(); return ( - { ); -}; - -export default AppRouting; +} diff --git a/interface/src/components/layout/LayoutMenuItem.tsx b/interface/src/components/layout/LayoutMenuItem.tsx index 03b48883a..9bcec5f3d 100644 --- a/interface/src/components/layout/LayoutMenuItem.tsx +++ b/interface/src/components/layout/LayoutMenuItem.tsx @@ -1,4 +1,3 @@ -import type { FC } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material'; @@ -13,12 +12,12 @@ interface LayoutMenuItemProps { disabled?: boolean; } -const LayoutMenuItem: FC = ({ +const LayoutMenuItem = ({ icon: Icon, label, to, disabled -}) => { +}: LayoutMenuItemProps) => { const { pathname } = useLocation(); const selected = routeMatches(to, pathname); diff --git a/interface/src/components/layout/ListMenuItem.tsx b/interface/src/components/layout/ListMenuItem.tsx index df5804e8c..49d7091a0 100644 --- a/interface/src/components/layout/ListMenuItem.tsx +++ b/interface/src/components/layout/ListMenuItem.tsx @@ -1,4 +1,3 @@ -import type { FC } from 'react'; import { Link } from 'react-router-dom'; import NavigateNextIcon from '@mui/icons-material/NavigateNext'; @@ -34,14 +33,14 @@ function RenderIcon({ icon: Icon, bgcolor, label, text }: ListMenuItemProps) { ); } -const LayoutMenuItem: FC = ({ +const LayoutMenuItem = ({ icon, bgcolor, label, text, to, disabled -}) => ( +}: ListMenuItemProps) => ( <> {to && !disabled ? ( void; } -const FormLoader: FC = ({ +const FormLoader = ({ errorMessage, onRetry, message = 'Loading…' -}) => { +}: FormLoaderProps) => { const { LL } = useI18nContext(); if (errorMessage) { diff --git a/interface/src/components/loading/LoadingSpinner.tsx b/interface/src/components/loading/LoadingSpinner.tsx index 3bd47ec4c..46e07af4c 100644 --- a/interface/src/components/loading/LoadingSpinner.tsx +++ b/interface/src/components/loading/LoadingSpinner.tsx @@ -1,5 +1,3 @@ -import type { FC } from 'react'; - import { Box, CircularProgress, Typography } from '@mui/material'; import type { Theme } from '@mui/material'; @@ -9,7 +7,7 @@ interface LoadingSpinnerProps { height?: number | string; } -const LoadingSpinner: FC = ({ height = '100%' }) => { +const LoadingSpinner = ({ height = '100%' }: LoadingSpinnerProps) => { const { LL } = useI18nContext(); return ( diff --git a/interface/src/components/upload/SingleUpload.tsx b/interface/src/components/upload/SingleUpload.tsx index 74cd66b56..f526e3d7d 100644 --- a/interface/src/components/upload/SingleUpload.tsx +++ b/interface/src/components/upload/SingleUpload.tsx @@ -1,5 +1,4 @@ import { Fragment } from 'react'; -import type { FC } from 'react'; import { useDropzone } from 'react-dropzone'; import type { DropzoneState } from 'react-dropzone'; @@ -31,12 +30,12 @@ export interface SingleUploadProps { progress: Progress; } -const SingleUpload: FC = ({ +const SingleUpload = ({ onDrop, onCancel, isUploading, progress -}) => { +}: SingleUploadProps) => { const uploading = isUploading && progress.total > 0; const dropzoneState = useDropzone({