Skip to content

Commit 8c21ee7

Browse files
authored
Merge pull request #3114 from pyth-network/feat/remove-appshell
feat(dev-hub): remove app shell for now
2 parents 772173c + 9f31998 commit 8c21ee7

File tree

7 files changed

+84
-53
lines changed

7 files changed

+84
-53
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"pages": ["price-feeds"]
2+
"pages": ["price-feeds", "express-relay", "entropy"]
33
}

apps/developer-hub/src/app/(docs)/[section]/layout.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@ import type { ReactNode } from "react";
33

44
import { docsOptions } from "../../../config/layout.config";
55

6-
export default async function Layout({
7-
children,
8-
...props
9-
}: {
10-
children: ReactNode;
11-
params: Promise<{ section: string }>;
12-
}) {
13-
const params = await props.params;
6+
export default function Layout({ children }: { children: ReactNode }) {
147
const options = { ...docsOptions };
15-
options.sidebar = {
16-
...options.sidebar,
17-
// {} (empty object) means true
18-
tabs: params.section === "price-feeds" ? {} : false,
19-
};
208
return <DocsLayout {...options}>{children}</DocsLayout>;
219
}

apps/developer-hub/src/app/price-feeds/page.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
@import "tailwindcss";
22
@import "fumadocs-ui/css/neutral.css";
33
@import "fumadocs-ui/css/preset.css";
4-
@import "./theme.css";
5-
@import "./fumadocs-global-style-overrides.css";
4+
/* @import "./theme.css"; this overrides the default colors to match the pyth branding */
5+
/* @import "./fumadocs-global-style-overrides.css"; */
6+
7+
.light {
8+
--color-fd-background: hsla(0, 16%, 96%, 1);
9+
--color-fd-foreground: hsla(0, 16%, 5%, 1);
10+
--color-fd-muted: hsla(0, 16%, 90%, 1);
11+
--color-fd-muted-foreground: rgba(30, 30, 30, 0.564);
12+
--color-fd-popover: hsl(0, 0%, 98%);
13+
--color-fd-popover-foreground: hsl(0, 0%, 15.1%);
14+
--color-fd-card: hsla(0, 16%, 94%, 1);
15+
--color-fd-card-foreground: hsl(0, 0%, 8%);
16+
--color-fd-border: hsla(0, 12%, 85%, 1);
17+
--color-fd-primary: hsla(263, 70%, 50%, 1);
18+
--color-fd-primary-foreground: hsl(204, 90%, 51%);
19+
--color-fd-secondary: hsl(0, 0%, 93.1%);
20+
--color-fd-secondary-foreground: hsl(0, 0%, 0%);
21+
--color-fd-accent: hsla(0, 0%, 0%, 0.054);
22+
--color-fd-accent-foreground: hsl(0, 0%, 0%);
23+
--color-fd-ring: hsla(263, 70%, 50%, 1);
24+
}
25+
26+
.dark {
27+
--color-fd-background: hsl(240, 4%, 11%);
28+
--color-fd-foreground: hsl(250, 18%, 87%);
29+
--color-fd-muted: hsl(0, 3%, 6%);
30+
--color-fd-muted-foreground: hsla(250, 18%, 87%, 0.571);
31+
--color-fd-popover: hsl(0, 0%, 9%);
32+
--color-fd-popover-foreground: hsl(0, 0%, 82%);
33+
--color-fd-card: hsl(240, 2%, 9%);
34+
--color-fd-card-foreground: hsl(0, 0%, 98%);
35+
--color-fd-border: hsla(240, 18%, 86%, 0.085);
36+
--color-fd-primary: rgb(197, 157, 254);
37+
--color-fd-primary-foreground: hsl(139, 91%, 18%);
38+
--color-fd-secondary: hsl(0, 0%, 12.9%);
39+
--color-fd-secondary-foreground: hsl(250, 18%, 87%);
40+
--color-fd-accent: hsla(0, 0%, 100%, 0.079);
41+
--color-fd-accent-foreground: hsl(250, 18%, 87%);
42+
--color-fd-ring: hsla(262, 83%, 58%, 1);
43+
}
Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
import { AppBody, AppShellRoot } from "@pythnetwork/component-library/AppShell";
1+
import { RootProviders } from "@pythnetwork/component-library/AppShell";
22
import { RootProvider as FumadocsRootProvider } from "fumadocs-ui/provider";
33
import { NuqsAdapter } from "nuqs/adapters/next/app";
44
import type { ReactNode } from "react";
55

6-
import {
7-
AMPLITUDE_API_KEY,
8-
ENABLE_ACCESSIBILITY_REPORTING,
9-
GOOGLE_ANALYTICS_ID,
10-
} from "../../config/server";
11-
import { SearchButton } from "../search-button";
12-
136
import "./global.css";
147

158
export const TABS = [
@@ -24,21 +17,19 @@ type Props = {
2417
};
2518

2619
export const Root = ({ children }: Props) => (
27-
<AppShellRoot
28-
amplitudeApiKey={AMPLITUDE_API_KEY}
29-
googleAnalyticsId={GOOGLE_ANALYTICS_ID}
30-
enableAccessibilityReporting={ENABLE_ACCESSIBILITY_REPORTING}
31-
providers={[NuqsAdapter]}
32-
>
33-
<FumadocsRootProvider
34-
search={{
35-
enabled: true,
36-
options: {
37-
api: "/api/search",
38-
},
39-
}}
40-
>
41-
<AppBody
20+
<html lang="en">
21+
<body>
22+
<RootProviders providers={[NuqsAdapter]}>
23+
<FumadocsRootProvider
24+
search={{
25+
enabled: true,
26+
options: {
27+
api: "/api/search",
28+
},
29+
}}
30+
>
31+
{/* commenting out the app body because we don't have the app shell anymore
32+
<AppBody
4233
appName="Developer Hub"
4334
displaySupportButton={false}
4435
extraCta={<SearchButton />}
@@ -47,9 +38,11 @@ export const Root = ({ children }: Props) => (
4738
href: "https://dev-forum.pyth.network/",
4839
}}
4940
tabs={TABS}
50-
>
51-
{children}
52-
</AppBody>
53-
</FumadocsRootProvider>
54-
</AppShellRoot>
41+
> */}
42+
{children}
43+
{/* </AppBody> */}
44+
</FumadocsRootProvider>
45+
</RootProviders>
46+
</body>
47+
</html>
5548
);
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Logo } from "@pythnetwork/component-library/Header";
12
import type { DocsLayoutProps } from "fumadocs-ui/layouts/docs";
23
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
34

@@ -6,20 +7,28 @@ import { source } from "../lib/source";
67
export const baseOptions: BaseLayoutProps = {
78
nav: {
89
enabled: true,
10+
title: (
11+
<>
12+
<Logo width="1em" height="1em" />
13+
Developer Hub
14+
</>
15+
),
916
},
10-
themeSwitch: {
11-
enabled: false, // Keep this false as the theme switch is handled by the component library
12-
},
13-
searchToggle: {
14-
enabled: false,
15-
},
17+
// these are commented out because we don't have the app shell anymore
18+
// themeSwitch: {
19+
// enabled: false, // Keep this false as the theme switch is handled by the component library
20+
// },
21+
// searchToggle: {
22+
// enabled: false,
23+
// },
1624
};
1725

1826
export const docsOptions: DocsLayoutProps = {
1927
...baseOptions,
2028
tree: source.pageTree,
2129
sidebar: {
22-
tabs: false,
23-
collapsible: false,
30+
// these are commented out because we don't have the app shell anymore
31+
// tabs: false,
32+
// collapsible: false,
2433
},
2534
};

packages/component-library/src/Header/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { Card } from "../Card/index.jsx";
2020
import { Link } from "../Link/index.jsx";
2121
import type { Link as UnstyledLink } from "../unstyled/Link/index.jsx";
2222

23+
export { default as Logo } from "./logo.svg";
24+
2325
type Props = ComponentProps<"header"> & {
2426
appName: string;
2527
mainCta?:
@@ -239,3 +241,5 @@ export const SupportDrawer = {
239241
</>
240242
),
241243
};
244+
245+
export { default as HeaderLogo } from "./logo.svg";

0 commit comments

Comments
 (0)