feat : add footer , header , base css, progressBar , main and page components
This commit is contained in:
58
src/App.tsx
58
src/App.tsx
@@ -1,35 +1,29 @@
|
||||
import { useState } from 'react'
|
||||
import reactLogo from './assets/react.svg'
|
||||
import viteLogo from '/vite.svg'
|
||||
import './App.css'
|
||||
|
||||
function App() {
|
||||
const [count, setCount] = useState(0)
|
||||
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
|
||||
import Layout from "./layout";
|
||||
import PrivateRoute from "./routes/PrivateRoute";
|
||||
import Shop from "./pages/shop";
|
||||
import Tutorial from "./pages/tutorial";
|
||||
import Rule from "./pages/rule";
|
||||
import About from "./pages/about";
|
||||
import ProgressBar from "./common/ProgressBar";
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<a href="https://vitejs.dev" target="_blank">
|
||||
<img src={viteLogo} className="logo" alt="Vite logo" />
|
||||
</a>
|
||||
<a href="https://react.dev" target="_blank">
|
||||
<img src={reactLogo} className="logo react" alt="React logo" />
|
||||
</a>
|
||||
</div>
|
||||
<h1>Vite + React</h1>
|
||||
<div className="card">
|
||||
<button onClick={() => setCount((count) => count + 1)}>
|
||||
count is {count}
|
||||
</button>
|
||||
<p>
|
||||
Edit <code>src/App.tsx</code> and save to test HMR
|
||||
</p>
|
||||
</div>
|
||||
<p className="read-the-docs">
|
||||
Click on the Vite and React logos to learn more
|
||||
</p>
|
||||
</>
|
||||
)
|
||||
}
|
||||
<Router basename="/">
|
||||
<ProgressBar />
|
||||
<Routes>
|
||||
<Route path="/" element={<Layout />}>
|
||||
<Route index element={<Shop />} />
|
||||
<Route path="tutorial" element={<Tutorial />} />
|
||||
<Route path="rule" element={<Rule />} />
|
||||
<Route path="about" element={<About />} />
|
||||
<Route element={<PrivateRoute />}>
|
||||
<Route path="private" element={<p>private</p>} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Routes>
|
||||
</Router>
|
||||
);
|
||||
};
|
||||
|
||||
export default App
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user