feat(Toast): add Toast nearly identical to ChatGPT's (#1108)

This commit is contained in:
Danny Avila 2023-10-27 15:48:05 -04:00 committed by GitHub
parent ba5ab86037
commit 81a90d245b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 281 additions and 3 deletions

View file

@ -1,8 +1,10 @@
import { RecoilRoot } from 'recoil';
import * as RadixToast from '@radix-ui/react-toast';
import { RouterProvider } from 'react-router-dom';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { QueryClient, QueryClientProvider, QueryCache } from '@tanstack/react-query';
import { ScreenshotProvider, ThemeProvider, useApiErrorBoundary } from './hooks';
import Toast from './components/ui/Toast';
import { router } from './routes';
const App = () => {
@ -22,8 +24,12 @@ const App = () => {
<QueryClientProvider client={queryClient}>
<RecoilRoot>
<ThemeProvider>
<RouterProvider router={router} />
<ReactQueryDevtools initialIsOpen={false} position="top-right" />
<RadixToast.Provider>
<RouterProvider router={router} />
<ReactQueryDevtools initialIsOpen={false} position="top-right" />
<Toast />
<RadixToast.Viewport className="pointer-events-none fixed inset-0 z-[60] mx-auto my-2 flex max-w-[560px] flex-col items-stretch justify-start md:pb-5" />
</RadixToast.Provider>
</ThemeProvider>
</RecoilRoot>
</QueryClientProvider>