diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47a628b9ba..ccbfe66c58 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ and this project adheres to
### Added
- ✨(api) add API route to fetch document content #1206
+- ✨(frontend) display pin on top of doc emoji or default icon #1358
### Changed
diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/assets/pin.svg b/src/frontend/apps/impress/src/features/docs/doc-management/assets/pin.svg
new file mode 100644
index 0000000000..3b6e4a2ea7
--- /dev/null
+++ b/src/frontend/apps/impress/src/features/docs/doc-management/assets/pin.svg
@@ -0,0 +1,41 @@
+
diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/components/DocIcon.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/components/DocIcon.tsx
index 0bcc3aa5a4..01a1929d25 100644
--- a/src/frontend/apps/impress/src/features/docs/doc-management/components/DocIcon.tsx
+++ b/src/frontend/apps/impress/src/features/docs/doc-management/components/DocIcon.tsx
@@ -1,36 +1,74 @@
import { useTranslation } from 'react-i18next';
+import { css } from 'styled-components';
-import { Text, TextType } from '@/components';
+import { Box, Text, TextType } from '@/components';
+import { useCunninghamTheme } from '@/cunningham';
+
+import Pin from '../assets/pin.svg';
type DocIconProps = TextType & {
emoji?: string | null;
defaultIcon: React.ReactNode;
+ isPinned?: boolean;
};
export const DocIcon = ({
emoji,
defaultIcon,
+ isPinned = false,
$size = 'sm',
$variation = '1000',
$weight = '400',
...textProps
}: DocIconProps) => {
const { t } = useTranslation();
-
- if (!emoji) {
- return <>{defaultIcon}>;
- }
+ const { colorsTokens } = useCunninghamTheme();
return (
-
- {emoji}
-
+
+ {!emoji ? (
+ <>{defaultIcon}>
+ ) : (
+
+ {emoji}
+
+ )}
+
+ {isPinned && (
+
+
+
+ )}
+
);
};
diff --git a/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx b/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx
index ab11f0a2d6..5e8375f867 100644
--- a/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx
+++ b/src/frontend/apps/impress/src/features/docs/doc-management/components/SimpleDocItem.tsx
@@ -7,7 +7,6 @@ import { useCunninghamTheme } from '@/cunningham';
import { Doc, getEmojiAndTitle, useTrans } from '@/docs/doc-management';
import { useResponsiveStore } from '@/stores';
-import PinnedDocumentIcon from '../assets/pinned-document.svg';
import SimpleFileIcon from '../assets/simple-document.svg';
import { DocIcon } from './DocIcon';
@@ -60,25 +59,18 @@ export const SimpleDocItem = ({
$padding={`${spacingsTokens['3xs']} 0`}
data-testid={isPinned ? `doc-pinned-${doc.id}` : undefined}
>
- {isPinned ? (
-
- ) : (
-
- }
- $size="25px"
- />
- )}
+
+ }
+ $size="25px"
+ />
{
$css="overflow: auto;"
aria-label={`${doc.title}, ${t('Updated')} ${DateTime.fromISO(doc.updated_at).toRelative()}`}
>
-
+