Add ToastProvider and ToastViewport
This commit is contained in:
parent
f6d0cd7089
commit
5c2c61eeda
2 changed files with 22 additions and 3 deletions
15
components/Layout/index.scss
Normal file
15
components/Layout/index.scss
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
.ToastViewport {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0px;
|
||||||
|
right: 0px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 340px;
|
||||||
|
max-width: 100vw;
|
||||||
|
z-index: 2147483647;
|
||||||
|
padding: 25px;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 0px;
|
||||||
|
list-style: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
@ -10,6 +10,7 @@ import { accountState } from '~utils/accountState'
|
||||||
import setUserToken from '~utils/setUserToken'
|
import setUserToken from '~utils/setUserToken'
|
||||||
|
|
||||||
import '../styles/globals.scss'
|
import '../styles/globals.scss'
|
||||||
|
import { ToastProvider, Viewport } from '@radix-ui/react-toast'
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }: AppProps) {
|
function MyApp({ Component, pageProps }: AppProps) {
|
||||||
const accountCookie = getCookie('account')
|
const accountCookie = getCookie('account')
|
||||||
|
|
@ -43,9 +44,12 @@ function MyApp({ Component, pageProps }: AppProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<Layout>
|
<ToastProvider>
|
||||||
<Component {...pageProps} />
|
<Layout>
|
||||||
</Layout>
|
<Component {...pageProps} />
|
||||||
|
</Layout>
|
||||||
|
<Viewport className="ToastViewport" />
|
||||||
|
</ToastProvider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue