From 9f758bbcde39ab3d3e77b40aa483a19865209440 Mon Sep 17 00:00:00 2001 From: Akmal Isomadinov Date: Fri, 9 Aug 2024 18:27:19 +0500 Subject: [PATCH] Web:EmptyContainer Added new empty screen for document page --- .../EmptyViewContainer.helpers.tsx | 5 +++++ .../EmptyViewContainer.utils.tsx | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx index 4299ec8638..15c2a8e43d 100644 --- a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx +++ b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.helpers.tsx @@ -306,6 +306,11 @@ export const getOptions = ( inviteRootRoom, migrationData, ]) + .with([FolderType.USER, ShareAccessRights.None], () => [ + createDoc, + createSpreadsheet, + createPresentation, + ]) .otherwise(() => []); } diff --git a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.utils.tsx b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.utils.tsx index a5e41978ff..47572f9ab9 100644 --- a/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.utils.tsx +++ b/packages/client/src/components/EmptyContainer/sub-components/EmptyViewContainer/EmptyViewContainer.utils.tsx @@ -91,8 +91,6 @@ import type { } from "./EmptyViewContainer.types"; export const isUser = (access: AccessType) => { - console.log({ access }); - return ( access !== ShareAccessRights.None && access !== ShareAccessRights.RoomManager && @@ -170,7 +168,9 @@ export const getRootDesctiption = ( .with([FolderType.Rooms, ShareAccessRights.DenyAccess], () => t("EmptyView:EmptyRootRoomUserDescription"), ) - .with([FolderType.USER, P._], () => t("Test")) + .with([FolderType.USER, ShareAccessRights.None], () => + t("EmptyView:DefaultFolderDescription"), + ) .with([FolderType.Recent, P._], () => t("Test")) .with([FolderType.Archive, P._], () => t("Test")) .with([FolderType.TRASH, P._], () => t("Test")) @@ -248,6 +248,8 @@ export const getRootTitle = ( access: AccessType, rootFolderType: Nullable, ) => { + console.log({ access, rootFolderType }); + return match([rootFolderType, access]) .with([FolderType.Rooms, ShareAccessRights.None], () => t("Files:EmptyRootRoomHeader", { @@ -257,7 +259,9 @@ export const getRootTitle = ( .with([FolderType.Rooms, ShareAccessRights.DenyAccess], () => t("EmptyView:EmptyRootRoomUserTitle"), ) - .with([FolderType.USER, P._], () => t("Test")) + .with([FolderType.USER, ShareAccessRights.None], () => + t("Files:EmptyScreenFolder"), + ) .with([FolderType.Recent, P._], () => t("Test")) .with([FolderType.Archive, P._], () => t("Test")) .with([FolderType.TRASH, P._], () => t("Test")) @@ -388,7 +392,9 @@ export const getRootIcom = ( ), ) - .with([FolderType.USER, P._], () =>
) + .with([FolderType.USER, ShareAccessRights.None], () => + isBaseTheme ? : , + ) .with([FolderType.Recent, P._], () =>
) .with([FolderType.Archive, P._], () =>
) .with([FolderType.TRASH, P._], () =>
)