From 40c44d1a39968d702bc72aef73f944f0a6bf653e Mon Sep 17 00:00:00 2001 From: Mishra-coder Date: Sat, 4 Apr 2026 01:40:29 +0530 Subject: [PATCH 01/25] clean up code,add category chips, fix header UI --- backend/controllers/userController.js | 4 +- frontend/src/Preview.jsx | 160 +++++++--------------- frontend/src/components/AccountModal.jsx | 18 +-- frontend/src/components/Checkout.jsx | 53 ++----- frontend/src/components/Header.jsx | 90 ++++-------- frontend/src/components/ProductCard.jsx | 1 - frontend/src/components/ProductDetail.jsx | 8 +- frontend/src/components/ProductGrid.jsx | 15 +- frontend/src/index.css | 93 +++++-------- frontend/vite.config.js | 3 + mobile/src/screens/HomeScreen.js | 2 +- mobile/src/screens/LoginScreen.js | 2 +- 12 files changed, 151 insertions(+), 298 deletions(-) diff --git a/backend/controllers/userController.js b/backend/controllers/userController.js index c2febf0..eb52e9d 100644 --- a/backend/controllers/userController.js +++ b/backend/controllers/userController.js @@ -28,7 +28,9 @@ const authUser = async (req, res) => { const registerUser = async (req, res) => { const { name, email, password } = req.body; - if (!email.includes('@') || !email.includes('.')) { + const atIndex = email.indexOf('@'); + const dotIndex = email.lastIndexOf('.'); + if (atIndex < 1 || dotIndex < atIndex + 2 || dotIndex === email.length - 1) { return res.status(400).json({ message: 'Please enter a valid email' }); } diff --git a/frontend/src/Preview.jsx b/frontend/src/Preview.jsx index 6409606..a205879 100644 --- a/frontend/src/Preview.jsx +++ b/frontend/src/Preview.jsx @@ -1,117 +1,63 @@ -import React from 'react'; - export default function Preview() { return ( -
-
-
-
- Zappify +
+
+
+ Zappify
-

Premium Shoe Store

-
-
-
-
-