Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
feat: theme
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRouyer committed Oct 5, 2024
1 parent b22e89c commit 656d032
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/components/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Logo: FC = () => {
viewBox="0 0 64 64"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="h-8 w-auto text-black"
className="h-8 w-auto text-black dark:text-white"
>
<path
fillRule="evenodd"
Expand Down
7 changes: 6 additions & 1 deletion apps/web/app/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createRouter as createTanStackRouter } from '@tanstack/react-router';
import { routerWithQueryClient } from '@tanstack/react-router-with-query';
import { Provider } from 'jotai';
import { Loader2 } from 'lucide-react';
import { ThemeProvider } from 'next-themes';

import NotFound from '~/components/not-found';
// Import the generated route tree
Expand All @@ -26,7 +27,11 @@ export function createRouter() {
),
defaultNotFoundComponent: NotFound,
Wrap: function WrapComponent({ children }) {
return <Provider>{children}</Provider>;
return (
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
<Provider>{children}</Provider>
</ThemeProvider>
);
},
}),
queryClient,
Expand Down
4 changes: 4 additions & 0 deletions apps/web/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const Route = createRootRouteWithContext<{
name: 'og:site_name',
content: 'Kyaku',
},
{
name: 'color-scheme',
content: 'dark light',
},
],
links: () => [
{ rel: 'stylesheet', href: appCss },
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"jotai": "^2.10.0",
"lexical": "^0.18.0",
"lucide-react": "^0.447.0",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,7 @@ __metadata:
jsdom: "npm:^25.0.1"
lexical: "npm:^0.18.0"
lucide-react: "npm:^0.447.0"
next-themes: "npm:^0.3.0"
react: "npm:^18.3.1"
react-dom: "npm:^18.3.1"
react-hook-form: "npm:^7.53.0"
Expand Down Expand Up @@ -12953,6 +12954,16 @@ __metadata:
languageName: node
linkType: hard

"next-themes@npm:^0.3.0":
version: 0.3.0
resolution: "next-themes@npm:0.3.0"
peerDependencies:
react: ^16.8 || ^17 || ^18
react-dom: ^16.8 || ^17 || ^18
checksum: 10c0/72bd670ad6b9f547dc18cece340dfd1ac41e3e7b37eb321d4767db90bfa2c239f937011cd0efe35ca0081f1ea260051bc0868808ef39b0fbff2ddefd7146cec6
languageName: node
linkType: hard

"nitropack@npm:^2.9.1":
version: 2.9.7
resolution: "nitropack@npm:2.9.7"
Expand Down

0 comments on commit 656d032

Please sign in to comment.