Skip to content

Commit

Permalink
Merge pull request #1 from parthpandyappp/feat-routes
Browse files Browse the repository at this point in the history
[Feat]: Routes setup
  • Loading branch information
parthpandyappp committed May 23, 2022
2 parents 1b9e880 + 03c8b71 commit 66ed10a
Show file tree
Hide file tree
Showing 19 changed files with 129 additions and 14 deletions.
58 changes: 58 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -10,6 +10,7 @@
"mockman-js": "^1.1.5",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"uuid": "^8.3.2"
},
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
Binary file removed public/logo192.png
Binary file not shown.
Binary file removed public/logo512.png
Binary file not shown.
10 changes: 0 additions & 10 deletions public/manifest.json
Expand Up @@ -6,16 +6,6 @@
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
Expand Down
11 changes: 8 additions & 3 deletions src/App.js
@@ -1,8 +1,13 @@
import { Routes } from "./routes"
import { Nav, Footer } from "./components"

function App() {
return (
<h1 className="text-3xl font-bold underline">
Hello world!
</h1>
<>
<Nav />
<Routes />
<Footer />
</>
)
}
export default App;
5 changes: 5 additions & 0 deletions src/components/Footer.jsx
@@ -0,0 +1,5 @@
const Footer = () => {
return <h1>Footer</h1>;
};

export { Footer };
5 changes: 5 additions & 0 deletions src/components/Nav.jsx
@@ -0,0 +1,5 @@
const Nav = () => {
return <h1>Nav</h1>;
};

export { Nav };
2 changes: 2 additions & 0 deletions src/components/index.js
@@ -0,0 +1,2 @@
export * from "./Footer"
export * from "./Nav"
5 changes: 4 additions & 1 deletion src/index.js
Expand Up @@ -3,13 +3,16 @@ import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import { makeServer } from "./server";
import { BrowserRouter as Router } from "react-router-dom";

// Call make Server
makeServer();

ReactDOM.render(
<React.StrictMode>
<App />
<Router>
<App />
</Router>
</React.StrictMode>,
document.getElementById("root")
);
5 changes: 5 additions & 0 deletions src/pages/Bookmarks.jsx
@@ -0,0 +1,5 @@
const BookMarks = () => {
return <h1>BookMarks</h1>;
};

export { BookMarks };
5 changes: 5 additions & 0 deletions src/pages/Explore.jsx
@@ -0,0 +1,5 @@
const Explore = () => {
return <h1>Explore</h1>;
};

export { Explore };
5 changes: 5 additions & 0 deletions src/pages/Home.jsx
@@ -0,0 +1,5 @@
const Home = () => {
return <h1>Home</h1>;
};

export { Home };
5 changes: 5 additions & 0 deletions src/pages/NotFound.jsx
@@ -0,0 +1,5 @@
const NotFound = () => {
return <h1>NotFound</h1>;
};

export { NotFound };
5 changes: 5 additions & 0 deletions src/pages/Profile.jsx
@@ -0,0 +1,5 @@
const Profile = () => {
return <h1>Profile</h1>;
};

export { Profile };
4 changes: 4 additions & 0 deletions src/pages/index.js
@@ -0,0 +1,4 @@
export { Home } from "./Home";
export { Profile } from "./Profile"
export { Explore } from "./Explore";
export { BookMarks } from "./Bookmarks";
16 changes: 16 additions & 0 deletions src/routes/Endpoints.jsx
@@ -0,0 +1,16 @@
import { Routes, Route } from "react-router-dom";
import { Home, Explore, BookMarks, Profile } from "../pages";
import { NotFound } from "../pages/NotFound";
const Endpoints = () => {
return (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/explore" element={<Explore />} />
<Route path="/bookmarks" element={<BookMarks />} />
<Route path="/profile" element={<Profile />} />
<Route path="*" element={<NotFound />} />
</Routes>
);
};

export { Endpoints as Routes };
1 change: 1 addition & 0 deletions src/routes/index.js
@@ -0,0 +1 @@
export * from "./Endpoints"

0 comments on commit 66ed10a

Please sign in to comment.