Skip to content

Commit 593ed01

Browse files
docs: Simplify React Native sidebar navigation
1 parent a2a61df commit 593ed01

File tree

1 file changed

+13
-244
lines changed

1 file changed

+13
-244
lines changed
Lines changed: 13 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { Book, BugIcon, CodeIcon, ZapIcon } from "lucide-react";
1+
import { BookIcon, BugIcon, CodeIcon, ZapIcon } from "lucide-react";
22
import type { SideBar } from "../../../components/Layouts/DocLayout";
33
import { ReactIcon, TypeScriptIcon } from "../../../icons";
4-
import { fetchTypeScriptDoc } from "../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
5-
import { getCustomTag } from "../../references/components/TDoc/utils/getSidebarLinkgroups";
64

75
const slug = "/react-native/v5";
8-
const docs = await fetchTypeScriptDoc("v5");
96

107
export const sidebar: SideBar = {
118
name: "Connect React Native SDK",
@@ -27,253 +24,25 @@ export const sidebar: SideBar = {
2724
href: `${slug}/troubleshooting`,
2825
icon: <BugIcon />,
2926
},
30-
{ separator: true },
3127
{
32-
name: "Core",
33-
isCollapsible: false,
34-
links: [
35-
{
36-
name: "Client",
37-
href: `${slug}/createThirdwebClient`,
38-
},
39-
{
40-
name: "ThirdwebProvider",
41-
href: `${slug}/ThirdwebProvider`,
42-
},
43-
{
44-
name: "Themes",
45-
links: [
46-
{
47-
name: "Theme Props",
48-
href: `${slug}/Theme`,
49-
icon: <CodeIcon />,
50-
},
51-
...(docs.functions
52-
?.filter((f) => {
53-
const [tag] = getCustomTag(f) || [];
54-
return tag === "@theme";
55-
})
56-
?.map((f) => ({
57-
name: f.name,
58-
href: `${slug}/${f.name}`,
59-
icon: <CodeIcon />,
60-
})) || []),
61-
],
62-
},
63-
{
64-
name: "TS reference",
65-
href: "/typescript/v5",
66-
icon: <TypeScriptIcon />,
67-
},
68-
{
69-
name: "React reference",
70-
href: "/react/v5",
71-
icon: <ReactIcon />,
72-
},
73-
],
74-
},
75-
{ separator: true },
76-
{
77-
name: "Wallets",
78-
isCollapsible: false,
79-
links: [
80-
{
81-
name: "UI Components",
82-
links: ["ConnectButton", "ConnectEmbed", "AutoConnect"].map(
83-
(name) => ({
84-
name,
85-
href: `${slug}/${name}`,
86-
icon: <CodeIcon />,
87-
}),
88-
),
89-
},
90-
{
91-
name: "Connection Hooks",
92-
href: `${slug}/connecting-wallets/hooks`,
93-
links:
94-
docs.hooks
95-
?.filter((hook) => {
96-
const [tag] = getCustomTag(hook) || [];
97-
return tag === "@walletConnection";
98-
})
99-
?.map((hook) => ({
100-
name: hook.name,
101-
href: `${slug}/${hook.name}`,
102-
icon: <CodeIcon />,
103-
})) || [],
104-
},
105-
{
106-
name: "Wallet Hooks",
107-
links:
108-
docs.hooks
109-
?.filter((hook) => {
110-
const [tag] = getCustomTag(hook) || [];
111-
return tag === "@wallet";
112-
})
113-
?.map((hook) => ({
114-
name: hook.name,
115-
href: `${slug}/${hook.name}`,
116-
icon: <CodeIcon />,
117-
})) || [],
118-
},
119-
{
120-
name: "In-App Wallets",
121-
links: [
122-
{
123-
name: "React API",
124-
href: "/react/v5/in-app-wallet/get-started",
125-
icon: <ReactIcon />,
126-
},
127-
],
128-
},
129-
{
130-
name: "Ecosystem Wallets",
131-
links: [
132-
{
133-
name: "React API",
134-
href: "/react/v5/ecosystem-wallet/get-started",
135-
icon: <ReactIcon />,
136-
},
137-
],
138-
},
139-
{
140-
name: "Account Abstraction",
141-
links: [
142-
{
143-
name: "React API",
144-
href: "/react/v5/account-abstraction/get-started",
145-
icon: <ReactIcon />,
146-
},
147-
],
148-
},
149-
{
150-
name: "Supported Wallets",
151-
href: "/typescript/v5/supported-wallets",
152-
icon: <TypeScriptIcon />,
153-
},
154-
],
155-
},
156-
{ separator: true },
157-
{
158-
name: "Social API",
159-
isCollapsible: false,
160-
links: ["useSocialProfiles"].map((name) => ({
161-
name,
162-
href: `${slug}/${name}`,
163-
icon: <CodeIcon />,
164-
})),
165-
},
166-
{ separator: true },
167-
{
168-
name: "Pay",
169-
isCollapsible: false,
170-
links: [
171-
{
172-
name: "Buy with Fiat",
173-
links:
174-
docs.hooks
175-
?.filter((f) => {
176-
const [tag] = getCustomTag(f) || [];
177-
return tag === "@buyCrypto" && f.name.includes("Fiat");
178-
})
179-
?.map((f) => ({
180-
name: f.name,
181-
href: `${slug}/${f.name}`,
182-
icon: <CodeIcon />,
183-
})) || [],
184-
},
185-
{
186-
name: "Buy with Crypto",
187-
links:
188-
docs.hooks
189-
?.filter((f) => {
190-
const [tag] = getCustomTag(f) || [];
191-
return tag === "@buyCrypto" && f.name.includes("Crypto");
192-
})
193-
?.map((f) => ({
194-
name: f.name,
195-
href: `${slug}/${f.name}`,
196-
icon: <CodeIcon />,
197-
})) || [],
198-
},
199-
],
200-
},
201-
{ separator: true },
202-
{
203-
name: "Blockchain API",
204-
isCollapsible: false,
205-
links: [
206-
{
207-
name: "UI Components",
208-
links: ["TransactionButton"].map((name) => ({
209-
name,
210-
href: `${slug}/${name}`,
211-
icon: <CodeIcon />,
212-
})),
213-
},
214-
{
215-
name: "Reading State",
216-
href: `${slug}/reading-state`,
217-
links:
218-
docs.hooks
219-
?.filter((hook) => {
220-
const [tag] = getCustomTag(hook) || [];
221-
return tag === "@contract";
222-
})
223-
?.map((hook) => ({
224-
name: hook.name,
225-
href: `${slug}/${hook.name}`,
226-
icon: <CodeIcon />,
227-
})) || [],
228-
},
229-
{
230-
name: "Transactions",
231-
href: `${slug}/transactions`,
232-
links:
233-
docs.hooks
234-
?.filter((hook) => {
235-
const [tag] = getCustomTag(hook) || [];
236-
return tag === "@transaction";
237-
})
238-
?.map((hook) => ({
239-
name: hook.name,
240-
href: `${slug}/${hook.name}`,
241-
icon: <CodeIcon />,
242-
})) || [],
243-
},
244-
{
245-
name: "Extensions",
246-
links: [
247-
{
248-
name: "Using Extensions",
249-
href: "/react/v5/extensions",
250-
icon: <Book />,
251-
},
252-
{
253-
name: "Available Extensions",
254-
href: "/typescript/v5/extensions/built-in",
255-
icon: <TypeScriptIcon />,
256-
},
257-
],
258-
},
259-
{
260-
name: "Core API",
261-
href: "/typescript/typescript/v5/chain",
262-
icon: <TypeScriptIcon />,
263-
},
264-
],
28+
name: "Differences from React",
29+
href: `${slug}/differences`,
30+
icon: <BookIcon />,
26531
},
26632
{
267-
separator: true,
33+
name: "TypeScript docs",
34+
href: "/typescript/v5",
35+
icon: <TypeScriptIcon />,
26836
},
26937
{
270-
name: "Differences from React",
271-
href: `${slug}/differences`,
38+
name: "React docs",
39+
href: "/react/v5",
40+
icon: <ReactIcon />,
27241
},
27342
{
274-
name: "Full Reference",
275-
href: "/references/typescript/v5/hooks",
276-
isCollapsible: false,
43+
name: "API Reference",
44+
href: "/references/typescript/v5",
45+
icon: <CodeIcon />,
27746
},
27847
],
27948
};

0 commit comments

Comments
 (0)