Skip to content

Commit

Permalink
๐Ÿ” Add react Router
Browse files Browse the repository at this point in the history
  • Loading branch information
amir-kedis committed Dec 16, 2023
1 parent 62f6cd5 commit 49ec897
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 23 deletions.
26 changes: 13 additions & 13 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.0.2",
"react-router-dom": "^6.20.1",
"react-router-dom": "^6.21.0",
"sass": "^1.69.5"
},
"devDependencies": {
Expand Down
13 changes: 4 additions & 9 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ import "./theme.scss";
// Global Style (includes normalize.css)
import "./assets/styles/global/global.scss";

// Import Routes
import Routes from "./routes";

function App() {
return (
<>
<h1>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h1>
<h2>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h2>
<h3>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h3>
<h4>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h4>
<h5>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h5>
<h6>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h6>
<p>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</p>
<a href="#1">ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</a>
<p className="small">ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</p>
<Routes />
</>
);
}
Expand Down
15 changes: 15 additions & 0 deletions client/src/components/testing/testTypo.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default function TestTypo() {
return (
<>
<h1>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h1>
<h2>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h2>
<h3>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h3>
<h4>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h4>
<h5>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h5>
<h6>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</h6>
<p>ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</p>
<a href="#1">ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</a>
<p className="small">ู…ุง ู„ุง ูŠุฏุฑูƒ ูƒู„ู‡ ู„ุง ูŠุชุฑูƒ ุฌู„ู‡</p>
</>
);
}
31 changes: 31 additions & 0 deletions client/src/routes.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// routes.jsx is the main router for the application
// Will have the routes in it
import {
BrowserRouter as Router,
Routes as Switch,
Route,
} from "react-router-dom";

// Import modules/pages under this line

// Import Testing Routes here
import TestTypo from "./components/testing/testTypo";

function Routes() {
return (
<Router>
<Switch>
<Route exact path="/" element={<h1>Landing</h1>} />

{/* Testing Routes */}
{/* FIXME: Delete test routes Later */}
<Route path="/testTypo" element={<TestTypo />} />

{/* Not Found */}
<Route path="*" element={<h1>Not Found</h1>} />
</Switch>
</Router>
);
}

export default Routes;

0 comments on commit 49ec897

Please sign in to comment.