From 791146e57a6d89d4fa50833a8993d555bfb56763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nguy=E1=BB=85n=20th=C3=A1i=20nh=C3=A2n?= Date: Wed, 1 Nov 2023 14:32:37 +0700 Subject: [PATCH] remove file not necessary --- pages/api/products.ts | 11 --- pages/cart.tsx | 11 --- pages/cart/checkout.tsx | 157 ---------------------------------------- pages/payment.tsx | 19 ----- pages/phone.tsx | 19 ----- 5 files changed, 217 deletions(-) delete mode 100644 pages/api/products.ts delete mode 100644 pages/cart.tsx delete mode 100644 pages/cart/checkout.tsx delete mode 100644 pages/payment.tsx delete mode 100644 pages/phone.tsx diff --git a/pages/api/products.ts b/pages/api/products.ts deleted file mode 100644 index 80b4a8b..0000000 --- a/pages/api/products.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { NextApiRequest, NextApiResponse } from 'next'; - -// fake data -import products from '../../utils/data/products'; - -export default (req: NextApiRequest, res: NextApiResponse) => { - console.log(req); - setTimeout(() => { - res.status(200).json(products); - }, 800); -} diff --git a/pages/cart.tsx b/pages/cart.tsx deleted file mode 100644 index 7f8510f..0000000 --- a/pages/cart.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import Layout from '../layouts/main'; -import ShoppingCart from '../components/shopping-cart'; - -const Products = () => ( - - - -) - -export default Products - \ No newline at end of file diff --git a/pages/cart/checkout.tsx b/pages/cart/checkout.tsx deleted file mode 100644 index f80c59e..0000000 --- a/pages/cart/checkout.tsx +++ /dev/null @@ -1,157 +0,0 @@ -import Layout from '../../layouts/main'; -import { useSelector } from 'react-redux'; -import { RootState } from 'store'; - -const CheckoutPage = () => { - - const priceTotal = useSelector((state: RootState) => { - const cartItems = state.cart.cartItems; - let totalPrice = 0; - if(cartItems.length > 0) { - cartItems.map(item => totalPrice += item.price * item.count); - } - - return totalPrice; - }) - - return ( - -
-
-
-

Shipping and Payment

-
- -
-
-
- - -
- -
-

Shipping information

-
-
-
- -
- -
- -
-
- -
-
- -
- -
- -
-
- -
-
- -
- -
- -
-
- -
-
- -
- -
-
- -
-
-
-
-
-
- -
-
-

Payment method

-
    -
  • - Paypal -
  • -
  • - Paypal -
  • -
  • - Paypal -
  • -
  • - Paypal -
  • -
  • - Paypal -
  • -
  • - Paypal -
  • -
-
- -
-

Delivery method

-
    -
  • - Paypal -

    $20.00

    -
  • -
  • - Paypal -

    $12.00

    -
  • -
  • - Paypal -

    $15.00

    -
  • -
  • - Paypal -

    $10.00

    -
  • -
-
-
- -
-
-

Your cart

- -
-

Total cost

-

${priceTotal}

-
-
-
-
- -
- Back -
- - -
-
-
-
-
- ) -}; - - -export default CheckoutPage \ No newline at end of file diff --git a/pages/payment.tsx b/pages/payment.tsx deleted file mode 100644 index 74e49db..0000000 --- a/pages/payment.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import Layout from '../layouts/main'; -import Footer from '../components/footer'; -import Breadcrumb from '../components/breadcrumb'; - -const Payment = () =>{ - return( - - -
-
- Payment -
-
-