From b88a46efca74dd7b10e594df0d1d7a05c75ff138 Mon Sep 17 00:00:00 2001 From: Anshuman Tiwari Date: Mon, 29 Jul 2024 11:48:22 +0000 Subject: [PATCH] nee ui integrated --- src/Dashboards/UserD.js | 301 +++++++++++++++++++++------------------- src/Dashboards/s.js | 91 ++++++++++++ 2 files changed, 250 insertions(+), 142 deletions(-) create mode 100644 src/Dashboards/s.js diff --git a/src/Dashboards/UserD.js b/src/Dashboards/UserD.js index f7bb7be..da3fb1e 100644 --- a/src/Dashboards/UserD.js +++ b/src/Dashboards/UserD.js @@ -5,8 +5,8 @@ import { useNavigate } from "react-router-dom"; import axios from "axios"; import { Link } from "react-router-dom"; import EditProductModal from "../components/EditProductModal"; -import DashboardOverview from './DashboardOverview'; -import './DashboardOverview.css'; +import DashboardOverview from "./DashboardOverview"; +import "./DashboardOverview.css"; const UserD = () => { const isLoggedIn = localStorage.getItem("isLoggedIn") === "true"; @@ -105,6 +105,11 @@ const UserD = () => { ); }; + const formatDate = (dateString) => { + const options = { year: "numeric", month: "long", day: "numeric" }; + return new Date(dateString).toLocaleDateString(undefined, options); + }; + if (!isLoggedIn) { return null; } @@ -120,7 +125,7 @@ const UserD = () => { onUpdate={handleUpdate} /> -

Happy Saving!!

+

Happy Saving!!!

{currentUser && (
Welcome, {currentUser.name}! @@ -131,33 +136,7 @@ const UserD = () => {
- - - - SmartSaver - -
-
-
- +
+
+
+

{currentUser && ( +
+ Welcome, {currentUser.name}! +
+ )}

+
+ +

Products

+ {products.length} +
+

Manage and track your product inventory.

+
+
+
+

Product Details

+
+
+ {products.map((product) => ( +
+
+

{product.product_name}

+
MFG Date: {formatDate(product.mfd)}
+
EXP Date: {formatDate(product.expiry_date)}
+

{product.product_info}

+

NOTIFICATION SET AS: {product.notificationPeriod}

+
+ +
-
{product.product_info}
- - - - ))} - -
+
+
+ {product.price} +
+ In Stock +
+
+
+ ))} +
+
+
+
- - -); + + ); }; export default UserD; diff --git a/src/Dashboards/s.js b/src/Dashboards/s.js new file mode 100644 index 0000000..a7320a7 --- /dev/null +++ b/src/Dashboards/s.js @@ -0,0 +1,91 @@ +
+
+
+

Products

+ 5 +
+

Manage and track your product inventory.

+
+
+
+

Product Details

+
+
+
+
+

Acme Wireless Headphones

+

High-quality wireless headphones with noise cancellation

+
+
+ $99.99 +
+ In Stock +
+
+
+
+
+

Eco-Friendly Water Bottle

+

Reusable water bottle made from sustainable materials

+
+
+ $24.99 +
+ In Stock +
+
+
+
+
+

Ergonomic Office Chair

+

Comfortable and adjustable office chair for long hours

+
+
+ $199.99 +
+ Low Stock +
+
+
+
+
+

Smart Home Thermostat

+

Intelligent thermostat with app control and scheduling

+
+
+ $149.99 +
+ In Stock +
+
+
+
+
+

Fitness Tracker Watch

+

Advanced fitness tracker with heart rate monitoring

+
+
+ $79.99 +
+ In Stock +
+
+
+
+
+
\ No newline at end of file