|
1 | 1 | 'use client';
|
2 | 2 |
|
3 |
| -import { useToast } from '@pheralb/toast'; |
| 3 | +import { toast } from '@pheralb/toast'; |
4 | 4 | import { PartyPopperIcon } from 'lucide-react';
|
5 | 5 | import { useTheme } from 'next-themes';
|
6 | 6 | import { useState } from 'react';
|
7 | 7 |
|
8 | 8 | export default function Home() {
|
9 | 9 | const { setTheme } = useTheme();
|
10 | 10 | const [duration, setDuration] = useState<number>(8000);
|
11 |
| - const t = useToast(); |
12 | 11 | const buttonStyles =
|
13 | 12 | 'p-2 m-2 bg-neutral-100 border border-neutral-300 dark:border-neutral-700 dark:bg-neutral-800 text-sm dark:text-white rounded-md';
|
14 | 13 |
|
15 | 14 | const renderToast = () => {
|
16 |
| - t.default({ |
| 15 | + toast.default({ |
17 | 16 | text: 'Rendered toast!',
|
18 | 17 | description: 'This is a success toast!',
|
19 | 18 | delayDuration: duration,
|
20 | 19 | });
|
21 | 20 | };
|
22 | 21 |
|
23 | 22 | const renderToastWithIcon = () => {
|
24 |
| - t.default({ |
| 23 | + toast.default({ |
25 | 24 | text: 'Rendered toast without icon',
|
26 | 25 | description: 'This is a default toast!',
|
27 | 26 | delayDuration: duration,
|
28 | 27 | });
|
29 |
| - t.success({ |
| 28 | + toast.success({ |
30 | 29 | text: 'Rendered toast with library icon',
|
31 | 30 | description: 'This is a success toast',
|
32 | 31 | delayDuration: duration,
|
33 | 32 | });
|
34 |
| - t.error({ |
| 33 | + toast.error({ |
35 | 34 | text: 'Rendered toast without library icon',
|
36 | 35 | description: 'This is a error toast',
|
37 | 36 | delayDuration: duration,
|
38 | 37 | });
|
39 |
| - t.warning({ |
| 38 | + toast.warning({ |
40 | 39 | text: 'Rendered toast with library icon',
|
41 | 40 | description: 'This is a warning toast',
|
42 | 41 | delayDuration: duration,
|
43 | 42 | });
|
44 |
| - t.default({ |
| 43 | + toast.default({ |
45 | 44 | text: 'Rendered toast with custom icon',
|
46 | 45 | description: 'This is a default toast',
|
47 | 46 | delayDuration: duration,
|
|
0 commit comments