diff --git a/app/components/Sidebar/components/DocumentLink.tsx b/app/components/Sidebar/components/DocumentLink.tsx index 8da367b35b..734b15d56e 100644 --- a/app/components/Sidebar/components/DocumentLink.tsx +++ b/app/components/Sidebar/components/DocumentLink.tsx @@ -143,6 +143,8 @@ function InnerDocumentLink( const isMoving = documents.movingDocumentId === node.id; const manualSort = collection?.sort.field === "index"; const can = policies.abilities(node.id); + const icon = document?.icon || node.icon || node.emoji; + const color = document?.color || node.color; // Draggable const [{ isDragging }, drag, preview] = useDrag({ @@ -150,6 +152,7 @@ function InnerDocumentLink( item: () => ({ ...node, depth, + icon: icon ? : undefined, active: isActiveDocument, collectionId: collection?.id || "", }), @@ -283,8 +286,6 @@ function InnerDocumentLink( const title = (activeDocument?.id === node.id ? activeDocument.title : node.title) || t("Untitled"); - const icon = document?.icon || node.icon || node.emoji; - const color = document?.color || node.color; const isExpanded = expanded && !isDragging; const hasChildren = nodeChildren.length > 0; diff --git a/app/components/Sidebar/components/DragPlaceholder.tsx b/app/components/Sidebar/components/DragPlaceholder.tsx index 193b26cf55..289997b205 100644 --- a/app/components/Sidebar/components/DragPlaceholder.tsx +++ b/app/components/Sidebar/components/DragPlaceholder.tsx @@ -2,7 +2,6 @@ import * as React from "react"; import { useDragLayer, XYCoord } from "react-dnd"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; -import Icon from "~/components/Icon"; import useStores from "~/hooks/useStores"; import SidebarLink from "./SidebarLink"; @@ -62,7 +61,7 @@ const DragPlaceholder = () => {
} + icon={item.icon} label={item.title || t("Untitled")} isDraft={item.isDraft} depth={item.depth}