Skip to content

Commit 98780f5

Browse files
committed
added missing data points
1 parent cd52a6b commit 98780f5

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

frontend/ecommerce-fe/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
1212
- Add the following filters *(selecting a filter resets sortOption to default)*:
1313
- Category
1414
- Brand
15-
- Add a search bar to search for Product. Leverage the search endpoint or enhance with your own logic. *(searching resets sortOption to default)*
15+
- Add a search bar to search for Product. Leverages the search [endpoint](https://dummyjson.com/products/search?q=Laptop). *(searching resets sortOption to default)*
1616
- Provide a detailed product page after clicking on a product.
1717
- Provide a main product image along with all the product detail information provided by the product endpoint.
1818

frontend/ecommerce-fe/src/components/common/Footer/Footer.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Typography } from '@mui/material';
22
import React from 'react';
3+
import styles from './Footer.module.css';
4+
35

46
const Footer = () => {
57
return (
6-
<footer>
7-
<Typography>Ecommerce Pvt. Ltd.</Typography>
8+
<footer className={styles.FooterCtn}>
9+
<Typography>Ecommerce Pvt. Ltd. | Contact Us | About Us </Typography>
810
</footer>
911
);
1012
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.FooterCtn {
2+
margin-top: 50px; /* Adjust the value as needed */
3+
}

frontend/ecommerce-fe/src/components/layouts/ProductPage/ProductPage.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ const ProductPage = () => {
4545
rating={product.rating}
4646
/>
4747
<Typography variant="h4" className={styles.ProductPriceTxt}>
48-
{"$"+product.price}
48+
{"$"+product.price+"("+product.discountPercentage+"% off)"}
49+
</Typography>
50+
<Typography variant="h5" >
51+
{product.category+" | "+product.brand}
52+
</Typography>
53+
<Typography variant="body2" >
54+
{"Product Description: "+product.description}
4955
</Typography>
5056
<Typography variant="body2" >
51-
{product.description}
57+
{product.stock+" units left in stock"}
5258
</Typography>
5359

5460
</Container>

frontend/ecommerce-fe/src/components/layouts/ProductPage/ProductPage.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
min-height: 100%;
44
}
55

6+
.ProductInfoCtn > * {
7+
margin-bottom: 50px;
8+
}
9+
610
.swiper {
711
width: 100%;
812
height: 100%;

frontend/ecommerce-fe/src/components/pages/Listing/ProductCard/ProductCard.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styles from './ProductCard.module.css';
44
import { ProductRating } from '../../../common/ProductRating/ProductRating';
55

66

7-
export const ProductCard = ({ id,imageUrl,title, description, price, rating }) => {
7+
export const ProductCard = ({ id,imageUrl,title, description, price, rating,category }) => {
88
return (
99
<Card className={styles.ProductCardCtn} >
1010
<CardActionArea href={`/${id}`} >
@@ -24,6 +24,9 @@ export const ProductCard = ({ id,imageUrl,title, description, price, rating }) =
2424
<Typography variant="body2" color="text.secondary">
2525
{"$"+price}
2626
</Typography>
27+
<Typography variant="body2" color="text.secondary">
28+
{category}
29+
</Typography>
2730
<Typography variant="body2" color="text.secondary">
2831
{description}
2932
</Typography>

frontend/ecommerce-fe/src/components/pages/Listing/ProductCatalog/ProductCatalog.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const ProductCatalog = ({ catalogPage,totalPages,paginationHandler }) => {
2323
title={product.title}
2424
price={product.price}
2525
rating={product.rating}
26+
category={product.category}
2627
/>
2728
);
2829
}

0 commit comments

Comments
 (0)