Skip to content

Commit 44b4a2f

Browse files
committed
fix: side nav
1 parent 7516900 commit 44b4a2f

File tree

4 files changed

+35
-26
lines changed

4 files changed

+35
-26
lines changed

apps/developer-hub/src/components/CopyAddress/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { CopyButton } from "@pythnetwork/component-library/CopyButton";
44
import { Link } from "@pythnetwork/component-library/Link";
5+
import { useMemo } from 'react';
56

67
import styles from "./index.module.scss";
78

@@ -21,15 +22,17 @@ const CopyAddress = ({
2122
maxLength?: number;
2223
url?: string;
2324
}) => {
25+
const formattedAddress = useMemo(() => truncate(address, maxLength), [address, maxLength]);
26+
2427
return url ? (
2528
<div className={styles.address}>
2629
<Link href={url} target="_blank" rel="noreferrer">
27-
{truncate(address, maxLength)}
30+
{formattedAddress}
2831
</Link>
2932
<CopyButton text={address} iconOnly />
3033
</div>
3134
) : (
32-
<CopyButton text={address}>{truncate(address, maxLength)}</CopyButton>
35+
<CopyButton text={address}>{formattedAddress}</CopyButton>
3336
);
3437
};
3538

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Overrides for Fumadocs content. Everything after prose is MDX generated content to which we can't apply custom classes so we need to globally select and override content
3+
*/
4+
.prose {
5+
line-height: 1.5;
6+
}
7+
8+
:where(.prose) :where(p, li) {
9+
line-height: 1.5;
10+
}
11+
12+
:where(.prose) :where(h1, h2, h3, h4, h5, h6) {
13+
line-height: 1.2;
14+
}
15+
16+
.prose p + ul,
17+
.prose p + ol {
18+
margin-top: 0;
19+
padding-top: 0.25rem;
20+
}
21+
22+
.prose p:has(+ ul),
23+
.prose p:has(+ ol) {
24+
margin-bottom: 0;
25+
}
26+
27+
#nd-sidebar {
28+
--fd-sidebar-top: var(--header-height) !important;
29+
}

apps/developer-hub/src/components/Root/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
@import "fumadocs-ui/css/neutral.css";
33
@import "fumadocs-ui/css/preset.css";
44
@import "./theme.css";
5+
@import "./fumadocs-global-style-overrides.css";

apps/developer-hub/src/components/Root/theme.css

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -334,27 +334,3 @@
334334
);
335335
--color-fd-ring: light-dark(var(--color-violet-600), var(--color-violet-400));
336336
}
337-
338-
/* Global typography: tighten line spacing in docs content */
339-
.prose {
340-
line-height: 1.5;
341-
}
342-
343-
:where(.prose) :where(p, li) {
344-
line-height: 1.5;
345-
}
346-
347-
:where(.prose) :where(h1, h2, h3, h4, h5, h6) {
348-
line-height: 1.2;
349-
}
350-
351-
.prose p + ul,
352-
.prose p + ol {
353-
margin-top: 0;
354-
padding-top: 0.25rem;
355-
}
356-
357-
.prose p:has(+ ul),
358-
.prose p:has(+ ol) {
359-
margin-bottom: 0;
360-
}

0 commit comments

Comments
 (0)