Skip to content

Commit 6116b05

Browse files
committed
[TOOL-3166] Update portal theming to match dashboard
1 parent eded4ff commit 6116b05

File tree

83 files changed

+592
-592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+592
-592
lines changed

apps/portal/src/app/Header.tsx

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ import {
99
DropdownMenuTrigger,
1010
} from "@/components/ui/dropdown-menu";
1111
import clsx from "clsx";
12-
import { ChevronDownIcon, Menu } from "lucide-react";
13-
import Image from "next/image";
12+
import { ChevronDownIcon, Menu, TableOfContentsIcon } from "lucide-react";
1413
import Link from "next/link";
1514
import { usePathname } from "next/navigation";
1615
import { useState } from "react";
1716
import { GithubIcon } from "../components/Document/GithubButtonLink";
1817
import { CustomAccordion } from "../components/others/CustomAccordion";
1918
import { ThemeSwitcher } from "../components/others/theme/ThemeSwitcher";
19+
import {
20+
DotNetIcon,
21+
ReactIcon,
22+
TypeScriptIcon,
23+
UnityIcon,
24+
UnrealEngineIcon,
25+
} from "../icons";
2026
import { ThirdwebIcon } from "../icons/thirdweb";
2127

2228
const links = [
@@ -65,42 +71,45 @@ const toolLinks = [
6571
},
6672
];
6773

