Skip to content

Commit f959c39

Browse files
committed
Design Product Single Page Structure JSX
1 parent c8b3f7f commit f959c39

File tree

4 files changed

+137
-6
lines changed

4 files changed

+137
-6
lines changed

admin/src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import UserSinglePage from "./pages/UserSinglePage";
1212
import NewUser from "./pages/NewUser";
1313
import ProductList from "./pages/ProductList";
1414
import ProductSinglePage from "./pages/ProductSinglePage";
15+
import NewProduct from "./pages/NewProduct";
1516

1617
// Styling..
1718
const Container = styled.div``;
@@ -32,6 +33,7 @@ function App() {
3233
<Route path="/newuser" element={<NewUser />} />
3334
<Route path="/products" element={<ProductList />} />
3435
<Route path="/product/:id" element={<ProductSinglePage />} />
36+
<Route path="/newproduct" element={<NewProduct />} />
3537
</Routes>
3638
</Main>
3739
</BrowserRouter>

admin/src/Data/dummyData.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,33 @@ export const usersData = [
4242
amt: 2100,
4343
},
4444
];
45-
45+
46+
export const productsData = [
47+
{
48+
name: 'Jan',
49+
Sales: 2500,
50+
Returns: 1500,
51+
amt: 2400,
52+
},
53+
{
54+
name: 'Feb',
55+
Sales: 3000,
56+
Returns: 2000,
57+
amt: 2210,
58+
},
59+
{
60+
name: 'Mar',
61+
Sales: 1000,
62+
Returns: 1500,
63+
amt: 2290,
64+
},
65+
{
66+
name: 'Apr',
67+
Sales: 2780,
68+
Returns: 650,
69+
amt: 2000,
70+
},
71+
];
4672
// ###############################33333
4773

4874
export const userRows = [

admin/src/pages/NewProduct.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react'
2+
import styled from 'styled-components'
3+
4+
// Styling...
5+
const Container = styled.div`
6+
flex:4;
7+
`
8+
// New Product React Functional Component...
9+
export default function NewProduct() {
10+
return (
11+
<Container>
12+
Add New Product here...
13+
</Container>
14+
)
15+
}
Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,103 @@
11
import React from 'react'
2+
3+
// import styled components for css styling...
24
import styled from 'styled-components'
35

6+
// import React Router Dom Library for Routing..
7+
import { Link } from 'react-router-dom'
8+
9+
// import required components...
10+
import Charts from '../components/Charts'
11+
12+
// import produts data from dummyData.js file...
13+
import { productsData } from '../Data/dummyData'
14+
415
// Styling...
516
const Container = styled.div`
617
flex: 4;
718
`
19+
const ProductTitleContainer = styled.div`
20+
21+
`
22+
const ProductTitle = styled.h1`
23+
24+
`
25+
const ProductAddNew = styled.button`
26+
27+
`
28+
const ProductTop = styled.div`
829
30+
`
31+
const ProductBottom = styled.div`
32+
33+
`
34+
const ProductTopLeft = styled.div`
35+
36+
`
37+
const ProductTopRight = styled.div`
38+
39+
`
40+
const ProductInfoTop = styled.div`
41+
42+
`
43+
const ProductInfoBottom = styled.div`
44+
45+
`
46+
const ProductInfoImage = styled.img`
47+
48+
`
49+
const ProductInfoName = styled.h1`
50+
51+
`
52+
const ProductInfoBottomItem = styled.div`
53+
54+
`
55+
const ProductInfoBottomKey = styled.span`
56+
57+
`
58+
const ProductInfoBottomValue = styled.span`
59+
60+
`
61+
// Product Single Page React Functional Component...
962
export default function ProductSinglePage() {
10-
return (
11-
<Container>
12-
Product Single Page...
13-
</Container>
14-
)
63+
return (
64+
<Container>
65+
<ProductTitleContainer>
66+
<ProductTitle>Item Page</ProductTitle>
67+
<Link to="/newproduct" style={{ color: 'inherit', backgroundColor: 'inherit', textDecoration: 'none' }}>
68+
<ProductAddNew>New</ProductAddNew>
69+
</Link>
70+
</ProductTitleContainer>
71+
<ProductTop>
72+
<ProductTopLeft>
73+
<Charts data={productsData} title="Product Movements" secondLine="Sales" firstLine="Returns" />
74+
</ProductTopLeft>
75+
<ProductTopRight>
76+
<ProductInfoTop>
77+
<ProductInfoImage src="https://i.ibb.co/GsH4D2J/2.png" alt="" />
78+
<ProductInfoName>Iphone 12mini</ProductInfoName>
79+
</ProductInfoTop>
80+
<ProductInfoBottom>
81+
<ProductInfoBottomItem>
82+
<ProductInfoBottomKey>Serial Number</ProductInfoBottomKey>
83+
<ProductInfoBottomValue>09562257110</ProductInfoBottomValue>
84+
</ProductInfoBottomItem>
85+
<ProductInfoBottomItem>
86+
<ProductInfoBottomKey>Sales</ProductInfoBottomKey>
87+
<ProductInfoBottomValue>12500</ProductInfoBottomValue>
88+
</ProductInfoBottomItem>
89+
<ProductInfoBottomItem>
90+
<ProductInfoBottomKey>Active</ProductInfoBottomKey>
91+
<ProductInfoBottomValue>Yes</ProductInfoBottomValue>
92+
</ProductInfoBottomItem>
93+
<ProductInfoBottomItem>
94+
<ProductInfoBottomKey>In Stock</ProductInfoBottomKey>
95+
<ProductInfoBottomValue>Yes</ProductInfoBottomValue>
96+
</ProductInfoBottomItem>
97+
</ProductInfoBottom>
98+
</ProductTopRight>
99+
</ProductTop>
100+
<ProductBottom></ProductBottom>
101+
</Container>
102+
)
15103
}

0 commit comments

Comments
 (0)