Skip to content

Commit 61c0544

Browse files
committed
chore: download type
1 parent 27534e7 commit 61c0544

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

packages/doom/src/theme/Layout.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ export const Layout = () => {
150150
<VersionsNav />
151151
<OriginalLayout
152152
beforeOutline={
153-
<X.p className="rp-doc" style={{ marginBottom: 16 }}>
154-
<Link href={pdfLink} target="_blank" rel="noopener noreferrer">
155-
{t('view_docs_as_pdf')}
156-
</Link>
157-
</X.p>
153+
pdfLink && (
154+
<X.p className="rp-doc" style={{ marginBottom: 16 }}>
155+
<Link href={pdfLink} target="_blank" rel="noopener noreferrer">
156+
{t('view_docs_as_pdf')}
157+
</Link>
158+
</X.p>
159+
)
158160
}
159161
/>
160162
</ForceRenderContext>

packages/doom/src/theme/Link.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export const Link = (props: LinkProps) => {
1313
return (
1414
<OriginalLink
1515
{...props}
16-
download={props.href?.endsWith('.pdf') && props.download !== false}
16+
download={
17+
// type-coverage:ignore-next-line -- out of control
18+
props.download == null
19+
? props.href?.endsWith('.pdf')
20+
: // type-coverage:ignore-next-line -- out of control
21+
(props.download as unknown)
22+
}
1723
/>
1824
)
1925
}

packages/doom/src/theme/VersionsNav/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const VersionsNav_ = () => {
113113
}
114114

115115
if (versionsBase == null) {
116-
navList.push({ text: version, items: [] })
116+
if (version) {
117+
navList.push({ text: version, items: [] })
118+
}
117119
} else {
118120
const versionItems: NavItem[] = versions.map((v) => ({
119121
text: v,

0 commit comments

Comments
 (0)