Skip to content

Commit 2e48cd2

Browse files
committed
Add menu item icons
1 parent f283432 commit 2e48cd2

File tree

25 files changed

+1203
-348
lines changed

25 files changed

+1203
-348
lines changed

docs/references/cdi/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "CDI Reference",
2+
"label": "Core Driver Interface",
33
"customProps": { "isMainCategory": true },
44
"position": 5
55
}

docs/references/fdi/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"label": "FDI Reference",
2+
"label": "Frontend Driver Interface",
33
"customProps": { "isMainCategory": true },
44
"position": 4
55
}

src/components/MenuItemIcon.tsx

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
import React from "react";
2+
import useBaseUrl from "@docusaurus/useBaseUrl";
3+
import {
4+
Book,
5+
Zap,
6+
Key,
7+
Shield,
8+
GitPullRequest,
9+
CircleUserRound,
10+
FileTerminal,
11+
FileCode,
12+
HardDrive,
13+
NotebookTabs,
14+
Users,
15+
ArrowRight,
16+
Settings,
17+
Server,
18+
Mail,
19+
Smartphone,
20+
Share2,
21+
Building,
22+
RectangleEllipsis,
23+
Bot,
24+
Layers,
25+
Fingerprint,
26+
MailCheck,
27+
ShieldCheck,
28+
Clock,
29+
UserCheck,
30+
ShieldAlert,
31+
Timer,
32+
UserCog,
33+
Link,
34+
BarChart3,
35+
Puzzle,
36+
Cloud,
37+
Triangle,
38+
Database,
39+
Workflow,
40+
Globe,
41+
Folder,
42+
FileText,
43+
Monitor,
44+
Code,
45+
Bug,
46+
Wrench,
47+
Palette,
48+
FlaskConical,
49+
BookOpenCheck,
50+
Cpu,
51+
Hash,
52+
History,
53+
Construction,
54+
Play,
55+
ChevronRight,
56+
Lightbulb,
57+
} from "lucide-react";
58+
59+
import VercelLogo from "/img/logos/vercel.svg";
60+
import SupabaseLogo from "/img/logos/supabase.svg";
61+
import HasuraLogo from "/img/logos/hasura.svg";
62+
import NextjsLogo from "/img/logos/nextjs.svg";
63+
import NestjsLogo from "/img/logos/nestjs.svg";
64+
import NetlifyLogo from "/img/logos/netlify.svg";
65+
import AwsLambdaLogo from "/img/logos/aws-lambda.svg";
66+
import GraphqlLogo from "/img/logos/graphql.svg";
67+
import CdiLogo from "/img/logos/cdi.svg";
68+
import FdiLogo from "/img/logos/fdi.svg";
69+
70+
const categoryIcons = {
71+
// Main categories
72+
References: Book,
73+
Quickstart: Zap,
74+
Authentication: Key,
75+
"Additional Verification": Shield,
76+
"Post Authentication": Users,
77+
Migration: ArrowRight,
78+
"Platform Configuration": Settings,
79+
Deployment: Server,
80+
81+
// Authentication methods
82+
"Email Password": RectangleEllipsis,
83+
Passwordless: Smartphone,
84+
"Social Login": CircleUserRound,
85+
"Enterprise Login": Building,
86+
"Unified Login": Share2,
87+
"Machine to Machine": Bot,
88+
Passkeys: Fingerprint,
89+
90+
// Quickstart integrations
91+
Integrations: Puzzle,
92+
// "AWS Lambda": AwsLambdaLogo,
93+
// NextJS: NextjsLogo,
94+
// GraphQL: GraphqlLogo,
95+
// Hasura: HasuraLogo,
96+
// NestJS: NestjsLogo,
97+
// Netlify: NetlifyLogo,
98+
// Supabase: SupabaseLogo,
99+
// Vercel: VercelLogo,
100+
101+
// References and SDK sections
102+
"Frontend SDKs": Monitor,
103+
"Backend SDKs": Server,
104+
"User Interface": Palette,
105+
"Frontend Driver Interface": FileCode,
106+
"Core Driver Interface": FileTerminal,
107+
"Testing and Debugging": Bug,
108+
"SuperTokens Core": Cpu,
109+
110+
// Authentication reference subcategories
111+
"Email/Password": Mail,
112+
ThirdParty: Share2,
113+
WebAuthn: Fingerprint,
114+
OAuth: Key,
115+
MFA: ShieldCheck,
116+
Session: Clock,
117+
TOTP: Hash,
118+
OTP: Smartphone,
119+
SAML: Building,
120+
121+
// Quickstart guides and workflows
122+
"Quickstart Guides": Zap,
123+
"Advanced Workflows": Workflow,
124+
"Legacy Method": History,
125+
"Legacy method": History,
126+
"Using prebuilt UI": Palette,
127+
"Step 1: Account Creation": UserCheck,
128+
"5. Checking Sessions in API Routes": Shield,
129+
"Checking Sessions in API Routes": Shield,
130+
131+
// Main quickstart menu items
132+
"/docs/quickstart/backend-setup": HardDrive,
133+
"/docs/quickstart/frontend-setup": Monitor,
134+
"/docs/quickstart/introduction": Book,
135+
"/docs/quickstart/next-steps": NotebookTabs,
136+
"/docs/quickstart/example-applications": Play,
137+
};
138+
139+
// Brand logo mappings for integration platforms
140+
const brandLogos: { [key: string]: string } = {};
141+
142+
type MenuItemIconProps =
143+
| {
144+
label: string;
145+
className?: string;
146+
}
147+
| {
148+
href: string;
149+
className?: string;
150+
};
151+
152+
export function MenuItemIcon(props: MenuItemIconProps) {
153+
const IconComponent = "label" in props ? categoryIcons[props.label] : categoryIcons[props.href];
154+
155+
if (!IconComponent) {
156+
return null;
157+
}
158+
159+
return <IconComponent className={props.className} size={16} />;
160+
}
161+
162+
export default MenuItemIcon;

src/css/custom.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262

6363
// Dark mode colors
6464
[data-theme="dark"] {
65-
--ifm-background-color: #1a1a1a;
65+
--ifm-background-color: #0a0a0a;
6666
--ifm-font-color-base: #fff;
6767
--ifm-heading-color: #ddd;
6868
--ifm-toc-border-color: #ffffff1a;
69-
--ifm-navbar-background-color: #191a1c;
69+
--ifm-navbar-background-color: #0a0a0a;
7070
--ifm-toc-border-color: #484848;
7171
--ifm-menu-color-active: #5f616b;
7272
--ifm-menu-color-background-active: #202123;

0 commit comments

Comments
 (0)