From ffa261e6adef70a2845878cf93e6e492eb8cee62 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 27 Feb 2023 10:49:45 +0700 Subject: footer --- .../components/elements/Footer/BasicFooter.jsx | 269 +++++++++++++++++++++ src/core/components/layouts/AppLayout.jsx | 2 + src/core/components/layouts/BasicLayout.jsx | 2 + src/lib/auth/components/IsAuth.jsx | 20 ++ src/lib/home/components/PreferredBrand.jsx | 2 +- src/pages/my/address/[id]/edit.jsx | 15 +- src/pages/my/address/create.jsx | 9 +- src/pages/my/address/index.jsx | 9 +- src/pages/my/invoice/[id].jsx | 9 +- src/pages/my/invoices.jsx | 9 +- src/pages/my/menu.jsx | 91 +++---- src/pages/my/profile.jsx | 13 +- src/pages/my/transaction/[id].jsx | 9 +- src/pages/my/transactions.jsx | 9 +- src/pages/my/wishlist.jsx | 9 +- src/pages/shop/checkout/finish.jsx | 9 +- src/pages/shop/checkout/index.jsx | 9 +- src/pages/shop/quotation/finish.jsx | 59 ++--- src/pages/shop/quotation/index.jsx | 9 +- 19 files changed, 449 insertions(+), 114 deletions(-) create mode 100644 src/core/components/elements/Footer/BasicFooter.jsx create mode 100644 src/lib/auth/components/IsAuth.jsx (limited to 'src') diff --git a/src/core/components/elements/Footer/BasicFooter.jsx b/src/core/components/elements/Footer/BasicFooter.jsx new file mode 100644 index 00000000..2831d4d6 --- /dev/null +++ b/src/core/components/elements/Footer/BasicFooter.jsx @@ -0,0 +1,269 @@ +import NextImage from 'next/image' +import IndoteknikLogo from '@/images/logo.png' +import { + DevicePhoneMobileIcon, + EnvelopeIcon, + MapPinIcon, + PhoneArrowUpRightIcon +} from '@heroicons/react/24/outline' +import Link from '../Link/Link' + +const BasicFooter = () => { + return ( + + ) +} + +const headerClassName = 'font-semibold mb-2' + +const OfficeLocation = () => ( +
+
Kantor Pusat
+
+ Jl. Bandengan Utara 85A No. 8-9 RT.3/RW.16, Penjaringan, Kec. Penjaringan, Jakarta Utara +
+
+) + +const WarehouseLocation = () => ( +
+
Gudang Indoteknik
+
+ Jl. Bandengan Utara Komp. 85 A dan B, Penjaringan, Kec. Penjaringan, Jakarta Utara +
+
+) + +const AboutUs = () => ( +
+
Tentang Kami
+ +
+) + +const CustomerGuide = () => ( +
+
Panduan Pelanggan
+ +
+) + +const InformationCenter = () => ( +
+
Layanan Informasi
+ +
+) + +const OpenHours = () => ( +
+
Jam Operasional
+ +
+) + +const SocialMedias = () => ( +
+
Temukan Kami
+
+ + + + +
+
+) + +const Payments = () => ( +
+
Pembayaran
+
+ + + + + + + + +
+
+) + +const InternalItemLink = ({ href, children }) => ( + + {children} + +) + +export default BasicFooter diff --git a/src/core/components/layouts/AppLayout.jsx b/src/core/components/layouts/AppLayout.jsx index 3e3c8ee5..006c47c7 100644 --- a/src/core/components/layouts/AppLayout.jsx +++ b/src/core/components/layouts/AppLayout.jsx @@ -1,4 +1,5 @@ import AppBar from '../elements/Appbar/Appbar' +import BasicFooter from '../elements/Footer/BasicFooter' import AnimationLayout from './AnimationLayout' const AppLayout = ({ children, title }) => { @@ -7,6 +8,7 @@ const AppLayout = ({ children, title }) => { {children} + ) diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx index 6f176737..1a7185cd 100644 --- a/src/core/components/layouts/BasicLayout.jsx +++ b/src/core/components/layouts/BasicLayout.jsx @@ -1,4 +1,5 @@ import dynamic from 'next/dynamic' +import BasicFooter from '../elements/Footer/BasicFooter' const Navbar = dynamic(() => import('../elements/Navbar/Navbar')) const AnimationLayout = dynamic(() => import('./AnimationLayout')) @@ -8,6 +9,7 @@ const BasicLayout = ({ children }) => { <> {children} + ) } diff --git a/src/lib/auth/components/IsAuth.jsx b/src/lib/auth/components/IsAuth.jsx new file mode 100644 index 00000000..1cfd3172 --- /dev/null +++ b/src/lib/auth/components/IsAuth.jsx @@ -0,0 +1,20 @@ +import { useRouter } from 'next/router' +import { useEffect, useState } from 'react' +import { getAuth } from '@/core/utils/auth' + +const IsAuth = ({ children }) => { + const router = useRouter() + const [response, setResponse] = useState(<>) + + useEffect(() => { + if (!getAuth()) { + router.replace('/login') + } else { + setResponse(children) + } + }, [children, router]) + + return response +} + +export default IsAuth diff --git a/src/lib/home/components/PreferredBrand.jsx b/src/lib/home/components/PreferredBrand.jsx index fa0fdd0d..3df3cdb7 100644 --- a/src/lib/home/components/PreferredBrand.jsx +++ b/src/lib/home/components/PreferredBrand.jsx @@ -13,7 +13,7 @@ const PreferredBrand = () => { {!preferredBrands.isLoading && ( {preferredBrands.data?.manufactures.map((brand) => ( diff --git a/src/pages/my/address/[id]/edit.jsx b/src/pages/my/address/[id]/edit.jsx index 65d7cf9b..bc5f3471 100644 --- a/src/pages/my/address/[id]/edit.jsx +++ b/src/pages/my/address/[id]/edit.jsx @@ -1,15 +1,18 @@ import AppLayout from '@/core/components/layouts/AppLayout' import addressApi from '@/lib/address/api/addressApi' import EditAddressComponent from '@/lib/address/components/EditAddress' +import IsAuth from '@/lib/auth/components/IsAuth' export default function EditAddress({ id, defaultValues }) { return ( - - - + + + + + ) } diff --git a/src/pages/my/address/create.jsx b/src/pages/my/address/create.jsx index ee905ee0..ec17f987 100644 --- a/src/pages/my/address/create.jsx +++ b/src/pages/my/address/create.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' import CreateAddressComponent from '@/lib/address/components/CreateAddress' +import IsAuth from '@/lib/auth/components/IsAuth' export default function CreateAddress() { return ( - - - + + + + + ) } diff --git a/src/pages/my/address/index.jsx b/src/pages/my/address/index.jsx index 46a7075c..93ed40b0 100644 --- a/src/pages/my/address/index.jsx +++ b/src/pages/my/address/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' import AddressesComponent from '@/lib/address/components/Addresses' +import IsAuth from '@/lib/auth/components/IsAuth' export default function Addresses() { return ( - - - + + + + + ) } diff --git a/src/pages/my/invoice/[id].jsx b/src/pages/my/invoice/[id].jsx index 0d409878..4938d8f8 100644 --- a/src/pages/my/invoice/[id].jsx +++ b/src/pages/my/invoice/[id].jsx @@ -1,4 +1,5 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import InvoiceComponent from '@/lib/invoice/components/Invoice' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Invoice() { const router = useRouter() return ( - - - + + + + + ) } diff --git a/src/pages/my/invoices.jsx b/src/pages/my/invoices.jsx index fd50c3c8..12a5ff7e 100644 --- a/src/pages/my/invoices.jsx +++ b/src/pages/my/invoices.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import InvoicesComponent from '@/lib/invoice/components/Invoices' export default function Invoices() { return ( - - - + + + + + ) } diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 576919ae..40c84668 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -3,6 +3,7 @@ import Link from '@/core/components/elements/Link/Link' import AppLayout from '@/core/components/layouts/AppLayout' import useAuth from '@/core/hooks/useAuth' import { deleteAuth } from '@/core/utils/auth' +import IsAuth from '@/lib/auth/components/IsAuth' import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' import { useRouter } from 'next/router' @@ -16,62 +17,64 @@ export default function Menu() { } return ( - - -
- -
-
-
{auth?.name}
- {auth?.company &&
Akun Bisnis
} - {!auth?.company &&
Akun Individu
} -
-
- -
- + + + +
+ +
+
+
{auth?.name}
+ {auth?.company &&
Akun Bisnis
} + {!auth?.company &&
Akun Individu
} +
+
+ +
+ - + -
-
- Aktivitas Pembelian +
+
+ Aktivitas Pembelian -
- Daftar Transaksi - Invoice & Faktur Pajak - Wishlist +
+ Daftar Transaksi + Invoice & Faktur Pajak + Wishlist +
-
-
- Pusat Bantuan +
+ Pusat Bantuan -
- Customer Support - F.A.Q +
+ Customer Support + F.A.Q +
-
-
- Pengaturan Akun +
+ Pengaturan Akun -
- Daftar Alamat -
+
+ Daftar Alamat +
-
- +
+ +
-
- + + ) } diff --git a/src/pages/my/profile.jsx b/src/pages/my/profile.jsx index 8a91ea17..72a1ee3c 100644 --- a/src/pages/my/profile.jsx +++ b/src/pages/my/profile.jsx @@ -2,15 +2,18 @@ import Divider from '@/core/components/elements/Divider/Divider' import AppLayout from '@/core/components/layouts/AppLayout' import useAuth from '@/core/hooks/useAuth' import CompanyProfile from '@/lib/auth/components/CompanyProfile' +import IsAuth from '@/lib/auth/components/IsAuth' import PersonalProfile from '@/lib/auth/components/PersonalProfile' export default function Profile() { const auth = useAuth() return ( - - - - {auth?.parentId && } - + + + + + {auth?.parentId && } + + ) } diff --git a/src/pages/my/transaction/[id].jsx b/src/pages/my/transaction/[id].jsx index ae27ab88..5167748c 100644 --- a/src/pages/my/transaction/[id].jsx +++ b/src/pages/my/transaction/[id].jsx @@ -1,4 +1,5 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import TransactionComponent from '@/lib/transaction/components/Transaction' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Transaction() { const router = useRouter() return ( - - - + + + + + ) } diff --git a/src/pages/my/transactions.jsx b/src/pages/my/transactions.jsx index d18a00f4..30b9be07 100644 --- a/src/pages/my/transactions.jsx +++ b/src/pages/my/transactions.jsx @@ -1,12 +1,15 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import dynamic from 'next/dynamic' const TransactionsComponent = dynamic(() => import('@/lib/transaction/components/Transactions')) export default function Transactions() { return ( - - - + + + + + ) } diff --git a/src/pages/my/wishlist.jsx b/src/pages/my/wishlist.jsx index f1c0bf28..196adf50 100644 --- a/src/pages/my/wishlist.jsx +++ b/src/pages/my/wishlist.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import Wishlists from '@/lib/wishlist/components/Wishlists' export default function Wishlist() { return ( - - - + + + + + ) } diff --git a/src/pages/shop/checkout/finish.jsx b/src/pages/shop/checkout/finish.jsx index fb6970f6..cc64199f 100644 --- a/src/pages/shop/checkout/finish.jsx +++ b/src/pages/shop/checkout/finish.jsx @@ -1,4 +1,5 @@ import BasicLayout from '@/core/components/layouts/BasicLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout' import { useRouter } from 'next/router' @@ -6,8 +7,10 @@ export default function Finish() { const router = useRouter() return ( - - - + + + + + ) } diff --git a/src/pages/shop/checkout/index.jsx b/src/pages/shop/checkout/index.jsx index 5e8f2663..015a11b3 100644 --- a/src/pages/shop/checkout/index.jsx +++ b/src/pages/shop/checkout/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import CheckoutComponent from '@/lib/checkout/components/Checkout' export default function Checkout() { return ( - - - + + + + + ) } diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 98ffeec2..15881ea0 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -1,6 +1,7 @@ import Link from '@/core/components/elements/Link/Link' import BasicLayout from '@/core/components/layouts/BasicLayout' import useAuth from '@/core/hooks/useAuth' +import IsAuth from '@/lib/auth/components/IsAuth' import { EnvelopeIcon } from '@heroicons/react/24/outline' import { useRouter } from 'next/router' @@ -9,33 +10,35 @@ export default function FinishQuotation() { const router = useRouter() const { id } = router.query return ( - -
-
- - - -
-

Terima Kasih {auth?.name}

-

- Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera menghubungi - anda. -

- {id && ( - - Lihat Penawaran - - )} - - Ke Halaman Utama - -
-
+ + +
+
+ + + +
+

Terima Kasih {auth?.name}

+

+ Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera + menghubungi anda. +

+ {id && ( + + Lihat Penawaran + + )} + + Ke Halaman Utama + +
+
+
) } diff --git a/src/pages/shop/quotation/index.jsx b/src/pages/shop/quotation/index.jsx index 744b75fe..ff8b8644 100644 --- a/src/pages/shop/quotation/index.jsx +++ b/src/pages/shop/quotation/index.jsx @@ -1,10 +1,13 @@ import AppLayout from '@/core/components/layouts/AppLayout' +import IsAuth from '@/lib/auth/components/IsAuth' import QuotationComponent from '@/lib/quotation/components/Quotation' export default function Quotation() { return ( - - - + + + + + ) } -- cgit v1.2.3