Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Commit

Permalink
fix: too many popups
Browse files Browse the repository at this point in the history
  • Loading branch information
mariz-ov committed Jul 6, 2024
1 parent e0ef4ac commit c8d3cb7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
17 changes: 0 additions & 17 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import NewProposalPopupForMain from '@/components/NewProposalPopupForMain/NewPro
import { FaArrowDown, FaFilter } from 'react-icons/fa';
import { Route, Routes } from 'react-router-dom';
import ProposalListForMain from './components/NewProposalPopupForMain/ProposalListForMain';
import { Slide, ToastContainer } from 'react-toastify';
import styles from './App.module.css';
import FilterMenu from './components/FilterMenu/FilterMenu';
import SimpleColorPicker from '@/components/ColorPicker/SimpleColorPicker.tsx';
Expand Down Expand Up @@ -322,22 +321,6 @@ function App() {
<Route path='/proposal/:id' element={<ProposalDetails />} />
</Routes>
</div>
<ToastContainer
position='top-right'
className={'top-12 z-999 w-full min-w-[200px] max-w-[420px]'}
transition={Slide}
closeButton={false}
newestOnTop
hideProgressBar
toastStyle={{
background: '#151f2c',
padding: '15px',
marginTop: '15px',
color: '#fff',
borderRadius: 0,
boxShadow: '5px 5px 0px #00000029',
}}
/>
</div>
);
//</editor-fold>
Expand Down
24 changes: 21 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,31 @@ import { BrowserRouter } from 'react-router-dom';
import { PixelawProvider } from '@/providers/PixelawProvider.tsx';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useProposalSubscription } from '@/hooks/useProposals.ts';
import {Slide, ToastContainer} from "react-toastify";

const queryClient = new QueryClient();

// putting it here for now because App updates like Crazy
const Test = () => {
const Toast = () => {
useProposalSubscription();
return <></>;
return (
<ToastContainer
position='top-right'
className={'top-12 z-999 w-full min-w-[200px] max-w-[420px]'}
transition={Slide}
closeButton={false}
newestOnTop
hideProgressBar
toastStyle={{
background: '#151f2c',
padding: '15px',
marginTop: '15px',
color: '#fff',
borderRadius: 0,
boxShadow: '5px 5px 0px #00000029',
}}
/>
);
};

ReactDOM.createRoot(document.getElementById('root')!).render(
Expand All @@ -21,7 +39,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
<PixelawProvider>
<BrowserRouter>
<App />
<Test />
<Toast />
</BrowserRouter>
</PixelawProvider>
</QueryClientProvider>
Expand Down

0 comments on commit c8d3cb7

Please sign in to comment.