-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from leiit/fix-use-darkmode
Fix `useDarkMode` to use correct channel
- Loading branch information
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import * as React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
function Button(props: React.ButtonHTMLAttributes<HTMLButtonElement>) { | ||
return <button type="button" {...props} />; | ||
} | ||
|
||
export default { | ||
title: 'Button', | ||
}; | ||
component: Button, | ||
} satisfies Meta; | ||
|
||
export function Basic() { | ||
return <button type="button">Click me</button>; | ||
} | ||
export const Basic: StoryObj<typeof Button> = { | ||
args: { | ||
children: 'Click me', | ||
} | ||
}; |
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 * as React from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { useDarkMode } from '../../../src'; | ||
|
||
function TestComponent() { | ||
const isDark = useDarkMode() ; | ||
return <div>Dark mode: {isDark ? 'on' : 'off'}</div>; | ||
} | ||
|
||
export default { | ||
title: 'useDarkMode', | ||
component: TestComponent, | ||
} satisfies Meta; | ||
|
||
export const Default = {} satisfies StoryObj; |
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