From 31d6352ab8855754ef18c01763d3c1b5a68de857 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 22 Dec 2022 15:29:18 +0700 Subject: Appbar component and auth hook (useAuth) --- src/pages/shop/cart.js | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'src/pages/shop') diff --git a/src/pages/shop/cart.js b/src/pages/shop/cart.js index 4c954960..f099a19e 100644 --- a/src/pages/shop/cart.js +++ b/src/pages/shop/cart.js @@ -1,17 +1,11 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; -import Head from "next/head"; import { TrashIcon, PlusIcon, MinusIcon, - ChevronLeftIcon, } from "@heroicons/react/24/solid"; -import { - ExclamationTriangleIcon, - HeartIcon, - HomeIcon -} from "@heroicons/react/24/outline"; +import { ExclamationTriangleIcon } from "@heroicons/react/24/outline"; // Helpers import { @@ -30,14 +24,10 @@ import Layout from "../../components/Layout"; import Link from "../../components/Link"; import Alert from "../../components/Alert"; import Spinner from "../../components/Spinner"; +import { useRouter } from "next/router"; +import AppBar from "../../components/AppBar"; -export async function getServerSideProps(context) { - let previousRoute = context.req.headers.referer || '/'; - if (previousRoute.endsWith('/shop/cart')) previousRoute = '/'; - return { props: { previousRoute } }; -} - -export default function Cart({ previousRoute }) { +export default function Cart() { const [isLoadingProducts, setIsLoadingProducts] = useState(true); const [products, setProducts] = useState([]); const [totalPriceBeforeTax, setTotalPriceBeforeTax] = useState(0); @@ -163,27 +153,9 @@ export default function Cart({ previousRoute }) { onClose={hideDeleteConfirmation} onSubmit={deleteItem} /> - - Keranjang Belanja - Indoteknik - - -
- {/* --- Start Title */} - - -

Keranjang Saya

- - {/* --- End Title */} - {/* --- Start Icons */} -
- - - - -
- {/* --- End Icons */} -
+ + {/* jsx-start: Progress Bar */}
-- cgit v1.2.3