Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c140cf6

Browse files
create a custom api demo and add a project named shopping cart and order project where one can add item to the cart also can make the items as favourite items and place orcer the item
1 parent f3bd31e commit c140cf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4014
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.jsx"></script>
12+
</body>
13+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "08-react-router-practice",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"react": "^18.2.0",
13+
"react-dom": "^18.2.0",
14+
"react-router": "^6.6.2",
15+
"react-router-dom": "^6.6.2"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^18.0.26",
19+
"@types/react-dom": "^18.0.9",
20+
"@vitejs/plugin-react": "^3.0.0",
21+
"vite": "^4.0.0"
22+
}
23+
}
Lines changed: 1 addition & 0 deletions
Loading[フレーム]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*{
2+
font-family: sans-serif;
3+
}
4+
.app-container{
5+
width: 450px;
6+
height: 100vh;
7+
background-color: rgb(216, 216, 216);
8+
margin: 9px auto;
9+
border-radius: 12px;
10+
padding: 21px;
11+
box-sizing: border-box;
12+
}
13+
.footer{
14+
background-color: rgb(53, 53, 53);
15+
color: white;
16+
padding: 33px;
17+
font-family: sans-serif;
18+
font-size: 14px;
19+
width: 340px;
20+
position: absolute;
21+
bottom: 0;
22+
border-radius: 12px;
23+
}
24+
.header{
25+
background-color: rgb(53, 53, 53);
26+
padding: 33px;
27+
font-family: sans-serif;
28+
font-size: 14px;
29+
width: 400px;
30+
height: 130px;
31+
border-radius: 12px;
32+
box-sizing: border-box;
33+
}
34+
.header ul {
35+
list-style: none;
36+
display: flex;
37+
38+
}
39+
.header ul li{
40+
margin: 12px;
41+
42+
43+
}
44+
.header-nav{
45+
color: white;
46+
font-size: 16px;
47+
text-decoration: none;
48+
}
49+
.header-nav:hover{
50+
color: gray;
51+
}
52+
.main-container
53+
{
54+
box-sizing: border-box;
55+
width: 400px;
56+
height: 430px;
57+
border-radius: 12px;
58+
padding: 21px;
59+
margin-top: 18px;
60+
border: 2px solid gray;
61+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from "react"
2+
import "./App.css"
3+
import {Routes, Route} from "react-router-dom"
4+
5+
import Footer from "./components/Footer"
6+
import Header from "./components/Header"
7+
8+
import HomeContainer from "./pages/HomeContainer"
9+
import AboutContainer from "./pages/AboutContainer"
10+
import ContactContainer from "./pages/contact/ContactContainer"
11+
import Gmail from "./pages/contact/Gmail"
12+
import Phone from "./pages/contact/Phone"
13+
14+
export default function App() {
15+
return(
16+
<div className="app-container">
17+
<Header/>
18+
19+
<Routes>
20+
<Route path="/" element={<HomeContainer/>}/>
21+
<Route path="/about" element={<AboutContainer/>}/>
22+
<Route path="/contact" element={<ContactContainer/>}/>
23+
<Route path="/contact/gmail" element={<Gmail/>} />
24+
<Route path="/contact/phone" element={<Phone/>} />
25+
</Routes>
26+
27+
<Footer/>
28+
</div>
29+
)
30+
}
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+
export default function Footer() {
4+
return(
5+
<div className="footer">
6+
<footer>
7+
<p>@copyright 2023 React-Router-sumanpaikdev</p>
8+
</footer>
9+
</div>
10+
)
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from "react"
2+
import {Link} from "react-router-dom"
3+
4+
export default function Header() {
5+
return(
6+
<div className="header">
7+
<header>
8+
<ul>
9+
<li><Link to="/" className="header-nav">Home</Link></li>
10+
<li><Link to="/about" className="header-nav">About</Link></li>
11+
<li><Link to="/contact" className="header-nav">Contact</Link></li>
12+
</ul>
13+
</header>
14+
</div>
15+
)
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import ReactDOM from "react-dom/client";
3+
import { BrowserRouter } from "react-router-dom";
4+
5+
import App from "./App";
6+
7+
ReactDOM.createRoot(document.getElementById("root")).render(
8+
<BrowserRouter>
9+
<App />
10+
</BrowserRouter>
11+
);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react"
2+
3+
export default function AboutContainer() {
4+
return(
5+
<div className="about">
6+
<h1>About Container</h1>
7+
</div>
8+
)
9+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /