diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 15:19:35 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 15:19:35 +0700 |
| commit | baa7cb664e662cee23cdad92c78d9c14cab2445d (patch) | |
| tree | 7660fbf57cbd0cf9125c13432669320fb85aeba0 /src/pages | |
| parent | 1ba8b0dcea79e4377d359aa5bb73aa54969ae77d (diff) | |
add whatsapp widget and page not found
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/404.jsx | 22 | ||||
| -rw-r--r-- | src/pages/shop/product/[slug].jsx | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/pages/404.jsx b/src/pages/404.jsx new file mode 100644 index 00000000..f73e6383 --- /dev/null +++ b/src/pages/404.jsx @@ -0,0 +1,22 @@ +import Seo from '@/core/components/Seo' +import Link from '@/core/components/elements/Link/Link' +import BasicLayout from '@/core/components/layouts/BasicLayout' +import Image from 'next/image' + +export default function PageNotFound() { + return ( + <BasicLayout> + <Seo title='Halaman tidak ditemukan - Indoteknik.com' /> + <div className='container mx-auto'> + <Image + src='/images/page-not-found.svg' + alt='Page not found - Indoteknik' + className='w-full' + width={1024} + height={512} + /> + <Link href='/' className='btn-yellow text-black mx-auto mt-4'>Kembali ke halaman utama</Link> + </div> + </BasicLayout> + ) +} diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx index ed6c27d5..cdba90c0 100644 --- a/src/pages/shop/product/[slug].jsx +++ b/src/pages/shop/product/[slug].jsx @@ -2,6 +2,7 @@ import Seo from '@/core/components/Seo' import LogoSpinner from '@/core/components/elements/Spinner/LogoSpinner' import { getIdFromSlug } from '@/core/utils/slug' import productApi from '@/lib/product/api/productApi' +import PageNotFound from '@/pages/404' import dynamic from 'next/dynamic' import { useRouter } from 'next/router' @@ -32,6 +33,8 @@ export async function getServerSideProps(context) { export default function ProductDetail({ product }) { const router = useRouter() + if (!product) return <PageNotFound /> + return ( <BasicLayout> <Seo |
