Skip to content

Commit

Permalink
πŸ› Fix antivirus status for shared view (#745)
Browse files Browse the repository at this point in the history
πŸ› Fix antivirus status for shared view
  • Loading branch information
MontaGhanmy authored Nov 26, 2024
1 parent 36881ce commit 8f8586f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Login from '@views/login/login';
import Logout from '@views/login/logout';
import Error from '@views/error';
import Join from '@views/join';
import PublicMainView from '@views/client/body/drive/shared';
import PublicMainView from '@views/client/body/drive/shared-view';
import Observable from '../../../deprecated/Observable/Observable';
import { getWorkspacesByCompany } from '@features/workspaces/state/workspace-list';

Expand Down
10 changes: 10 additions & 0 deletions tdrive/frontend/src/app/views/client/body/drive/shared-view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { lazy, Suspense } from 'react';
const Shared = lazy(() => import('@views/client/body/drive/shared'));

export default () => {
return (
<Suspense fallback={<></>}>
<Shared />
</Suspense>
);
};
60 changes: 33 additions & 27 deletions tdrive/frontend/src/app/views/client/body/drive/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
import MenusBodyLayer from '@components/menus/menus-body-layer';
import Api from '@features/global/framework/api-service';
import Languages from '@features/global/services/languages-service';
import { useFeatureToggles } from '@components/locked-features-components/feature-toggles-hooks';
import { addApiUrlIfNeeded } from '@features/global/utils/URLUtils';
import RouterService from '@features/router/services/router-service';
import Drive from '@views/client/body/drive';
Expand All @@ -28,6 +29,7 @@ import LocalStorage from 'app/features/global/framework/local-storage-service';

export default () => {
const companyId = useRouterCompany();
const { FeatureToggles, activeFeatureNames } = useFeatureToggles();

//Create a different local storage for shared view
useEffect(() => {
Expand Down Expand Up @@ -61,34 +63,38 @@ export default () => {
}

return (
<div className="flex flex-col h-full w-full dark:bg-zinc-900">
<div className="flex flex-row items-center justify-center bg-blue-500 px-4 py-2">
<div className="grow flex flex-row items-center">
{group.logo && (
<Avatar avatar={group.logo} className="inline-block mr-3" size="sm" type="square" />
)}
<span className="text-white font-semibold" style={{ lineHeight: '32px' }}>
Twake Drive
</span>
</div>
<div className="shrink-0">
<a href="https://twake.app" target="_BLANK" rel="noreferrer" className="!text-white">
<span className="nomobile text-white">
{Languages.t('scenes.app.mainview.create_account')}
</span>
Twake Workplace &nbsp; πŸ‘‰
</a>
<FeatureToggles features={activeFeatureNames}>
<>
<div className="flex flex-col h-full w-full dark:bg-zinc-900">
<div className="flex flex-row items-center justify-center bg-blue-500 px-4 py-2">
<div className="grow flex flex-row items-center">
{group.logo && (
<Avatar avatar={group.logo} className="inline-block mr-3" size="sm" type="square" />
)}
<span className="text-white font-semibold" style={{ lineHeight: '32px' }}>
Twake Drive
</span>
</div>
<div className="shrink-0">
<a href="https://twake.app" target="_BLANK" rel="noreferrer" className="!text-white">
<span className="nomobile text-white">
{Languages.t('scenes.app.mainview.create_account')}
</span>
Twake Workplace &nbsp; πŸ‘‰
</a>
</div>
</div>
<div className="h-full main-view public p-4 pb-16">
<AccessChecker folderId={documentId} token={token}>
<Drive initialParentId={documentId} inPublicSharing={true} />
</AccessChecker>
</div>
<MenusBodyLayer />
<UploadsViewer />
<CreateModalWithUploadZones initialParentId={documentId} />
</div>
</div>
<div className="h-full main-view public p-4 pb-16">
<AccessChecker folderId={documentId} token={token}>
<Drive initialParentId={documentId} inPublicSharing={true} />
</AccessChecker>
</div>
<MenusBodyLayer />
<UploadsViewer />
<CreateModalWithUploadZones initialParentId={documentId} />
</div>
</>
</FeatureToggles>
);
};

Expand Down

0 comments on commit 8f8586f

Please sign in to comment.