diff --git a/src/components/NavigationBars/DriveActionBar/DriveActionBar.tsx b/src/components/NavigationBars/DriveActionBar/DriveActionBar.tsx index 846d133a..bbc23206 100644 --- a/src/components/NavigationBars/DriveActionBar/DriveActionBar.tsx +++ b/src/components/NavigationBars/DriveActionBar/DriveActionBar.tsx @@ -42,6 +42,7 @@ const DriveActionBar = ({ type="button" variant="primary" className="mx-1 p-0" + disabled={!activePod} onClick={onFileUploadClick} > diff --git a/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx b/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx index 08970eb6..844dfc56 100644 --- a/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx +++ b/src/components/NavigationBars/DriveActionBar/DriveActionBarMobile.tsx @@ -22,6 +22,7 @@ import CreateFolderLightIcon from '@media/UI/create-folder-light.svg'; import CreateFolderDarkIcon from '@media/UI/create-folder-dark.svg'; import { UpdateDriveProps } from '@interfaces/handlers'; import { useLocales } from '@context/LocalesContext'; +import PodContext from '@context/PodContext'; export interface DriveActionBarMobileProps extends UpdateDriveProps { refreshPods?: () => void; @@ -32,12 +33,13 @@ const DriveActionBarItem = ( label: string, imageLight: JSX.Element, imageDark: JSX.Element, - onClick: () => void + onClick: () => void, + disabled = false ) => { return (
{theme === 'light' ? imageLight : imageDark} @@ -55,6 +57,7 @@ const DriveActionBarMobile: FC = ({ refreshPods, }) => { const { theme } = useContext(ThemeContext); + const { activePod } = useContext(PodContext); const [showCreatePodModal, setShowCreatePodModal] = useState(false); const [showUploadFileModal, setShowUploadFileModal] = useState(false); @@ -77,7 +80,8 @@ const DriveActionBarMobile: FC = ({ intl.get('UPLOAD'), , , - () => setShowUploadFileModal(true) + () => setShowUploadFileModal(true), + !activePod )} {DriveActionBarItem( theme, @@ -91,7 +95,8 @@ const DriveActionBarMobile: FC = ({ intl.get('FOLDER'), , , - () => setShowCreateFolderModal(true) + () => setShowCreateFolderModal(true), + !activePod )} {showCreatePodModal ? (