File tree Expand file tree Collapse file tree 5 files changed +23
-7
lines changed
packages/ui-components/src
Providers/NotificationProvider Expand file tree Collapse file tree 5 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 7373 }
7474}
7575
76- .icon {
77- @apply size-4;
76+ .toast {
77+ @apply flex
78+ items-center
79+ gap-3;
80+
81+ .icon {
82+ @apply size-4;
83+ }
7884}
Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ const CodeBox: FC<PropsWithChildren<CodeBoxProps>> = ({
9494 const text = containerRef . current ?. textContent ;
9595 if ( text ) {
9696 notify ( {
97- duration : 300 ,
97+ duration : 30000 ,
9898 message : (
99- < div className = "flex items-center gap-3" >
99+ < div className = { styles . toast } >
100100 < CodeBracketIcon className = { styles . icon } />
101101 { notificationText }
102102 </ div >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { render } from '@testing-library/react';
33import { describe , it } from 'node:test' ;
44import assert from 'node:assert/strict' ;
55
6- import { NotificationProvider , useNotification } from '../NotificationProvider ' ;
6+ import { NotificationProvider , useNotification } from '..' ;
77
88describe ( 'useNotification' , ( ) => {
99 it ( 'should return the notification dispatch function' , ( ) => {
Original file line number Diff line number Diff line change 1+ @reference "../../styles/index.css" ;
2+
3+ .viewport {
4+ @apply fixed
5+ bottom-0
6+ right-0
7+ list-none;
8+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import type {
1010
1111import Notification from '#ui/Common/Notification' ;
1212
13+ import styles from './index.module.css' ;
14+
1315type NotificationContextType = {
1416 message : string | ReactNode ;
1517 duration : number ;
@@ -38,13 +40,13 @@ export const NotificationProvider: FC<PropsWithChildren> = ({ children }) => {
3840 < Toast . Provider >
3941 { children }
4042
41- < Toast . Viewport className = { 'fixed bottom-0 right-0 list-none' } />
42-
4343 { notification && (
4444 < Notification duration = { notification . duration } >
4545 { notification . message }
4646 </ Notification >
4747 ) }
48+
49+ < Toast . Viewport className = { styles . viewport } />
4850 </ Toast . Provider >
4951 </ NotificationDispatch . Provider >
5052 </ NotificationContext . Provider >
You can’t perform that action at this time.
0 commit comments