Skip to content

Commit 3e8560f

Browse files
committed
setup basic route
1 parent 004df67 commit 3e8560f

File tree

7 files changed

+90
-18
lines changed

7 files changed

+90
-18
lines changed

package-lock.json

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"firebase": "^9.17.2",
1414
"react": "^18.2.0",
1515
"react-dom": "^18.2.0",
16+
"react-router-dom": "^6.9.0",
1617
"react-scripts": "5.0.1",
1718
"typescript": "^4.9.5",
1819
"web-vitals": "^2.1.4"

src/App.tsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
import logo from './logo.svg';
2-
import './App.css';
1+
import logo from "./logo.svg";
2+
import "./App.css";
3+
import { BrowserRouter, Route, Routes } from "react-router-dom";
4+
import Login from "pages/Login";
5+
import Signup from "pages/Signup";
36

47
function App() {
58
return (
6-
<div className="App">
7-
<header className="App-header">
8-
<img src={logo} className="App-logo" alt="logo" />
9-
<p>
10-
Edit <code>src/App.js</code> and save to reload.
11-
</p>
12-
<a
13-
className="App-link"
14-
href="https://reactjs.org"
15-
target="_blank"
16-
rel="noopener noreferrer"
17-
>
18-
Learn React
19-
</a>
20-
</header>
21-
</div>
9+
<BrowserRouter>
10+
<Routes>
11+
<Route path="/" element={<div>L:o</div>} />
12+
<Route path="login" element={<Login />} />
13+
<Route path="signup" element={<Signup />} />
14+
</Routes>
15+
</BrowserRouter>
2216
);
2317
}
2418

src/components/auth/Login.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
3+
type Props = {
4+
onSubmit: () => void;
5+
};
6+
7+
const Login = (props: Props) => {
8+
return <div>Login</div>;
9+
};
10+
11+
export default Login;

src/components/auth/Signup.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
3+
type Props = {
4+
onSubmit: () => void;
5+
};
6+
7+
const Signup = (props: Props) => {
8+
return <div>Signup</div>;
9+
};
10+
11+
export default Signup;

src/pages/Login.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from "react";
2+
import Login from "../components/auth/Login";
3+
4+
const LoginPage = () => {
5+
return <Login onSubmit={() => {}} />;
6+
};
7+
8+
export default LoginPage;

src/pages/Signup.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from "react";
2+
import Signup from "../components/auth/Signup";
3+
4+
const SignupPage = () => {
5+
return <Signup onSubmit={() => {}} />;
6+
};
7+
8+
export default SignupPage;

0 commit comments

Comments
 (0)