Skip to content

Commit a9be1c2

Browse files
committed
✨(frontend) doc page when deleted
Whe the doc is deleted, the doc page is a bit different, we have to adapt the doc header to add some information and actions that are relevant for a deleted doc.
1 parent 99ea798 commit a9be1c2

File tree

1 file changed

+4
-3
lines changed
  • src/frontend/apps/impress/src/features/docs/doc-header/components

1 file changed

+4
-3
lines changed

src/frontend/apps/impress/src/features/docs/doc-header/components/DocHeader.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { DateTime } from 'luxon';
21
import { useTranslation } from 'react-i18next';
32

43
import { Box, HorizontalSeparator, Text } from '@/components';
@@ -11,6 +10,7 @@ import {
1110
useIsCollaborativeEditable,
1211
useTrans,
1312
} from '@/docs/doc-management';
13+
import { useDate } from '@/hook';
1414
import { useResponsiveStore } from '@/stores';
1515

1616
import { AlertNetwork } from './AlertNetwork';
@@ -30,6 +30,7 @@ export const DocHeader = ({ doc }: DocHeaderProps) => {
3030
const { isEditable } = useIsCollaborativeEditable(doc);
3131
const docIsPublic = getDocLinkReach(doc) === LinkReach.PUBLIC;
3232
const docIsAuth = getDocLinkReach(doc) === LinkReach.AUTHENTICATED;
33+
const { relativeDate } = useDate();
3334

3435
return (
3536
<>
@@ -79,14 +80,14 @@ export const DocHeader = ({ doc }: DocHeaderProps) => {
7980
</Text>
8081
<Text $variation="600" $size="s">
8182
{t('Last update: {{update}}', {
82-
update: DateTime.fromISO(doc.updated_at).toRelative(),
83+
update: relativeDate(doc.updated_at),
8384
})}
8485
</Text>
8586
</>
8687
)}
8788
{!isDesktop && (
8889
<Text $variation="400" $size="s">
89-
{DateTime.fromISO(doc.updated_at).toRelative()}
90+
{relativeDate(doc.updated_at)}
9091
</Text>
9192
)}
9293
</Box>

0 commit comments

Comments
 (0)