Initial commit
This commit is contained in:
39
src_frontend_orig/main.jsx
Normal file
39
src_frontend_orig/main.jsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { HashRouter, Routes, Route, Navigate, useLocation } from 'react-router-dom';
|
||||
import { AnimatePresence } from 'framer-motion';
|
||||
import LicensePlateApp from './LicensePlateApp.jsx';
|
||||
import CarManager from './CarManager.jsx';
|
||||
import LandingPage from './LandingPage.jsx';
|
||||
import PrintPage from './routes/PrintPage.jsx';
|
||||
import './fonts.css';
|
||||
import './index.css';
|
||||
|
||||
function AnimatedRoutes() {
|
||||
const location = useLocation();
|
||||
return (
|
||||
<AnimatePresence mode="wait">
|
||||
<Routes location={location} key={location.pathname}>
|
||||
<Route path="/" element={<LandingPage />} />
|
||||
<Route path="/generate" element={<LicensePlateApp />} />
|
||||
<Route path="/manage" element={<CarManager />} />
|
||||
<Route path="/print" element={<PrintPage />} />
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
</Routes>
|
||||
</AnimatePresence>
|
||||
);
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<HashRouter>
|
||||
<AnimatedRoutes />
|
||||
</HashRouter>
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
Reference in New Issue
Block a user