From 72329fb20c3bc7703590b85bd0c42ea32e7cfe61 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 29 Mar 2023 17:02:57 +0700 Subject: SEO --- src/pages/shop/brands/[slug].jsx | 15 +++++++++++++++ src/pages/shop/brands/index.jsx | 3 +++ src/pages/shop/cart.jsx | 3 +++ src/pages/shop/checkout/[status].jsx | 15 ++++++++++----- src/pages/shop/checkout/index.jsx | 29 +++++++++++++++++------------ src/pages/shop/product/[slug].jsx | 18 +++++++++++++++++- src/pages/shop/quotation/finish.jsx | 5 +++++ src/pages/shop/quotation/index.jsx | 29 +++++++++++++++++------------ src/pages/shop/search.jsx | 3 +++ 9 files changed, 90 insertions(+), 30 deletions(-) (limited to 'src/pages/shop') diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx index 33f81fa2..9c5193ad 100644 --- a/src/pages/shop/brands/[slug].jsx +++ b/src/pages/shop/brands/[slug].jsx @@ -2,6 +2,7 @@ import dynamic from 'next/dynamic' import { getIdFromSlug, getNameFromSlug } from '@/core/utils/slug' import { useRouter } from 'next/router' import _ from 'lodash' +import Seo from '@/core/components/Seo' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch')) @@ -10,8 +11,22 @@ const Brand = dynamic(() => import('@/lib/brand/components/Brand')) export default function BrandDetail() { const router = useRouter() const { slug = '' } = router.query + + const brandName = getNameFromSlug(slug) return ( + + {!_.isEmpty(router.query) && ( + + diff --git a/src/pages/shop/cart.jsx b/src/pages/shop/cart.jsx index 9566cfcb..e574f14d 100644 --- a/src/pages/shop/cart.jsx +++ b/src/pages/shop/cart.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' import MobileView from '@/core/components/views/MobileView' @@ -9,6 +10,8 @@ const CartComponent = dynamic(() => import('@/lib/cart/components/Cart')) export default function Cart() { return ( <> + + diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx index bf184c0e..7c39718c 100644 --- a/src/pages/shop/checkout/[status].jsx +++ b/src/pages/shop/checkout/[status].jsx @@ -3,6 +3,7 @@ import IsAuth from '@/lib/auth/components/IsAuth' import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout' import { useRouter } from 'next/router' import axios from 'axios' +import Seo from '@/core/components/Seo' export async function getServerSideProps(context) { const { order_id } = context.query @@ -18,10 +19,14 @@ 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 30d2c730..13fc7056 100644 --- a/src/pages/shop/checkout/index.jsx +++ b/src/pages/shop/checkout/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -7,18 +8,22 @@ import CheckoutComponent from '@/lib/checkout/components/Checkout' export default function Checkout() { return ( - - - - - - + <> + - - - - - - + + + + + + + + + + + + + + ) } diff --git a/src/pages/shop/product/[slug].jsx b/src/pages/shop/product/[slug].jsx index e8084cbe..84b848f0 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 { getIdFromSlug } from '@/core/utils/slug' import productApi from '@/lib/product/api/productApi' import dynamic from 'next/dynamic' +import { useRouter } from 'next/router' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const Product = dynamic(() => import('@/lib/product/components/Product/Product')) @@ -23,9 +24,24 @@ export async function getServerSideProps(context) { } export default function ProductDetail({ product }) { + const router = useRouter() return ( - + ) diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx index 32638b62..52e03cf6 100644 --- a/src/pages/shop/quotation/finish.jsx +++ b/src/pages/shop/quotation/finish.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import Link from '@/core/components/elements/Link/Link' import BasicLayout from '@/core/components/layouts/BasicLayout' import useAuth from '@/core/hooks/useAuth' @@ -10,6 +11,9 @@ export default function FinishQuotation() { const router = useRouter() const { id } = router.query return ( + <> + +
@@ -39,5 +43,6 @@ export default function FinishQuotation() {
+ ) } diff --git a/src/pages/shop/quotation/index.jsx b/src/pages/shop/quotation/index.jsx index efb35db9..bd086b72 100644 --- a/src/pages/shop/quotation/index.jsx +++ b/src/pages/shop/quotation/index.jsx @@ -1,3 +1,4 @@ +import Seo from '@/core/components/Seo' import AppLayout from '@/core/components/layouts/AppLayout' import BasicLayout from '@/core/components/layouts/BasicLayout' import DesktopView from '@/core/components/views/DesktopView' @@ -7,18 +8,22 @@ import QuotationComponent from '@/lib/quotation/components/Quotation' export default function Quotation() { return ( - - - - - - + <> + - - - - - - + + + + + + + + + + + + + + ) } diff --git a/src/pages/shop/search.jsx b/src/pages/shop/search.jsx index 345b715a..d21d72cd 100644 --- a/src/pages/shop/search.jsx +++ b/src/pages/shop/search.jsx @@ -1,6 +1,7 @@ import dynamic from 'next/dynamic' import { useRouter } from 'next/router' import _ from 'lodash-contrib' +import Seo from '@/core/components/Seo' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const ProductSearch = dynamic(() => import('@/lib/product/components/ProductSearch')) @@ -10,6 +11,8 @@ export default function Search() { return ( + + {!_.isEmpty(router.query) && (