File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
"use client"
2
2
3
3
import { useTheme } from "next-themes"
4
- import { Toaster as Sonner , toast } from "sonner"
4
+ import { Toaster as Sonner } from "sonner"
5
5
6
6
type ToasterProps = React . ComponentProps < typeof Sonner >
7
7
8
- export const Toaster = ( { ...props } : ToasterProps ) => {
8
+ export const SonnerToast = ( { ...props } : ToasterProps ) => {
9
9
const { theme = "system" } = useTheme ( )
10
10
11
11
return (
Original file line number Diff line number Diff line change 1
1
import type { Meta , StoryObj } from "@storybook/react" ;
2
2
import React from "react" ;
3
-
4
- import { Button , sonner } from "src" ;
5
-
3
+ import { Button , SonnerToast } from "src" ;
4
+ import sonner from 'sonner'
6
5
const SonnerDemo = ( ) => {
7
6
return (
8
7
< div >
9
-
10
-
11
- < sonner . Toaster closeButton duration = { 1 } >
8
+ < SonnerToast closeButton duration = { 1 } >
12
9
13
- </ sonner . Toaster >
10
+ </ SonnerToast >
14
11
< Button onClick = { ( ) => sonner . toast . success ( 'Success!' ) } > Show Toast</ Button > </ div >
15
12
) ;
16
13
}
You can’t perform that action at this time.
0 commit comments