From 199cb628b9f789bfbcb8579a669040436798c434 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Thu, 18 Jan 2024 13:32:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Disable=20shared=20with?= =?UTF-8?q?=20me=20section=20when=20sharing=20is=20disabled=20(#323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/views/client/side-bar/index.tsx | 94 +++++++++++++++---- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/side-bar/index.tsx b/tdrive/frontend/src/app/views/client/side-bar/index.tsx index 189c19d9..25cb6f71 100644 --- a/tdrive/frontend/src/app/views/client/side-bar/index.tsx +++ b/tdrive/frontend/src/app/views/client/side-bar/index.tsx @@ -22,7 +22,10 @@ import DiskUsage from '../common/disk-usage'; import Actions from './actions'; import { useHistory } from 'react-router-dom'; import RouterServices from '@features/router/services/router-service'; -import Languages from "features/global/services/languages-service"; +import Languages from 'features/global/services/languages-service'; +import FeatureTogglesService, { + FeatureNames, +} from '@features/global/services/feature-toggles-service'; export default () => { const history = useHistory(); @@ -30,7 +33,7 @@ export default () => { const company = useRouterCompany(); const { viewId, itemId, dirId } = RouterServices.getStateFromRoute(); const [parentId, setParentId] = useRecoilState( - DriveCurrentFolderAtom({ initialFolderId: viewId || 'user_'+user?.id }), + DriveCurrentFolderAtom({ initialFolderId: viewId || 'user_' + user?.id }), ); const active = false; const { sharedWithMe, inTrash, path } = useDriveItem(parentId); @@ -40,7 +43,6 @@ export default () => { if (inTrash) folderType = 'trash'; if (sharedWithMe) folderType = 'shared'; - useEffect(() => { !itemId && !dirId && viewId && setParentId(viewId); dirId && viewId && setParentId(dirId); @@ -65,29 +67,72 @@ export default () => {
Drive - + {FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_SEARCH_USERS) && ( + + )} {false && ( <> {false && ( @@ -142,4 +198,4 @@ export default () => {
); -}; \ No newline at end of file +};