Skip to content

Commit 96aaa51

Browse files
committed
Restore docs sidebar recency badges
1 parent 8fc93b4 commit 96aaa51

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/components/LibraryLayout.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,14 @@ export function LibraryLayout({
984984
const isHomeLink = child.to === '..'
985985
const frameworkDocsTarget = getFrameworkDocsLinkTarget(child.to)
986986

987+
const recency = getDocRecency(child.addedAt, child.updatedAt)
988+
const recencyPill = recency ? (
989+
<DocRecencyPill
990+
recency={recency}
991+
date={recency === 'new' ? child.addedAt : child.updatedAt}
992+
/>
993+
) : null
994+
987995
const renderLinkContent = (isActive: boolean) => (
988996
<div className={twMerge(linkClasses, isActive && 'opacity-100')}>
989997
<div
@@ -996,17 +1004,10 @@ export function LibraryLayout({
9961004
>
9971005
{child.label}
9981006
</div>
1007+
{recencyPill}
9991008
</div>
10001009
)
10011010

1002-
const recency = getDocRecency(child.addedAt, child.updatedAt)
1003-
const recencyPill = recency ? (
1004-
<DocRecencyPill
1005-
recency={recency}
1006-
date={recency === 'new' ? child.addedAt : child.updatedAt}
1007-
/>
1008-
) : null
1009-
10101011
return (
10111012
<li key={i}>
10121013
{child.to.startsWith('http') ? (

0 commit comments

Comments
 (0)