Skip to content

Commit fe9a43d

Browse files
committed
🎨 Add light/dark theme + custom theme switcher & update UI components with new theme mode
1 parent 8ff9fdd commit fe9a43d

File tree

21 files changed

+537
-44
lines changed

21 files changed

+537
-44
lines changed

‎website/app/components/card.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ const Card = (props: iCard) => {
2424
};
2525

2626
return (
27-
<div className="group flex flex-col items-center justify-center space-y-1 rounded-lg border border-zinc-800 px-4 pb-2 pt-4 transition-colors hover:bg-zinc-800/50">
27+
<div className="group flex flex-col items-center justify-center space-y-1 rounded-lg border border-zinc-200 px-4 pb-2 pt-4 hover:bg-zinc-200/50 dark:border-zinc-800 dark:hover:bg-zinc-800/50">
2828
<props.icon width={props.iconSize} height={props.iconSize} />
29-
<p className="text-sm tracking-tight text-white">{props.name}</p>
29+
<p className="text-sm tracking-tight text-black dark:text-white">
30+
{props.name}
31+
</p>
3032
<div className="flex items-center space-x-1">
3133
<Button
3234
variant="ghost"
3335
size="icon"
3436
onClick={handleCopy}
37+
className="transition-none"
3538
title="Copy to clipboard"
3639
>
3740
<CopyIcon width={17} height={17} strokeWidth={1.5} />

‎website/app/components/footer.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@ import { containerClasses } from "@/ui/container";
44

55
const Footer = () => {
66
return (
7-
<footer className="animate-in slide-in-from-bottom-3 fade-in-30 fixed bottom-0 w-full bg-zinc-900/80 py-4 text-sm text-zinc-400 backdrop-blur-sm duration-500">
7+
<footer className="animate-in slide-in-from-bottom-3 fade-in-30 fixed bottom-0 w-full bg-zinc-50 py-4 text-sm text-zinc-600 backdrop-blur-sm dark:bg-zinc-900/80 dark:text-zinc-400">
88
<div
99
className={cn(containerClasses, "flex items-center justify-between")}
1010
>
1111
<ExternalLink
1212
title="Miguel Solorio"
1313
href="https://www.miguelsolorio.com/"
14-
className="group flex items-center space-x-2 transition-colors hover:text-white"
14+
className="group flex items-center space-x-2 transition-colors hover:text-black dark:hover:text-white"
1515
>
1616
<span className="hidden md:block">Icons crafted by </span>
1717
<img
18-
className="h-6 w-6 rounded-full transition-shadow group-hover:ring-2 group-hover:ring-react-symbol-pink"
18+
className="group-hover:ring-react-symbol-pink h-6 w-6 rounded-full transition-shadow group-hover:ring-2"
1919
src="https://avatars.githubusercontent.com/u/35271042?v=4"
2020
alt="Miguel Solorio"
2121
/>
22-
<span className="underline decoration-zinc-500 decoration-wavy underline-offset-[4px] group-hover:decoration-react-symbol-pink">
22+
<span className="group-hover:decoration-react-symbol-pink underline decoration-zinc-500 decoration-wavy underline-offset-[4px]">
2323
Miguel Solorio
2424
</span>
2525
</ExternalLink>
2626
<ExternalLink
2727
title="Pablo Hernández"
2828
href="https://pheralb.dev"
29-
className="group flex items-center space-x-2 transition-colors hover:text-white"
29+
className="group flex items-center space-x-2 transition-colors hover:text-black dark:hover:text-white"
3030
>
3131
<span className="hidden md:block">Website by</span>
3232
<img
33-
className="h-6 w-6 rounded-full transition-shadow group-hover:ring-2 group-hover:ring-react-symbol-aqua"
33+
className="group-hover:ring-react-symbol-aqua h-6 w-6 rounded-full transition-shadow group-hover:ring-2"
3434
src="https://avatars.githubusercontent.com/u/62877300?v=4"
3535
alt="Pablo Hernández"
3636
/>
37-
<span className="underline decoration-zinc-500 decoration-wavy underline-offset-[4px] group-hover:decoration-react-symbol-aqua">
37+
<span className="group-hover:decoration-react-symbol-aqua underline decoration-zinc-500 decoration-wavy underline-offset-[4px]">
3838
Pablo Hernández
3939
</span>
4040
</ExternalLink>

‎website/app/components/getCode/index.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const GetCode = (props: iGetCode) => {
7474
variant="ghost"
7575
size="icon"
7676
onClick={() => handleGetCode()}
77+
className="transition-none"
7778
title="Get React Component"
7879
>
7980
<CodeIcon width={17} height={17} strokeWidth={1.5} />
@@ -95,11 +96,11 @@ const GetCode = (props: iGetCode) => {
9596
</div>
9697
) : fileContent ? (
9798
<div className="my-1 flex flex-col space-y-1 overflow-hidden">
98-
<div className="mr-1 flex items-center justify-end space-x-2 font-mono text-[12px] text-zinc-400">
99+
<div className="mr-1 flex items-center justify-end space-x-2 font-mono text-[12px] text-zinc-600 dark:text-zinc-400">
99100
<Reactjs width={16} height={16} />
100101
<span>{camelCase(props.componentName)}.tsx</span>
101102
</div>
102-
<div className="max-h-80 rounded-lg border border-zinc-800 p-3 font-mono text-sm hover:overflow-auto">
103+
<div className="max-h-80 rounded-lg border border-zinc-200 p-3 font-mono text-sm hover:overflow-auto dark:border-zinc-800">
103104
<pre
104105
className="select-all"
105106
dangerouslySetInnerHTML={{ __html: highlight(fileContent) }}
@@ -109,7 +110,7 @@ const GetCode = (props: iGetCode) => {
109110
) : (
110111
<div className="my-4 flex flex-col items-center justify-center gap-2">
111112
<AlertIcon
112-
height={25}
113+
height={30}
113114
className="flex items-center justify-center"
114115
/>
115116
<p className="text-sm text-zinc-400">

‎website/app/components/header.tsx‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const linkClasses = buttonVariants({
2929
className: "rounded-3xl w-auto group",
3030
});
3131

32+
const arrowClasses = cn(
33+
"text-zinc-400 transition-transform group-hover:translate-x-[0.1rem] group-hover:text-black dark:group-hover:text-white",
34+
);
35+
3236
interface iHeaderProps {
3337
npmVersion: string;
3438
}
@@ -38,7 +42,7 @@ const Header = (props: iHeaderProps) => {
3842
<section
3943
className={cn(
4044
"pb-4 pt-8 md:py-10",
41-
"flex flex-col space-y-6",
45+
"flex flex-col space-y-5",
4246
containerClasses,
4347
)}
4448
>
@@ -51,17 +55,17 @@ const Header = (props: iHeaderProps) => {
5155
>
5256
React-Symbols
5357
</Link>
54-
<div className="flex flex-col items-start space-x-0 space-y-2 text-sm text-zinc-400 md:flex-row md:space-x-2 md:space-y-0 md:text-[16px]">
58+
<div className="flex flex-col items-start space-x-0 space-y-2 text-sm text-zinc-600 md:flex-row md:space-x-2 md:space-y-0 md:text-[16px] dark:text-zinc-400">
5559
<span>
5660
Beautifully File & Folder Icons for your React projects.
5761
</span>
5862
</div>
5963
</div>
6064
</div>
61-
<div className="flex w-full flex-col items-center space-x-0 space-y-4 md:w-auto md:flex-row md:space-x-4 md:space-y-0">
65+
<div className="mb-1 flex w-full flex-col items-center space-x-0 space-y-4 md:w-auto md:flex-row md:space-x-4 md:space-y-0">
6266
<InstallCommand className="w-full md:w-auto" />
6367
<Divider className="hidden md:block" />
64-
<nav className="container flex items-center space-x-2 overflow-y-auto md:w-auto">
68+
<nav className="container flex items-center space-x-2 overflow-y-auto pb-1 md:w-auto">
6569
<ExternalLink
6670
title="NPM Package"
6771
href="https://www.npmjs.com/package/@react-symbols/icons"
@@ -73,7 +77,7 @@ const Header = (props: iHeaderProps) => {
7377
height={13}
7478
width={13}
7579
strokeWidth={2}
76-
className="text-zinc-400 transition-transform duration-200 group-hover:translate-x-[0.1rem] group-hover:text-white"
80+
className={arrowClasses}
7781
/>
7882
</ExternalLink>
7983
<ExternalLink
@@ -87,7 +91,7 @@ const Header = (props: iHeaderProps) => {
8791
height={13}
8892
width={13}
8993
strokeWidth={2}
90-
className="text-zinc-400 transition-transform duration-200 group-hover:translate-x-[0.07rem] group-hover:text-white"
94+
className={arrowClasses}
9195
/>
9296
</ExternalLink>
9397
<ExternalLink
@@ -101,7 +105,7 @@ const Header = (props: iHeaderProps) => {
101105
height={13}
102106
width={13}
103107
strokeWidth={2}
104-
className="text-zinc-400 transition-transform duration-200 group-hover:translate-x-[0.07rem] group-hover:text-white"
108+
className={arrowClasses}
105109
/>
106110
</ExternalLink>
107111
<ExternalLink
@@ -115,7 +119,7 @@ const Header = (props: iHeaderProps) => {
115119
height={13}
116120
width={13}
117121
strokeWidth={2}
118-
className="text-zinc-400 transition-transform duration-200 group-hover:translate-x-[0.07rem] group-hover:text-white"
122+
className={arrowClasses}
119123
/>
120124
</ExternalLink>
121125
</nav>

‎website/app/components/installCommand.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ const InstallCommand = (props: iInstallCommandProps) => {
7777
className={cn(
7878
buttonVariants({
7979
variant: "outline",
80+
className: "active:scale-100",
8081
}),
81-
"select-all space-x-3 rounded-3xl text-zinc-400 transition-colors hover:bg-transparent hover:text-white dark:hover:bg-transparent",
82+
"select-all space-x-3 rounded-3xl text-zinc-600 transition-colors hover:bg-transparent dark:text-zinc-400 dark:hover:bg-transparent dark:hover:text-white",
8283
props.className,
8384
)}
8485
>

‎website/app/components/loading.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interface iLoading {
88
const Loading = (props: iLoading) => (
99
<div
1010
className={cn(
11-
"animate-in animate-out fade-in-40 flex flex-col space-y-2 duration-1000",
11+
"animate-in animate-out fade-in-40 flex flex-col space-y-2 ",
1212
props.className,
1313
)}
1414
>

‎website/app/components/navbar/index.tsx‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const NavIconsRoutes = [
2626
const Navbar = () => {
2727
const location = useLocation();
2828
return (
29-
<nav className="sticky -top-1 z-50 border-y border-zinc-800 bg-zinc-900/80 py-[10px] backdrop-blur-sm">
29+
<nav className="sticky -top-1 z-40 border-y border-zinc-200 bg-zinc-100/80 py-[10px] backdrop-blur-sm dark:border-zinc-800 dark:bg-zinc-900/80">
3030
<div
3131
className={cn(
3232
containerClasses,
@@ -46,7 +46,7 @@ const Navbar = () => {
4646
? `Search ${totalFolders} folder icons...`
4747
: `Search ${totalLibraryIcons} icons...`
4848
}
49-
className="rounded-none border-b border-l-0 border-r-0 border-t-0 pl-[34px] text-[16px] placeholder:text-[16px] focus:border-none focus:ring-0 md:border-none md:pl-[38px] dark:focus:border-none"
49+
className="rounded-none border-b border-l-0 border-r-0 border-t-0 pl-[34px] text-[16px] shadow-none placeholder:text-[16px] focus:border-none focus:ring-0 focus-visible:ring-0 md:border-none md:pl-[38px] dark:focus:border-none dark:focus:ring-0"
5050
/>
5151
</div>
5252
<Divider className="hidden md:block" />
@@ -61,11 +61,12 @@ const Navbar = () => {
6161
className={cn(
6262
buttonVariants({
6363
variant: "outline",
64+
className: "shadow-none",
6465
}),
6566
"w-full md:w-auto",
6667
location.pathname === link.href
67-
? "border-zinc-400 text-white"
68-
: "border-none bg-transparent text-zinc-400 hover:text-white dark:bg-transparent",
68+
? "border-zinc-200 text-black dark:border-zinc-800 dark:text-white"
69+
: "border-none bg-transparent text-zinc-600 hover:text-black dark:bg-transparent dark:text-zinc-400 dark:hover:text-white",
6970
)}
7071
>
7172
{location.pathname === link.href ? (
@@ -78,7 +79,7 @@ const Navbar = () => {
7879
))}
7980
</div>
8081
<Divider className="hidden md:block" />
81-
<div className="flex w-full flex-col space-y-1 pb-1 text-zinc-400 transition-colors hover:text-white md:w-56 md:pb-0">
82+
<div className="flex w-full flex-col space-y-1 pb-1 text-zinc-600 hover:text-black md:w-56 md:pb-0 dark:text-zinc-400 dark:hover:text-white">
8283
<p className="select-none text-xs font-medium uppercase">Size</p>
8384
<IconSize />
8485
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import ThemeSwitcher from "./themeSwitcher";
2+
3+
const Settings = () => {
4+
return (
5+
<nav className="fixed right-3 top-2 z-50 md:top-3">
6+
<ThemeSwitcher />
7+
</nav>
8+
);
9+
};
10+
11+
export default Settings;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { type Theme, useTheme } from "@/theme/themeProvider";
2+
import { MoonIcon, SunIcon } from "@/ui/icons/feather";
3+
import { cn } from "@/utils";
4+
5+
const ThemeSwitcher = () => {
6+
const [theme, setTheme] = useTheme();
7+
8+
const buttons = [
9+
{
10+
label: "dark" as const,
11+
icon: <MoonIcon width={14} />,
12+
active: theme === "dark",
13+
},
14+
{
15+
label: "light" as const,
16+
icon: <SunIcon width={14} />,
17+
active: theme === "light",
18+
},
19+
];
20+
21+
return (
22+
<span className="flex w-fit items-center gap-0.5 overflow-hidden rounded-md border border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-800/80">
23+
{buttons.map(({ label, icon, active }) => (
24+
<button
25+
type="button"
26+
title={`Switch to ${label} theme`}
27+
key={label}
28+
onClick={() => setTheme(() => label as Theme)}
29+
className={cn(
30+
"flex h-6 w-6 items-center justify-center rounded-none transition-all hover:opacity-50",
31+
active && "bg-zinc-200 dark:bg-zinc-900",
32+
)}
33+
>
34+
{icon}
35+
</button>
36+
))}
37+
</span>
38+
);
39+
};
40+
41+
export default ThemeSwitcher;

‎website/app/providers/sonner.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ const Toaster = ({ ...props }: ToasterProps) => {
1111
toastOptions={{
1212
classNames: {
1313
toast:
14-
"group toast group-[.toaster]:bg-zinc-900 group-[.toaster]:text-zinc-50 group-[.toaster]:border-zinc-800 group-[.toaster]:shadow-lg",
15-
description: "group-[.toaster]:text-zinc-400 font-mono",
14+
"group toast group-[.toaster]:bg-zinc-100 dark:group-[.toaster]:bg-zinc-900 group-[.toaster]:text-zinc-950 dark:group-[.toaster]:text-zinc-50 group-[.toaster]:border-zinc-200 dark:group-[.toaster]:border-zinc-800 group-[.toaster]:shadow-lg",
15+
description:
16+
"group-[.toaster]:text-zinc-600 dark:group-[.toaster]:text-zinc-400 font-mono",
1617
icon: "group-[.toaster]:mr-3",
1718
},
1819
}}

0 commit comments

Comments
 (0)