proposal-system/web/src/main.tsx
Adam Moussa 57122ee702 fix: web medium findings (WEB-M2, M5, M6, M7, M10, M13)
WEB-M2: 401 interceptor now dispatches Redux logout action to clear
auth state, not just localStorage.

WEB-M5: CreateProposalRequest uses typed ServiceCategory and Priority
unions aligned with shared/api-contracts contract.

WEB-M6: Vendor PDF upload validates MIME type (application/pdf),
file extension (.pdf), and max size (25 MB) before accepting.

WEB-M7: AdminWorkspace shows error Alert with retry button when
proposal fetch fails, instead of rendering empty workspace.

WEB-M10: State transition buttons (Approve, Send, Revise) are
disabled with explanatory tooltips when proposal is not in the
correct state for that transition.

WEB-M13: ToastContainer moved inside BrowserRouter so toasts
render in the correct React tree context.
2026-05-27 18:18:44 -04:00

30 lines
1.1 KiB
TypeScript

import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { QueryClientProvider } from '@tanstack/react-query';
import { ThemeProvider, CssBaseline } from '@mui/material';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import './index.css';
import { store } from './app/store';
import { queryClient } from './lib/queryClient';
import { theme } from './theme';
import App from './App';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Provider store={store}>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<CssBaseline />
{/* Fix: WEB-M13 — ToastContainer inside BrowserRouter so toasts render in the correct React tree */}
<BrowserRouter>
<App />
<ToastContainer position="bottom-right" autoClose={4000} />
</BrowserRouter>
</ThemeProvider>
</QueryClientProvider>
</Provider>
</React.StrictMode>
);