-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
96 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,10 @@ | ||
import { ThemeSwitcher } from '@/components/ThemeSwitcher'; | ||
|
||
export default function Home() { | ||
return ( | ||
<main> | ||
<div className="bg-primary"> | ||
<h1>Hello world</h1> | ||
</div> | ||
<select className="px-2 py-1 rounded-full"> | ||
<option>Option 1</option> | ||
<option>Option 2</option> | ||
</select> | ||
<a href="/about">About</a> | ||
<article className="prose lg:prose-xl"> | ||
<h1>Garlic bread with cheese: What the science tells us</h1> | ||
<p> | ||
For years parents have espoused the health benefits of eating garlic | ||
bread with cheese to their children, with the food earning such an | ||
iconic status in our culture that kids will often dress up as warm, | ||
cheesy loaf for Halloween. | ||
</p> | ||
<p> | ||
But a recent study shows that the celebrated appetizer may be linked | ||
to a series of rabies cases springing up around the country. | ||
</p> | ||
</article> | ||
<main className="container mx-auto"> | ||
<h1>Hello World</h1> | ||
<ThemeSwitcher /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use client'; | ||
|
||
import { type FC, type PropsWithChildren } from 'react'; | ||
|
||
import { ThemeProvider as NextThemesProvider } from 'next-themes'; | ||
|
||
export const Providers: FC<PropsWithChildren> = ({ children }) => { | ||
return ( | ||
<NextThemesProvider attribute="class" enableSystem> | ||
{children} | ||
</NextThemesProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use client'; | ||
|
||
import { useEffect, useState } from 'react'; | ||
|
||
import { useTheme } from 'next-themes'; | ||
|
||
export const ThemeSwitcher = () => { | ||
const [mounted, setMounted] = useState(false); | ||
const { theme, setTheme } = useTheme(); | ||
|
||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (!mounted) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<select | ||
className="border-zinc-300 dark:border-zinc-700 text-sm bg-zinc-200 dark:bg-zinc-800 rounded-md" | ||
value={theme} | ||
onChange={(e) => { | ||
setTheme(e.target.value); | ||
}} | ||
> | ||
<option value="system">System</option> | ||
<option value="dark">Dark</option> | ||
<option value="light">Light</option> | ||
</select> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ words: | |
- tsbuildinfo | ||
- turborepo | ||
- typecheck | ||
- esbenp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.