generated from cepdnaclk/eYY-3yp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some functionalities for invoices added
- Loading branch information
1 parent
f25182b
commit 275216e
Showing
13 changed files
with
182 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
code/Software/Frontend/src/AdminDashboard/Dashboard/TopProducts.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
//import './TopProducts.css'; | ||
|
||
const TopProducts = () => { | ||
const [products, setProducts] = useState([]); | ||
|
||
useEffect(() => { | ||
// Fetch top products data and set it to the state | ||
// can make an API call or use any other method to get the data | ||
const fetchData = async () => { | ||
// Example data | ||
const topProductsData = [ | ||
{ id: 1, name: 'Apple', image: 'https://healthjade.com/wp-content/uploads/2017/10/apple-fruit.jpg', popularity: '88%', sales: 345 }, | ||
{ id: 2, name: 'Chocolate Biscuit', image: 'https://objectstorage.ap-mumbai-1.oraclecloud.com/n/softlogicbicloud/b/cdn/o/products/600-600/114800--01--1623926473.jpeg', popularity: '61%', sales: 280 }, | ||
{ id: 3, name: 'Organic Milk Box', image: 'https://horizon.com/wp-content/uploads/horizon-organic-whole-dha-omega-3-milk.png', popularity: '52%', sales: 220 }, | ||
{ id: 4, name: 'Chocolate Bar', image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Green_and_Black%27s_dark_chocolate_bar_2.jpg/640px-Green_and_Black%27s_dark_chocolate_bar_2.jpg', popularity: '34%', sales: 180 }, | ||
]; | ||
|
||
setProducts(topProductsData); | ||
}; | ||
|
||
fetchData(); | ||
}, []); | ||
|
||
return ( | ||
<div > | ||
<h3>Top Products</h3> | ||
<br /> | ||
<div className="container_for_sales bg-white"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Rank</th> | ||
<th>Product Name</th> | ||
<th>Image</th> | ||
<th>Popularity</th> | ||
<th>Sales</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{products.map((product, index) => ( | ||
<tr key={product.id}> | ||
<td>{index + 1}</td> | ||
<td>{product.name}</td> | ||
<td><img src={product.image} alt={product.name} style={{ width: '100px', height: 'auto' }} /></td> | ||
<td>{product.popularity}</td> | ||
<td>{product.sales}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
|
||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TopProducts; |
30 changes: 30 additions & 0 deletions
30
code/Software/Frontend/src/AdminDashboard/Dashboard/TopSellingProduct.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
.container_for_topselling { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
max-width: 900px; | ||
border-radius: 25px; | ||
margin-bottom: 30px; | ||
padding: 40px; | ||
|
||
} | ||
.square-card_topselling { | ||
height: 37vh; /* Adjust as needed */ | ||
border-radius: 5px; | ||
aspect-ratio: 1/1; | ||
border-color: rgb(45, 49, 49); | ||
justify-content: center; | ||
align-items: center; | ||
padding: 40px; | ||
} | ||
|
||
.card-img-top { | ||
width: 70%; | ||
height: 200px; /* Adjust the height according to your preference */ | ||
object-fit: cover; | ||
align-content: center; | ||
} | ||
.col{ | ||
gap: 10000px; | ||
} |
49 changes: 49 additions & 0 deletions
49
code/Software/Frontend/src/AdminDashboard/Dashboard/TopSellingProducts.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react' | ||
import { useState, useEffect } from 'react'; | ||
//import './Dashboard.css' | ||
import './TopSellingProduct.css' | ||
|
||
|
||
function TopSellingProducts() { | ||
const [topSellingProducts, settopSellingProducts] = useState([]); | ||
|
||
useEffect(() => { | ||
// Fetch top products data and set it to the state | ||
// You can make an API call or use any other method to get the data | ||
const fetchData = async () => { | ||
// Example data | ||
const topProductsData = [ | ||
{ id: 1, name: 'Apple', image: 'https://healthjade.com/wp-content/uploads/2017/10/apple-fruit.jpg', popularity: '88%', sales: 345 }, | ||
{ id: 2, name: 'Chocolate Biscuit', image: 'https://objectstorage.ap-mumbai-1.oraclecloud.com/n/softlogicbicloud/b/cdn/o/products/600-600/114800--01--1623926473.jpeg', popularity: '61%', sales: 280 }, | ||
{ id: 3, name: 'Organic Milk Box', image: 'https://horizon.com/wp-content/uploads/horizon-organic-whole-dha-omega-3-milk.png', popularity: '52%', sales: 220 }, | ||
]; | ||
|
||
settopSellingProducts(topProductsData); | ||
}; | ||
|
||
fetchData(); | ||
}, []); | ||
return ( | ||
<div > | ||
<h2>Top Selling Products</h2> | ||
<p>View and Manage your top selling products</p> | ||
<br /> | ||
<div className="container_for_topselling bg-white"> | ||
<div className="row row-1 row-3-md-2 g-4" style={{flexWrap: 'nowrap', gap: '1px'}}> | ||
{topSellingProducts.map((product) => ( | ||
<div key={product.id} className="col"> | ||
<div className="card square-card_topselling"> | ||
<img src={product.image} alt={product.name} className="card-img-top" /> | ||
<div className="card-body_topselling"> | ||
<p className="card-text">{product.name}</p> | ||
<p className="card-text">Sold count: {product.sales}</p> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
export default TopSellingProducts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,8 @@ | |
color: #ccc; | ||
} | ||
|
||
|
||
.login_button{ | ||
width: 400px; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.