Skip to content

Commit 938d8d6

Browse files
committed
fixup! ✨(frontend) improve mobile UX by showing subdocs count
1 parent e6bbbf3 commit 938d8d6

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

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

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,40 +59,39 @@ export const DocHeaderInfo = ({ doc }: DocHeaderInfoProps) => {
5959
}
6060

6161
const hasChildren = childrenCount > 0;
62+
63+
if (isDesktop) {
64+
return (
65+
<>
66+
<Text
67+
$variation="600"
68+
$size="s"
69+
$weight="bold"
70+
$theme={isEditable ? 'greyscale' : 'warning'}
71+
>
72+
{transRole(isEditable ? doc.user_role || doc.link_role : Role.READER)}
73+
&nbsp;·&nbsp;
74+
</Text>
75+
<Text $variation="600" $size="s">
76+
{dateToDisplay}
77+
</Text>
78+
</>
79+
);
80+
}
81+
6282
return (
6383
<>
64-
{isDesktop ? (
65-
<>
66-
<Text
67-
$variation="600"
68-
$size="s"
69-
$weight="bold"
70-
$theme={isEditable ? 'greyscale' : 'warning'}
71-
>
72-
{transRole(
73-
isEditable ? doc.user_role || doc.link_role : Role.READER,
74-
)}
75-
&nbsp;·&nbsp;
76-
</Text>
77-
<Text $variation="600" $size="s">
78-
{dateToDisplay}
79-
</Text>
80-
</>
81-
) : (
82-
<>
83-
<Text $variation="400" $size="s">
84-
{hasChildren ? relativeOnly : dateToDisplay}
85-
</Text>
86-
{hasChildren ? (
87-
<Text $variation="400" $size="s">
88-
&nbsp;•&nbsp;
89-
{t('Contains {{count}} sub-documents', {
90-
count: childrenCount,
91-
})}
92-
</Text>
93-
) : null}
94-
</>
95-
)}
84+
<Text $variation="400" $size="s">
85+
{hasChildren ? relativeOnly : dateToDisplay}
86+
</Text>
87+
{hasChildren ? (
88+
<Text $variation="400" $size="s">
89+
&nbsp;•&nbsp;
90+
{t('Contains {{count}} sub-documents', {
91+
count: childrenCount,
92+
})}
93+
</Text>
94+
) : null}
9695
</>
9796
);
9897
};

0 commit comments

Comments
 (0)