68-
export const connectLinks = [
74+
export const connectLinks: Array<{
75+
name: string;
76+
href: string;
77+
icon: React.FC<{ className?: string }>;
78+
}> = [
6979
{
7080
name: "Overview",
7181
href: "/connect",
72-
icon: "/icons/navbar/nav-icon-dashboard.svg",
82+
icon: TableOfContentsIcon,
7383
},
7484
{
7585
name: "TypeScript",
7686
href: "/typescript/v5",
77-
icon: "/icons/navbar/nav-icon-typescript.svg",
87+
icon: TypeScriptIcon,
7888
},
7989
{
8090
name: "React",
8191
href: "/react/v5",
82-
icon: "/icons/navbar/nav-icon-react.svg",
92+
icon: ReactIcon,
8393
},
8494
{
8595
name: "React Native",
8696
href: "/react-native/v5",
87-
icon: "/icons/navbar/nav-icon-react.svg",
88-
// icon: "/icons/navbar/nav-icon-react-native.svg",
97+
icon: ReactIcon,
8998
},
9099
{
91100
name: ".NET",
92101
href: "/dotnet",
93-
icon: "/icons/navbar/nav-icon-dotnet.svg",
102+
icon: DotNetIcon,
94103
},
95104
{
96105
name: "Unity",
97106
href: "/unity",
98-
icon: "/icons/navbar/nav-icon-unity.svg",
107+
icon: UnityIcon,
99108
},
100109
{
101110
name: "Unreal Engine",
102111
href: "/unreal-engine",
103-
icon: "/icons/navbar/nav-icon-unreal-engine.svg",
112+
icon: UnrealEngineIcon,
104113
},
105114
] as const;
106115

@@ -123,7 +132,7 @@ export function Header() {
123132
const [showBurgerMenu, setShowBurgerMenu] = useState(false);
124133

125134
return (
126-
<header className="flex w-full items-center border-b bg-b-900">
135+
<header className="flex w-full items-center border-b bg-background">
127136
<div className="container flex items-center justify-between gap-6 p-4 xl:justify-start">
128137
<Link
129138
className="flex items-center gap-2"
@@ -132,7 +141,7 @@ export function Header() {
132141
title="thirdweb Docs"
133142
>
134143
<ThirdwebIcon className="size-8" />
135-
<span className="font-bold text-[23px] text-f-100 leading-none tracking-tight">
144+
<span className="font-bold text-[23px] text-foreground leading-none tracking-tight">
136145
Docs
137146
</span>
138147
</Link>
@@ -145,7 +154,7 @@ export function Header() {
145154
<Link
146155
href="https://github.com/thirdweb-dev"
147156
target="_blank"
148-
className="text-f-100"
157+
className="text-foreground"
149158
>
150159
<GithubIcon className="mx-3 size-6" />
151160
</Link>
@@ -164,7 +173,7 @@ export function Header() {
164173
className={clsx(
165174
"grow gap-5",
166175
!showBurgerMenu ? "hidden xl:flex" : "flex",
167-
"fade-in-20 slide-in-from-top-3 fixed inset-0 top-sticky-top-height animate-in flex-col overflow-auto bg-b-800 p-6",
176+
"fade-in-20 slide-in-from-top-3 fixed inset-0 top-sticky-top-height animate-in flex-col overflow-auto bg-card p-6",
168177
"xl:static xl:animate-none xl:flex-row xl:justify-between xl:bg-transparent xl:p-0",
169178
)}
170179
>
@@ -227,7 +236,7 @@ export function Header() {
227236
<Link
228237
href="https://github.com/thirdweb-dev"
229238
target="_blank"
230-
className="hidden text-f-300 transition-colors hover:text-f-100 xl:block"
239+
className="hidden text-muted-foreground transition-colors hover:text-foreground xl:block"
231240
>
232241
<GithubIcon className="mx-2 size-6" />
233242
</Link>
@@ -241,7 +250,11 @@ export function Header() {
241250
function DropdownLinks(props: {
242251
onLinkClick?: () => void;
243252
category: string;
244-
links: readonly { name: string; href: string; icon?: string }[];
253+
links: readonly {
254+
name: string;
255+
href: string;
256+
icon?: React.FC<{ className?: string }>;
257+
}[];
245258
}) {
246259
return (
247260
<>
@@ -251,42 +264,40 @@ function DropdownLinks(props: {
251264
<DropdownMenuTrigger asChild>
252265
<Button
253266
variant="ghost"
254-
className="inline-flex items-center gap-1 p-0 font-medium text-f-300 text-sm hover:bg-transparent hover:text-f-100"
267+
className="inline-flex items-center gap-1 p-0 font-medium text-muted-foreground text-sm hover:bg-transparent hover:text-foreground"
255268
>
256269
{props.category}
257-
<ChevronDownIcon className="size-4 text-f-300 opacity-70" />
270+
<ChevronDownIcon className="size-4 text-muted-foreground opacity-70" />
258271
</Button>
259272
</DropdownMenuTrigger>
260273

261274
<DropdownMenuContent
262-
className="flex flex-col gap-1 bg-b-800 p-3"
275+
className="flex flex-col gap-1 bg-card p-3"
263276
style={{
264277
minWidth: "150px",
265278
}}
266279
>
267280
{props.links.map((info) => {
268281
return (
269282
<DropdownMenuItem asChild key={info.name}>
270-
<Link
271-
href={info.href}
272-
target={info.href.startsWith("http") ? "_blank" : ""}
273-
prefetch={false}
283+
<div
274284
className={clsx(
275-
"flex cursor-pointer font-medium text-f-200",
276-
"hover:bg-b-600 hover:text-f-100",
285+
"relative flex cursor-pointer gap-2 font-medium text-foreground",
286+
"hover:bg-accent",
277287
)}
278288
>
279289
{info.icon && (
280-
<Image
281-
src={info.icon}
282-
width="20"
283-
height="20"
284-
alt=""
285-
className="mr-2"
286-
/>
290+
<info.icon className="size-5 text-foreground" />
287291
)}
288-
{info.name}
289-
</Link>
292+
<Link
293+
prefetch={false}
294+
target={info.href.startsWith("http") ? "_blank" : ""}
295+
href={info.href}
296+
className="before:absolute before:inset-0"
297+
>
298+
{info.name}
299+
</Link>
300+
</div>
290301
</DropdownMenuItem>
291302
);
292303
})}
@@ -300,7 +311,7 @@ function DropdownLinks(props: {
300311
chevronPosition="right"
301312
containerClassName="border-none"
302313
trigger={props.category}
303-
triggerContainerClassName="py-0 text-base font-medium text-f-300"
314+
triggerContainerClassName="py-0 text-base font-medium text-muted-foreground"
304315
>
305316
<div className="pt-2">
306317
<div className="flex flex-col gap-4 border-l-2 pt-3 pl-4">
@@ -327,7 +338,7 @@ function NavLink(props: {
327338
href: string;
328339
name: string;
329340
onClick?: () => void;
330-
icon?: string;
341+
icon?: React.FC<{ className?: string }>;
331342
}) {
332343
const pathname = usePathname();
333344
return (
@@ -336,20 +347,14 @@ function NavLink(props: {
336347
onClick={props.onClick}
337348
target={props.href.startsWith("http") ? "_blank" : ""}
338349
className={clsx(
339-
"font-medium text-base transition-colors hover:text-f-100 xl:text-sm",
340-
pathname === props.href ? "text-f-100" : "text-f-300 ",
341-
props.icon ? "flex flex-row gap-2" : "",
350+
"font-medium text-base transition-colors hover:text-foreground xl:text-sm",
351+
pathname === props.href ? "text-foreground" : "text-muted-foreground ",
352+
props.icon ? "flex flex-row gap-3" : "",
342353
)}
343354
>
344355
{props.icon ? (
345356
<>
346-
<Image
347-
src={props.icon}
348-
width="40"
349-
height="40"
350-
className="size-7"
351-
alt=""
352-
/>
357+
<props.icon className="size-6 text-muted-foreground" />
353358
<span className="my-auto">{props.name}</span>
354359
</>
355360
) : (

apps/portal/src/app/changelog/[slug]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default async function Page(props: {
2828
<Button asChild>
2929
<Link
3030
href="/changelog"
31-
className="-translate-x-1/4 !p-2 !text-f-300 hover:!text-accent-500 mb-4 bg-transparent"
31+
className="-translate-x-1/4 !p-2 !text-muted-foreground hover:!text-foreground mb-4 bg-transparent"
3232
>
3333
<ArrowLeft className="size-6" />
3434
</Link>
@@ -42,7 +42,7 @@ export default async function Page(props: {
4242

4343
<h1
4444
className={cn(
45-
"mb-8 break-words font-bold text-4xl text-f-100 tracking-tight md:text-5xl",
45+
"mb-8 break-words font-bold text-4xl text-foreground tracking-tight md:text-5xl",
4646
)}
4747
>
4848
{data.title}

apps/portal/src/app/changelog/[slug]/styles.css

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,27 @@
33
}
44

55
.changelog-page a {
6-
color: var(--accent-500);
6+
text-decoration: underline;
7+
text-decoration-color: hsl(var(--muted-foreground));
8+
text-decoration-style: dotted;
9+
color: hsl(var(--foreground));
10+
text-underline-offset: 5px;
11+
transition: color 200ms ease;
12+
}
13+
14+
.changelog-page h2 a {
15+
text-decoration: none;
716
}
817

918
.changelog-page a:hover {
10-
color: var(--f-100);
19+
color: hsl(var(--foreground));
20+
text-decoration-color: hsl(var(--foreground));
21+
text-decoration-style: solid;
1122
}
1223

1324
.changelog-page figcaption {
1425
text-align: center;
15-
color: var(--f-300);
26+
color: hsl(var(--muted-foreground));
1627
}
1728

1829
.changelog-page iframe {
@@ -43,7 +54,7 @@
4354
display: flex;
4455
gap: 10px;
4556
margin: 20px 0;
46-
background: var(--b-800);
57+
background: hsl(var(--card));
4758
}
4859

4960
.kg-video-overlay {

apps/portal/src/app/changelog/components/Author.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export function Author(props: { name: string; profileImage?: string | null }) {
1010
alt=""
1111
/>
1212
)}
13-
<span className="font-medium text-f-200 text-sm">{props.name}</span>
13+
<span className="font-medium text-muted-foreground text-sm">
14+
{props.name}
15+
</span>
1416
</div>
1517
);
1618
}

apps/portal/src/app/changelog/components/RenderData.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export function RenderDate(props: { iso: string; className?: string }) {
55
return (
66
<time
77
dateTime={props.iso}
8-
className={cn("font-medium text-f-300 text-sm", props.className)}
8+
className={cn(
9+
"font-medium text-muted-foreground text-sm",
10+
props.className,
11+
)}
912
>
1013
{formatDistance(new Date(props.iso), new Date())} ago
1114
</time>

apps/portal/src/app/changelog/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ async function PageContent() {
6565
</div>
6666
</div>
6767

68-
<div className="-left-12 -translate-x-1/2 absolute top-12 hidden size-7 items-center justify-center rounded-[50%] bg-f-100 md:size-10 xl:flex">
69-
<PlusIcon className="size-6 text-b-900" />
68+
<div className="-left-12 -translate-x-1/2 absolute top-12 hidden size-7 items-center justify-center rounded-[50%] bg-foreground md:size-10 xl:flex">
69+
<PlusIcon className="size-6 text-background" />
7070
</div>
7171

72-
<div className="overflow-hidden">
72+
<div>
7373
<Heading
7474
level={2}
7575
className="changelog-title"
@@ -78,7 +78,7 @@ async function PageContent() {
7878
>
7979
<Link
8080
href={`/changelog/${post.slug}`}
81-
className="!text-f-100 font-bold text-3xl tracking-tighter hover:underline md:text-4xl xl:text-5xl"
81+
className="!text-foreground font-bold text-3xl tracking-tighter hover:underline md:text-4xl xl:text-5xl"
8282
>
8383
{post.title}
8484
</Link>

apps/portal/src/app/changelog/utils/transform.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const transform: Transform = (node, index: number) => {
6060
if (!node.attribs) {
6161
node.attribs = {};
6262
}
63-
node.attribs.class = "text-center text-sm text-f-300";
63+
node.attribs.class = "text-center text-sm text-muted-foreground";
6464
return;
6565
}
6666
return <Paragraph>{getChildren()}</Paragraph>;

apps/portal/src/app/connect/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default async function Layout(props: { children: React.ReactNode }) {
99
editPageButton={true}
1010
sidebarHeader={
1111
<div className="flex-col items-center gap-1">
12-
<p className="py-5 font-semibold text-f-100 text-lg">Connect</p>
12+
<p className="py-5 font-semibold text-foreground text-lg">Connect</p>
1313
<PlatformSelector selected="Overview" />
1414
</div>
1515
}

0 commit comments

Comments
 (0)