Skip to content

Commit

Permalink
chore: dont' show icon for folder type
Browse files Browse the repository at this point in the history
  • Loading branch information
cptrodgers committed May 10, 2024
1 parent d757487 commit fdd13a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -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) {
Expand All @@ -41,9 +44,11 @@ const CoverPage = () => {
<div>
<CoverPhotoHeader />
<div style={{ padding: 20, display: "flex", alignItems: "center" }}>
<div>
<DocumentIconHeader />
</div>
{!isFolder && (
<div>
<DocumentIconHeader />
</div>
)}
<div>
<DocumentTitle
autoSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ const LessonItem = ({
<Link href={formatDocumentRoute(item.id)} passHref>
<LessonItemContainer ref={ref} $active={active}>
<div style={{ marginTop: 5 }}>{isFolder && icon}</div>
<span style={{ display: "flex" }}>{documentIconValue}</span>
{!isFolder && (
<span style={{ display: "flex" }}>{documentIconValue}</span>
)}
<div style={{ display: "flex", alignItems: "center", width: "100%" }}>
<div style={{ flex: "1", display: "inline-grid" }}>
{item.parentId ? (
Expand Down
1 change: 1 addition & 0 deletions apps/ikigai/graphql/query/DocumentQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export const GET_DOCUMENT_V2 = gql`
spaceId
iconType
iconValue
documentType
}
}
`;
1 change: 1 addition & 0 deletions apps/ikigai/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,7 @@ export interface GetDocumentV2_documentGet {
spaceId: number | null;
iconType: IconType | null;
iconValue: string | null;
documentType: DocumentType;
}

export interface GetDocumentV2 {
Expand Down

0 comments on commit fdd13a1

Please sign in to comment.