-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Omar White <[email protected]>
- Loading branch information
Showing
13 changed files
with
871 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import ColorModeToggle from './ColorModeToggle'; | ||
|
||
const meta: Meta<typeof ColorModeToggle> = { | ||
component: ColorModeToggle, | ||
title: 'Components/ColorModeToggle', | ||
args: {}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof ColorModeToggle>; | ||
|
||
export const Primary: Story = {}; |
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,40 @@ | ||
'use client'; | ||
|
||
import * as React from 'react'; | ||
import { Moon, Sun } from 'lucide-react'; | ||
import { useTheme } from 'next-themes'; | ||
|
||
import { Button } from '@/components/shadcn/ui/button'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from '@/components/shadcn/ui/dropdown-menu'; | ||
|
||
export default function ColorModeToggle() { | ||
const { setTheme } = useTheme(); | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="outline" size="icon"> | ||
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> | ||
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> | ||
<span className="sr-only">Toggle theme</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align="end"> | ||
<DropdownMenuItem onClick={() => setTheme('light')}> | ||
Light | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => setTheme('dark')}> | ||
Dark | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => setTheme('system')}> | ||
System | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
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,4 +1,3 @@ | ||
import React from 'react'; | ||
import Header from './Header'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import Navbar from './Navbar'; | ||
|
||
const meta: Meta<typeof Navbar> = { | ||
component: Navbar, | ||
title: 'Components/Navbar', | ||
args: { | ||
links: [{ label: 'Home', href: '/', key: 'home' }], | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Navbar>; | ||
|
||
export const Primary: Story = {}; | ||
|
||
export const MultipleLinks: Story = { | ||
args: { | ||
links: [ | ||
{ label: 'Home', href: '/', key: 'home' }, | ||
{ label: 'Blog', href: '/blog', key: 'blog' }, | ||
{ label: 'Contact', href: '/contact', key: 'contact' }, | ||
], | ||
}, | ||
}; |
Oops, something went wrong.