diff --git a/web/package.json b/web/package.json index 0ae4f62..ee4957b 100644 --- a/web/package.json +++ b/web/package.json @@ -29,6 +29,7 @@ "prettier": "^2.7.1", "react": "18.2.0", "react-dom": "18.2.0", + "react-hot-toast": "^2.4.0", "react-markdown": "^8.0.1", "typescript": "^4.6.3", "vite": "^2.9.13", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index fd84a0a..3faf14b 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -34,6 +34,7 @@ specifiers: prop-types: ^15.8.1 react: 18.2.0 react-dom: 18.2.0 + react-hot-toast: ^2.4.0 react-markdown: ^8.0.1 rimraf: ^3.0.2 typescript: ^4.6.3 @@ -66,6 +67,7 @@ dependencies: prettier: 2.7.1 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 + react-hot-toast: 2.4.0_biqbaboplfbrettd7655fr4n2y react-markdown: 8.0.1_bbvjflvjoibwhtpmedigb26h6y typescript: 4.6.3 vite: 2.9.13 @@ -2984,6 +2986,12 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} + /goober/2.1.11: + resolution: {integrity: sha512-5SS2lmxbhqH0u9ABEWq7WPU69a4i2pYcHeCxqaNq6Cw3mnrF0ghWNM4tEGid4dKy8XNIAUbuThuozDHHKJVh3A==} + peerDependencies: + csstype: ^3.0.10 + dev: false + /has-flag/3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -3547,6 +3555,20 @@ packages: use-sidecar: 1.1.2_bbvjflvjoibwhtpmedigb26h6y dev: false + /react-hot-toast/2.4.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-qnnVbXropKuwUpriVVosgo8QrB+IaPJCpL8oBI6Ov84uvHZ5QQcTp2qg6ku2wNfgJl6rlQXJIQU5q+5lmPOutA==} + engines: {node: '>=10'} + peerDependencies: + react: '>=16' + react-dom: '>=16' + dependencies: + goober: 2.1.11 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + transitivePeerDependencies: + - csstype + dev: false + /react-is/16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} diff --git a/web/src/features/dev/debug/notification.ts b/web/src/features/dev/debug/notification.ts index 704e4f2..211e47f 100644 --- a/web/src/features/dev/debug/notification.ts +++ b/web/src/features/dev/debug/notification.ts @@ -1,30 +1,45 @@ import { CustomNotificationProps, NotificationProps } from '../../notifications/NotificationWrapper'; import { debugData } from '../../../utils/debugData'; -export const debugNotification = () => { - debugData([ - { - action: 'notify', - data: { - description: 'Dunak is nerd', - title: 'Dunak', - id: 1, - }, - }, - ]); -}; - export const debugCustomNotification = () => { debugData([ { action: 'customNotify', data: { - description: 'Dunak is nerd', - icon: 'basket-shopping', - style: { - backgroundColor: '#2D3748', - color: 'white', - }, + title: 'Success', + description: 'Notification description', + type: 'success', + }, + }, + ]); + debugData([ + { + action: 'customNotify', + data: { + title: 'Info', + description: 'Notification description', + type: 'info', + }, + }, + ]); + debugData([ + { + action: 'customNotify', + data: { + title: 'Error', + description: 'Notification description', + type: 'error', + }, + }, + ]); + debugData([ + { + action: 'customNotify', + data: { + title: 'Custom icon success', + description: 'Notification description', + type: 'success', + icon: 'microchip', }, }, ]); diff --git a/web/src/features/dev/index.tsx b/web/src/features/dev/index.tsx index 08492d3..9496c4a 100644 --- a/web/src/features/dev/index.tsx +++ b/web/src/features/dev/index.tsx @@ -4,7 +4,7 @@ import { debugAlert } from './debug/alert'; import { debugContext } from './debug/context'; import { debugInput } from './debug/input'; import { debugMenu } from './debug/menu'; -import { debugCustomNotification, debugNotification } from './debug/notification'; +import { debugCustomNotification } from './debug/notification'; import { debugCircleProgressbar, debugProgressbar } from './debug/progress'; import { debugTextUI } from './debug/textui'; import { debugSkillCheck } from './debug/skillcheck'; @@ -48,10 +48,7 @@ const Dev: React.FC = () => { -