From 4b4ae23c98e5ceae57224d2b4c2dabef69d791ae Mon Sep 17 00:00:00 2001 From: Abhi Singh Date: Mon, 15 May 2023 22:21:15 +0530 Subject: [PATCH 1/4] Chnages for Percy --- pages/orders/style.scss | 4 ++-- pages/signin/style.scss | 2 +- src/components/FloatChart/style.scss | 2 +- src/components/Header/index.jsx | 3 ++- src/components/Shelf/Filter/index.jsx | 2 +- src/components/Shelf/style.scss | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/orders/style.scss b/pages/orders/style.scss index 372df65..a3f310c 100644 --- a/pages/orders/style.scss +++ b/pages/orders/style.scss @@ -166,7 +166,7 @@ text-transform: uppercase; } .a-color-secondary, .a-color-tertiary { - color: #565959!important; + color: #202020!important; } .a-size-base { @@ -175,7 +175,7 @@ } .a-color-secondary, .a-color-tertiary { - color: #565959!important; + color: #202020!important; } .a-row .a-span2, .a-ws .a-row .a-ws-span2 { width: 14.948%; diff --git a/pages/signin/style.scss b/pages/signin/style.scss index 697e5c2..3ed631c 100644 --- a/pages/signin/style.scss +++ b/pages/signin/style.scss @@ -59,7 +59,7 @@ text-transform: none; } .Button_root__24MxS { - background-color: #333; + background-color: #682020; color: rgb(241, 243, 245); cursor: pointer; display: inline-flex; diff --git a/src/components/FloatChart/style.scss b/src/components/FloatChart/style.scss index c2b35f0..26dd253 100644 --- a/src/components/FloatChart/style.scss +++ b/src/components/FloatChart/style.scss @@ -46,7 +46,7 @@ &--float-cart-closed { position: absolute; background-color: #000; - margin-top: 75px; + margin-top: 100px; background-size: 50%; left: -60px; width: 60px; diff --git a/src/components/Header/index.jsx b/src/components/Header/index.jsx index f304eba..844e44f 100644 --- a/src/components/Header/index.jsx +++ b/src/components/Header/index.jsx @@ -20,6 +20,7 @@ const Header = () => { return (
+

Sample Announcement!!

@@ -129,7 +130,7 @@ const Header = () => { - Favourites + Favoured diff --git a/src/components/Shelf/Filter/index.jsx b/src/components/Shelf/Filter/index.jsx index 458075d..3f4b6fd 100644 --- a/src/components/Shelf/Filter/index.jsx +++ b/src/components/Shelf/Filter/index.jsx @@ -5,7 +5,7 @@ import { connect } from 'react-redux'; import { updateFilters } from '../../../services/filters/actions'; import Checkbox from '../../CheckBox'; -const availableSizes = ['Apple', 'Samsung', 'Google', 'OnePlus']; +const availableSizes = ['Apple', 'Samsung', 'Google', 'One Plus']; import './style.scss'; diff --git a/src/components/Shelf/style.scss b/src/components/Shelf/style.scss index 48271ee..7ce5c30 100644 --- a/src/components/Shelf/style.scss +++ b/src/components/Shelf/style.scss @@ -100,7 +100,7 @@ } &__buy-btn { - background-color: #1b1a20; + background-color: #676767; color: #fff; padding: 15px 0; margin-top: 10px; From efe171578a5bc7da384428e885f2c5dadb20618d Mon Sep 17 00:00:00 2001 From: Abhi Singh Date: Mon, 15 May 2023 23:28:22 +0530 Subject: [PATCH 2/4] changes title --- pages/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.jsx b/pages/index.jsx index 7e6655c..e0cbbc7 100644 --- a/pages/index.jsx +++ b/pages/index.jsx @@ -6,7 +6,7 @@ export default function Home() { return (
- StackDemo + StackDemo Change From e60195e7b65d72507eb894f084e56e0501c57a6b Mon Sep 17 00:00:00 2001 From: Abhi Singh Date: Tue, 16 May 2023 16:44:40 +0530 Subject: [PATCH 3/4] updates title --- pages/checkout/index.jsx | 248 ++++++++++++++++------- pages/confirmation/index.jsx | 106 ++++++---- pages/favourites/index.jsx | 28 ++- pages/offers/index.jsx | 74 ++++--- pages/orders/index.jsx | 278 +++++++++++++++---------- pages/signin/index.jsx | 381 +++++++++++++++++++++++++---------- 6 files changed, 741 insertions(+), 374 deletions(-) diff --git a/pages/checkout/index.jsx b/pages/checkout/index.jsx index c9afd53..00290e0 100644 --- a/pages/checkout/index.jsx +++ b/pages/checkout/index.jsx @@ -1,75 +1,78 @@ -import Head from 'next/head'; -import { useEffect } from 'react'; -import Link from 'next/link'; -import { connect } from 'react-redux'; -import store2 from 'store2'; -import Router from 'next/router'; -import axios from '../../src/services/axios'; -import { emptyCart } from '../../src/services/cart/actions'; -import { resetCartTotal } from '../../src/services/total/actions'; -import './style.scss'; +import Head from "next/head"; +import { useEffect } from "react"; +import Link from "next/link"; +import { connect } from "react-redux"; +import store2 from "store2"; +import Router from "next/router"; +import axios from "../../src/services/axios"; +import { emptyCart } from "../../src/services/cart/actions"; +import { resetCartTotal } from "../../src/services/total/actions"; +import "./style.scss"; const CheckOut = ({ cartTotal, cartProducts, emptyCart, resetCartTotal }) => { - let userName = store2.session.get('username'); + let userName = store2.session.get("username"); - const handleFormSubmit = e => { + const handleFormSubmit = (e) => { e.preventDefault(); - userName = store2.session.get('username'); - axios.post('/api/checkout', { - userName - }).then((data) => { - let userOrders = store2.session.get('userOrders') || []; - store2.session.set('confirmationProducts', cartProducts); - store2.session.set('confirmationTotal', cartTotal); - emptyCart(); - resetCartTotal(); - const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; - const today = new Date(); - userOrders.push({ - "id": Math.floor(Math.random() * 1000) + 1, - "orderDate": today.toLocaleDateString("en-US", dateOptions), - "total": cartTotal.totalPrice, - "deliveryDate": today.toLocaleDateString("en-US", dateOptions), - "items": cartProducts.map((cartProduct, index) => ({ - "sku": cartProduct.sku, - "title": cartProduct.title, - "id": index + 10, - "price": cartProduct.price * cartProduct.quantity, - "description": cartProduct.title - })) + userName = store2.session.get("username"); + axios + .post("/api/checkout", { + userName, + }) + .then((data) => { + let userOrders = store2.session.get("userOrders") || []; + store2.session.set("confirmationProducts", cartProducts); + store2.session.set("confirmationTotal", cartTotal); + emptyCart(); + resetCartTotal(); + const dateOptions = { year: "numeric", month: "long", day: "numeric" }; + const today = new Date(); + userOrders.push({ + id: Math.floor(Math.random() * 1000) + 1, + orderDate: today.toLocaleDateString("en-US", dateOptions), + total: cartTotal.totalPrice, + deliveryDate: today.toLocaleDateString("en-US", dateOptions), + items: cartProducts.map((cartProduct, index) => ({ + sku: cartProduct.sku, + title: cartProduct.title, + id: index + 10, + price: cartProduct.price * cartProduct.quantity, + description: cartProduct.title, + })), + }); + store2.session.set("userOrders", userOrders); + Router.replace("/confirmation"); + }) + .catch((err) => { + console.log(err); + Router.replace({ + pathname: "/signin", + query: { checkout: "true" }, + }); }); - store2.session.set('userOrders', userOrders); - Router.replace('/confirmation'); - }).catch((err) => { - console.log(err); - Router.replace({ - pathname: '/signin', - query: { checkout: 'true' }, - }); - }); }; - useEffect(() => { - userName = store2.session.get('username'); + useEffect(() => { + userName = store2.session.get("username"); if (!userName) { Router.replace({ - pathname: '/signin', - query: { checkout: 'true' }, + pathname: "/signin", + query: { checkout: "true" }, }); - } else if(cartProducts.length === 0) { - Router.replace('/'); + } else if (cartProducts.length === 0) { + Router.replace("/"); } }, []); if (cartProducts.length === 0) { return <>; - }; + } return ( <> - StackDemo - + StackDemo Change +
@@ -90,43 +93,111 @@ const CheckOut = ({ cartTotal, cartProducts, emptyCart, resetCartTotal }) => {
- Shipping Address + + Shipping Address +
-
+
- - + +
- - + +
- - + +
- - + +
- - + +
@@ -135,7 +206,13 @@ const CheckOut = ({ cartTotal, cartProducts, emptyCart, resetCartTotal }) => {
- +
@@ -145,7 +222,10 @@ const CheckOut = ({ cartTotal, cartProducts, emptyCart, resetCartTotal }) => {