diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-09 11:35:14 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-10-09 11:35:14 +0700 |
| commit | 07601d9d59b70cd1f200a9a6ebf1d01801990960 (patch) | |
| tree | 9290c2f754238eff3758ac0c474a87487773f35e | |
| parent | ec2bbfeaa09d6fb01bbe4ad97cc978b5a68500ff (diff) | |
| parent | dc6d6df514375c7002686e31e6270f828b5a0ccf (diff) | |
Merge branch 'master' into CR/Pricelist
# Conflicts:
# src/pages/shop/product/variant/[slug].jsx
46 files changed, 252 insertions, 20 deletions
diff --git a/public/fonts/Inter/Inter-Black.woff b/public/fonts/Inter/Inter-Black.woff Binary files differnew file mode 100644 index 00000000..a18593a0 --- /dev/null +++ b/public/fonts/Inter/Inter-Black.woff diff --git a/public/fonts/Inter/Inter-Black.woff2 b/public/fonts/Inter/Inter-Black.woff2 Binary files differnew file mode 100644 index 00000000..68f64c9e --- /dev/null +++ b/public/fonts/Inter/Inter-Black.woff2 diff --git a/public/fonts/Inter/Inter-BlackItalic.woff b/public/fonts/Inter/Inter-BlackItalic.woff Binary files differnew file mode 100644 index 00000000..b6b01943 --- /dev/null +++ b/public/fonts/Inter/Inter-BlackItalic.woff diff --git a/public/fonts/Inter/Inter-BlackItalic.woff2 b/public/fonts/Inter/Inter-BlackItalic.woff2 Binary files differnew file mode 100644 index 00000000..1c9c7ca8 --- /dev/null +++ b/public/fonts/Inter/Inter-BlackItalic.woff2 diff --git a/public/fonts/Inter/Inter-Bold.woff b/public/fonts/Inter/Inter-Bold.woff Binary files differnew file mode 100644 index 00000000..eaf3d4bf --- /dev/null +++ b/public/fonts/Inter/Inter-Bold.woff diff --git a/public/fonts/Inter/Inter-Bold.woff2 b/public/fonts/Inter/Inter-Bold.woff2 Binary files differnew file mode 100644 index 00000000..2846f29c --- /dev/null +++ b/public/fonts/Inter/Inter-Bold.woff2 diff --git a/public/fonts/Inter/Inter-BoldItalic.woff b/public/fonts/Inter/Inter-BoldItalic.woff Binary files differnew file mode 100644 index 00000000..32750761 --- /dev/null +++ b/public/fonts/Inter/Inter-BoldItalic.woff diff --git a/public/fonts/Inter/Inter-BoldItalic.woff2 b/public/fonts/Inter/Inter-BoldItalic.woff2 Binary files differnew file mode 100644 index 00000000..0b1fe8e1 --- /dev/null +++ b/public/fonts/Inter/Inter-BoldItalic.woff2 diff --git a/public/fonts/Inter/Inter-ExtraBold.woff b/public/fonts/Inter/Inter-ExtraBold.woff Binary files differnew file mode 100644 index 00000000..c2c17ede --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraBold.woff diff --git a/public/fonts/Inter/Inter-ExtraBold.woff2 b/public/fonts/Inter/Inter-ExtraBold.woff2 Binary files differnew file mode 100644 index 00000000..c24c2bdc --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraBold.woff2 diff --git a/public/fonts/Inter/Inter-ExtraBoldItalic.woff b/public/fonts/Inter/Inter-ExtraBoldItalic.woff Binary files differnew file mode 100644 index 00000000..c42f7052 --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraBoldItalic.woff diff --git a/public/fonts/Inter/Inter-ExtraBoldItalic.woff2 b/public/fonts/Inter/Inter-ExtraBoldItalic.woff2 Binary files differnew file mode 100644 index 00000000..4a81dc79 --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraBoldItalic.woff2 diff --git a/public/fonts/Inter/Inter-ExtraLight.woff b/public/fonts/Inter/Inter-ExtraLight.woff Binary files differnew file mode 100644 index 00000000..d0de5f39 --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraLight.woff diff --git a/public/fonts/Inter/Inter-ExtraLight.woff2 b/public/fonts/Inter/Inter-ExtraLight.woff2 Binary files differnew file mode 100644 index 00000000..f2ea706f --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraLight.woff2 diff --git a/public/fonts/Inter/Inter-ExtraLightItalic.woff b/public/fonts/Inter/Inter-ExtraLightItalic.woff Binary files differnew file mode 100644 index 00000000..81f1a28e --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraLightItalic.woff diff --git a/public/fonts/Inter/Inter-ExtraLightItalic.woff2 b/public/fonts/Inter/Inter-ExtraLightItalic.woff2 Binary files differnew file mode 100644 index 00000000..9af717ba --- /dev/null +++ b/public/fonts/Inter/Inter-ExtraLightItalic.woff2 diff --git a/public/fonts/Inter/Inter-Italic.woff b/public/fonts/Inter/Inter-Italic.woff Binary files differnew file mode 100644 index 00000000..a806b382 --- /dev/null +++ b/public/fonts/Inter/Inter-Italic.woff diff --git a/public/fonts/Inter/Inter-Italic.woff2 b/public/fonts/Inter/Inter-Italic.woff2 Binary files differnew file mode 100644 index 00000000..a619fc54 --- /dev/null +++ b/public/fonts/Inter/Inter-Italic.woff2 diff --git a/public/fonts/Inter/Inter-Light.woff b/public/fonts/Inter/Inter-Light.woff Binary files differnew file mode 100644 index 00000000..c496464d --- /dev/null +++ b/public/fonts/Inter/Inter-Light.woff diff --git a/public/fonts/Inter/Inter-Light.woff2 b/public/fonts/Inter/Inter-Light.woff2 Binary files differnew file mode 100644 index 00000000..bc4be665 --- /dev/null +++ b/public/fonts/Inter/Inter-Light.woff2 diff --git a/public/fonts/Inter/Inter-LightItalic.woff b/public/fonts/Inter/Inter-LightItalic.woff Binary files differnew file mode 100644 index 00000000..f84a9de3 --- /dev/null +++ b/public/fonts/Inter/Inter-LightItalic.woff diff --git a/public/fonts/Inter/Inter-LightItalic.woff2 b/public/fonts/Inter/Inter-LightItalic.woff2 Binary files differnew file mode 100644 index 00000000..842b2dfc --- /dev/null +++ b/public/fonts/Inter/Inter-LightItalic.woff2 diff --git a/public/fonts/Inter/Inter-Medium.woff b/public/fonts/Inter/Inter-Medium.woff Binary files differnew file mode 100644 index 00000000..d546843f --- /dev/null +++ b/public/fonts/Inter/Inter-Medium.woff diff --git a/public/fonts/Inter/Inter-Medium.woff2 b/public/fonts/Inter/Inter-Medium.woff2 Binary files differnew file mode 100644 index 00000000..f92498a2 --- /dev/null +++ b/public/fonts/Inter/Inter-Medium.woff2 diff --git a/public/fonts/Inter/Inter-MediumItalic.woff b/public/fonts/Inter/Inter-MediumItalic.woff Binary files differnew file mode 100644 index 00000000..459a6568 --- /dev/null +++ b/public/fonts/Inter/Inter-MediumItalic.woff diff --git a/public/fonts/Inter/Inter-MediumItalic.woff2 b/public/fonts/Inter/Inter-MediumItalic.woff2 Binary files differnew file mode 100644 index 00000000..0e3019f4 --- /dev/null +++ b/public/fonts/Inter/Inter-MediumItalic.woff2 diff --git a/public/fonts/Inter/Inter-Regular.woff b/public/fonts/Inter/Inter-Regular.woff Binary files differnew file mode 100644 index 00000000..62d3a618 --- /dev/null +++ b/public/fonts/Inter/Inter-Regular.woff diff --git a/public/fonts/Inter/Inter-Regular.woff2 b/public/fonts/Inter/Inter-Regular.woff2 Binary files differnew file mode 100644 index 00000000..6c2b6893 --- /dev/null +++ b/public/fonts/Inter/Inter-Regular.woff2 diff --git a/public/fonts/Inter/Inter-SemiBold.woff b/public/fonts/Inter/Inter-SemiBold.woff Binary files differnew file mode 100644 index 00000000..a815f43a --- /dev/null +++ b/public/fonts/Inter/Inter-SemiBold.woff diff --git a/public/fonts/Inter/Inter-SemiBold.woff2 b/public/fonts/Inter/Inter-SemiBold.woff2 Binary files differnew file mode 100644 index 00000000..611e90c9 --- /dev/null +++ b/public/fonts/Inter/Inter-SemiBold.woff2 diff --git a/public/fonts/Inter/Inter-SemiBoldItalic.woff b/public/fonts/Inter/Inter-SemiBoldItalic.woff Binary files differnew file mode 100644 index 00000000..909e43a9 --- /dev/null +++ b/public/fonts/Inter/Inter-SemiBoldItalic.woff diff --git a/public/fonts/Inter/Inter-SemiBoldItalic.woff2 b/public/fonts/Inter/Inter-SemiBoldItalic.woff2 Binary files differnew file mode 100644 index 00000000..545685bd --- /dev/null +++ b/public/fonts/Inter/Inter-SemiBoldItalic.woff2 diff --git a/public/fonts/Inter/Inter-Thin.woff b/public/fonts/Inter/Inter-Thin.woff Binary files differnew file mode 100644 index 00000000..62bc58cd --- /dev/null +++ b/public/fonts/Inter/Inter-Thin.woff diff --git a/public/fonts/Inter/Inter-Thin.woff2 b/public/fonts/Inter/Inter-Thin.woff2 Binary files differnew file mode 100644 index 00000000..abbc3a5c --- /dev/null +++ b/public/fonts/Inter/Inter-Thin.woff2 diff --git a/public/fonts/Inter/Inter-ThinItalic.woff b/public/fonts/Inter/Inter-ThinItalic.woff Binary files differnew file mode 100644 index 00000000..700a7f06 --- /dev/null +++ b/public/fonts/Inter/Inter-ThinItalic.woff diff --git a/public/fonts/Inter/Inter-ThinItalic.woff2 b/public/fonts/Inter/Inter-ThinItalic.woff2 Binary files differnew file mode 100644 index 00000000..ab0b2002 --- /dev/null +++ b/public/fonts/Inter/Inter-ThinItalic.woff2 diff --git a/public/fonts/Inter/Inter-italic.var.woff2 b/public/fonts/Inter/Inter-italic.var.woff2 Binary files differnew file mode 100644 index 00000000..b826d5af --- /dev/null +++ b/public/fonts/Inter/Inter-italic.var.woff2 diff --git a/public/fonts/Inter/Inter-roman.var.woff2 b/public/fonts/Inter/Inter-roman.var.woff2 Binary files differnew file mode 100644 index 00000000..6a256a06 --- /dev/null +++ b/public/fonts/Inter/Inter-roman.var.woff2 diff --git a/public/fonts/Inter/Inter.var.woff2 b/public/fonts/Inter/Inter.var.woff2 Binary files differnew file mode 100644 index 00000000..365eedc5 --- /dev/null +++ b/public/fonts/Inter/Inter.var.woff2 diff --git a/public/fonts/Inter/inter.css b/public/fonts/Inter/inter.css new file mode 100644 index 00000000..de6ce273 --- /dev/null +++ b/public/fonts/Inter/inter.css @@ -0,0 +1,199 @@ +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 100; + font-display: swap; + src: url('Inter-Thin.woff2?v=3.19') format('woff2'), + url('Inter-Thin.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 100; + font-display: swap; + src: url('Inter-ThinItalic.woff2?v=3.19') format('woff2'), + url('Inter-ThinItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 200; + font-display: swap; + src: url('Inter-ExtraLight.woff2?v=3.19') format('woff2'), + url('Inter-ExtraLight.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 200; + font-display: swap; + src: url('Inter-ExtraLightItalic.woff2?v=3.19') format('woff2'), + url('Inter-ExtraLightItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 300; + font-display: swap; + src: url('Inter-Light.woff2?v=3.19') format('woff2'), + url('Inter-Light.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 300; + font-display: swap; + src: url('Inter-LightItalic.woff2?v=3.19') format('woff2'), + url('Inter-LightItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('Inter-Regular.woff2?v=3.19') format('woff2'), + url('Inter-Regular.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url('Inter-Italic.woff2?v=3.19') format('woff2'), + url('Inter-Italic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url('Inter-Medium.woff2?v=3.19') format('woff2'), + url('Inter-Medium.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url('Inter-MediumItalic.woff2?v=3.19') format('woff2'), + url('Inter-MediumItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('Inter-SemiBold.woff2?v=3.19') format('woff2'), + url('Inter-SemiBold.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url('Inter-SemiBoldItalic.woff2?v=3.19') format('woff2'), + url('Inter-SemiBoldItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url('Inter-Bold.woff2?v=3.19') format('woff2'), + url('Inter-Bold.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url('Inter-BoldItalic.woff2?v=3.19') format('woff2'), + url('Inter-BoldItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 800; + font-display: swap; + src: url('Inter-ExtraBold.woff2?v=3.19') format('woff2'), + url('Inter-ExtraBold.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 800; + font-display: swap; + src: url('Inter-ExtraBoldItalic.woff2?v=3.19') format('woff2'), + url('Inter-ExtraBoldItalic.woff?v=3.19') format('woff'); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 900; + font-display: swap; + src: url('Inter-Black.woff2?v=3.19') format('woff2'), + url('Inter-Black.woff?v=3.19') format('woff'); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 900; + font-display: swap; + src: url('Inter-BlackItalic.woff2?v=3.19') format('woff2'), + url('Inter-BlackItalic.woff?v=3.19') format('woff'); +} + +/* ------------------------------------------------------- +Variable font. +Usage: + + html { font-family: 'Inter', sans-serif; } + @supports (font-variation-settings: normal) { + html { font-family: 'Inter var', sans-serif; } + } +*/ +@font-face { + font-family: 'Inter var'; + font-weight: 100 900; + font-display: swap; + font-style: normal; + font-named-instance: 'Regular'; + src: url('Inter-roman.var.woff2?v=3.19') format('woff2'); +} +@font-face { + font-family: 'Inter var'; + font-weight: 100 900; + font-display: swap; + font-style: italic; + font-named-instance: 'Italic'; + src: url('Inter-italic.var.woff2?v=3.19') format('woff2'); +} + +/* -------------------------------------------------------------------------- +[EXPERIMENTAL] Multi-axis, single variable font. + +Slant axis is not yet widely supported (as of February 2019) and thus this +multi-axis single variable font is opt-in rather than the default. + +When using this, you will probably need to set font-variation-settings +explicitly, e.g. + + * { font-variation-settings: "slnt" 0deg } + .italic { font-variation-settings: "slnt" 10deg } + +*/ +@font-face { + font-family: 'Inter var experimental'; + font-weight: 100 900; + font-display: swap; + font-style: oblique 0deg 10deg; + src: url('Inter.var.woff2?v=3.19') format('woff2'); +} diff --git a/src/core/components/layouts/BasicLayout.jsx b/src/core/components/layouts/BasicLayout.jsx index e6bd4de0..9441dbd7 100644 --- a/src/core/components/layouts/BasicLayout.jsx +++ b/src/core/components/layouts/BasicLayout.jsx @@ -24,13 +24,12 @@ const BasicLayout = ({ children }) => { const router = useRouter() const { product } = useProductContext() - useEffect(() => { - if (router.pathname === '/shop/product/[slug]') { + if (router.pathname === '/shop/product/[slug]' || router.pathname === '/shop/product/variant/[slug]') { setPayloadWa({ name: product?.name, manufacture: product?.manufacture.name, - url: createSlug('/shop/product/', product?.name, product?.id, true) + url: process.env.NEXT_PUBLIC_SELF_HOST + router.asPath }) setTemplateWA('product') diff --git a/src/pages/_document.jsx b/src/pages/_document.jsx index 5f3d2367..6cd99b08 100644 --- a/src/pages/_document.jsx +++ b/src/pages/_document.jsx @@ -5,7 +5,7 @@ export default function MyDocument() { const env = process.env.NODE_ENV return ( - <Html> + <Html style={{ fontFamily: `'Inter', sans-serif` }}> <Head> <link rel='icon' href='/favicon.ico' /> <link rel='manifest' href='/manifest.json' /> @@ -19,6 +19,7 @@ export default function MyDocument() { <meta name='theme-color' content='#fff' /> <link rel='prefetch' href='/images/logo-indoteknik-gear.png' /> + <link rel='preload' href='/fonts/Inter/inter.css' as='style' /> <meta name='facebook-domain-verification' content='328wmjs7hcnz74rwsqzxvq50rmbtm2' /> <Script @@ -77,7 +78,7 @@ export default function MyDocument() { strategy='beforeInteractive' src='https://www.googletagmanager.com/gtag/js?id=AW-954540379' /> - + <Script id='google-ads' strategy='afterInteractive' diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js index eeda4347..d6309090 100644 --- a/src/pages/google_merchant/products/[page].js +++ b/src/pages/google_merchant/products/[page].js @@ -47,6 +47,13 @@ export async function getServerSideProps({ res, query }) { 'g:brand': { '#text': product.manufacture?.name || '' }, 'g:price': { '#text': `${Math.round(product.lowestPrice.price * 1.11)} IDR` } } + + if (product.stockTotal == 0) { + item['g:custom_label_0'] = { '#text': 'Stok Tidak Tersedia' } + } else { + item['g:custom_label_1'] = { '#text': 'Stok Tersedia' } + } + if (product.lowestPrice.discountPercentage > 0) { item['g:sale_price'] = { '#text': `${Math.round(product.lowestPrice.priceDiscount * 1.11)} IDR` diff --git a/src/pages/shop/product/variant/[slug].jsx b/src/pages/shop/product/variant/[slug].jsx index d0790249..455b248b 100644 --- a/src/pages/shop/product/variant/[slug].jsx +++ b/src/pages/shop/product/variant/[slug].jsx @@ -7,6 +7,8 @@ import { useRouter } from 'next/router' import cookie from 'cookie' import variantApi from '@/lib/product/api/variantApi' import axios from 'axios' +import { useProductContext } from '@/contexts/ProductContext' +import { useEffect } from 'react' const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout')) const Product = dynamic(() => import('@/lib/product/components/Product/Product')) @@ -46,6 +48,14 @@ export async function getServerSideProps(context) { export default function ProductDetail({ product }) { const router = useRouter() + const { setProduct } = useProductContext() + + useEffect(() => { + if (product) { + setProduct(product) + } + }, [product, setProduct]) + if (!product) return <PageNotFound /> return ( diff --git a/src/styles/globals.css b/src/styles/globals.css index 06ae7ca2..e3e0e48e 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -1,5 +1,3 @@ -@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap'); - @tailwind base; @tailwind components; @tailwind utilities; @@ -14,7 +12,8 @@ body { text-body-2 text-gray_r-12 bg-gray_r-1 - overflow-x-clip; + overflow-x-clip + antialiased; } #__next main { @@ -114,8 +113,8 @@ button { focus:border-danger-500; } - .form-input[type=file] { - @apply py-2 + .form-input[type='file'] { + @apply py-2; } .btn-yellow, @@ -401,7 +400,7 @@ button { w-full; } -.table-specification > table > thead > tr > th:last-child{ +.table-specification > table > thead > tr > th:last-child { @apply w-3/12; } @@ -463,7 +462,7 @@ button { .table-data { @apply w-full table-auto - border-collapse;; + border-collapse; } .table-data thead tr { @@ -632,12 +631,29 @@ button { } @keyframes shake { - 0% { transform: translateX(0); } - 10%, 90% { transform: translateX(-10px); } - 20%, 80% { transform: translateX(10px); } - 30%, 50%, 70% { transform: translateX(-10px); } - 40%, 60% { transform: translateX(10px); } - 100% { transform: translateX(0); } + 0% { + transform: translateX(0); + } + 10%, + 90% { + transform: translateX(-10px); + } + 20%, + 80% { + transform: translateX(10px); + } + 30%, + 50%, + 70% { + transform: translateX(-10px); + } + 40%, + 60% { + transform: translateX(10px); + } + 100% { + transform: translateX(0); + } } .blink-color-flash-sale { @@ -656,4 +672,4 @@ button { to { @apply text-warning-500; } -}
\ No newline at end of file +} diff --git a/tailwind.config.js b/tailwind.config.js index 86e1e769..9b180a90 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -15,7 +15,7 @@ module.exports = { } }, container: { - padding: '4rem', + padding: '1rem', screens: { xl: '1288px' } |
