Skip to content

Commit

Permalink
update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Aug 30, 2024
1 parent 0a36f08 commit 59e93c0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 51 deletions.
95 changes: 45 additions & 50 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import '@rainbow-me/rainbowkit/styles.css';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom';
import { Route, Routes, Navigate } from 'react-router-dom';
import { WagmiProvider } from 'wagmi';
import {
AuthenticationStatus,
Expand Down Expand Up @@ -114,57 +114,52 @@ const App: React.FC = () => {
globalThis.Buffer = Buffer;

return (
<BrowserRouter>
<LitProvider litNetwork={LitNetwork.DatilDev}>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<RainbowKitAuthenticationProvider
adapter={authenticationAdapter}
status={authStatus}
>
<RainbowKitProvider initialChain={sepolia}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Routes>
<LitProvider litNetwork={LitNetwork.DatilDev}>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<RainbowKitAuthenticationProvider
adapter={authenticationAdapter}
status={authStatus}
>
<RainbowKitProvider initialChain={sepolia}>
<ThemeProvider theme={theme}>
<CssBaseline />
<Routes>
<Route
path="/auth/login"
element={
authStatus === 'authenticated' ? (
<Navigate to="/" replace />
) : (
<Login />
)
}
/>
<Route
element={
<ProtectedRoute>
<DefaultLayout />
</ProtectedRoute>
}
>
<Route path="/" element={<Navigate to="/identifiers" />} />
<Route path="/identifiers" element={<Identifiers />} />
<Route
path="/auth/login"
element={
authStatus === 'authenticated' ? (
<Navigate to="/" replace />
) : (
<Login />
)
}
path="identifiers/:providers/attestation"
element={<Attestation />}
/>
<Route
element={
<ProtectedRoute>
<DefaultLayout />
</ProtectedRoute>
}
>
<Route
path="/"
element={<Navigate to="/identifiers" />}
/>
<Route path="/identifiers" element={<Identifiers />} />
<Route
path="identifiers/:providers/attestation"
element={<Attestation />}
/>
<Route path="/permissions" element={<Permissions />} />
</Route>
<Route path="/callback" element={<Callback />} />
<Route path="*" element={<div>Not found</div>} />
</Routes>
<CustomSnackbar />
</ThemeProvider>
</RainbowKitProvider>
</RainbowKitAuthenticationProvider>
</QueryClientProvider>
</WagmiProvider>
</LitProvider>
</BrowserRouter>
<Route path="/permissions" element={<Permissions />} />
</Route>
<Route path="/callback" element={<Callback />} />
<Route path="*" element={<div>Not found</div>} />
</Routes>
<CustomSnackbar />
</ThemeProvider>
</RainbowKitProvider>
</RainbowKitAuthenticationProvider>
</QueryClientProvider>
</WagmiProvider>
</LitProvider>
);
};

Expand Down
5 changes: 4 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { BrowserRouter } from 'react-router-dom';
import App from './App';

ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>
);

0 comments on commit 59e93c0

Please sign in to comment.