Implement toast to project

This commit is contained in:
2023-10-29 12:38:47 +07:00
parent 76e7063d6e
commit 5b6e25b2c7
3 changed files with 46 additions and 0 deletions
+20
View File
@@ -1,6 +1,7 @@
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
import isPropValid from '@emotion/is-prop-valid';
import { StyleSheetManager } from 'styled-components';
import { Toaster } from 'react-hot-toast';
// Components
import AppLayout from './components/AppLayout';
@@ -28,6 +29,25 @@ function App() {
</Routes>
</BrowserRouter>
</StyleSheetManager>
<Toaster
position="top-center"
gutter={12}
containerStyle={{ margin: '8px', zIndex: 1 }}
toastOptions={{
success: {
duration: 3000,
},
error: {
duration: 5000,
},
style: {
fontSize: '16px',
maxWidth: '500px',
padding: '16px 24px',
},
}}
/>
</>
);
}