Skip to content

Commit fc94e0c

Browse files
committed
fixup! ✨(frontend) improve mobile UX by showing subdocs count
1 parent 4f4f111 commit fc94e0c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useTreeContext } from '@gouvfr-lasuite/ui-kit';
21
import { t } from 'i18next';
32
import React from 'react';
43

@@ -20,18 +19,12 @@ interface DocHeaderInfoProps {
2019

2120
export const DocHeaderInfo = ({ doc }: DocHeaderInfoProps) => {
2221
const { isDesktop } = useResponsiveStore();
23-
const treeContext = useTreeContext<Doc | null>();
2422
const { transRole } = useTrans();
2523
const { isEditable } = useIsCollaborativeEditable(doc);
2624
const { relativeDate, calculateDaysLeft } = useDate();
2725
const { data: config } = useConfig();
2826

29-
const countFromTreeContext =
30-
treeContext?.root?.id === doc.id
31-
? treeContext?.treeData?.nodes?.length
32-
: undefined;
33-
34-
const childrenCount = countFromTreeContext ?? doc.numchild ?? 0;
27+
const childrenCount = doc.numchild ?? 0;
3528

3629
const relativeOnly = relativeDate(doc.updated_at);
3730

0 commit comments

Comments
 (0)