From fdd13a18316a124b24368bdbb18b802b0ab45c49 Mon Sep 17 00:00:00 2001 From: cptrodgers Date: Fri, 10 May 2024 21:01:13 +0700 Subject: [PATCH] chore: dont' show icon for folder type --- .../DocumentV2/DocumentBody/CoverPage/index.tsx | 13 +++++++++---- .../common/LearningModuleDnd/LessonItem.tsx | 4 +++- apps/ikigai/graphql/query/DocumentQuery.ts | 1 + apps/ikigai/graphql/types.ts | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/ikigai/components/DocumentV2/DocumentBody/CoverPage/index.tsx b/apps/ikigai/components/DocumentV2/DocumentBody/CoverPage/index.tsx index 880b9232..fb34a520 100644 --- a/apps/ikigai/components/DocumentV2/DocumentBody/CoverPage/index.tsx +++ b/apps/ikigai/components/DocumentV2/DocumentBody/CoverPage/index.tsx @@ -8,7 +8,7 @@ import useDocumentStore from "context/DocumentV2Store"; import CoverPhotoHeader from "./CoverPhotoHeader"; import UseUpdateDocument from "hook/UseUpdateDocument"; import usePermission from "hook/UsePermission"; -import { DocumentActionPermission } from "graphql/types"; +import { DocumentActionPermission, DocumentType } from "graphql/types"; import DocumentIconHeader from "./DocumentIconHeader"; const CoverPage = () => { @@ -25,6 +25,9 @@ const CoverPage = () => { (state) => state.updateSpaceDocument, ); const debouncedTitle = useDebounce(activeDocumentTitle, { wait: 500 }); + const isFolder = useDocumentStore( + (state) => state.activeDocument?.documentType === DocumentType.FOLDER, + ); useEffect(() => { if (debouncedTitle) { @@ -41,9 +44,11 @@ const CoverPage = () => {
-
- -
+ {!isFolder && ( +
+ +
+ )}
{isFolder && icon}
- {documentIconValue} + {!isFolder && ( + {documentIconValue} + )}
{item.parentId ? ( diff --git a/apps/ikigai/graphql/query/DocumentQuery.ts b/apps/ikigai/graphql/query/DocumentQuery.ts index 830cea0f..4660d1bf 100644 --- a/apps/ikigai/graphql/query/DocumentQuery.ts +++ b/apps/ikigai/graphql/query/DocumentQuery.ts @@ -255,6 +255,7 @@ export const GET_DOCUMENT_V2 = gql` spaceId iconType iconValue + documentType } } `; diff --git a/apps/ikigai/graphql/types.ts b/apps/ikigai/graphql/types.ts index d1e0b281..f340fb4a 100644 --- a/apps/ikigai/graphql/types.ts +++ b/apps/ikigai/graphql/types.ts @@ -1713,6 +1713,7 @@ export interface GetDocumentV2_documentGet { spaceId: number | null; iconType: IconType | null; iconValue: string | null; + documentType: DocumentType; } export interface GetDocumentV2 {