summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-04-11 09:47:25 +0700
commit92c2a229d9c9b510d71b928978872a8b107e9d5a (patch)
tree8d8161a49a0bdc46d4c28d3f2682bb485314a41d /src/pages
parent62bebc1d33fd090d7666e18e7a0326ef7ef36897 (diff)
Documentation and refactor code
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/forgot-password.jsx6
-rw-r--r--src/pages/my/menu.jsx20
-rw-r--r--src/pages/shop/brands/[slug].jsx5
-rw-r--r--src/pages/shop/checkout/[status].jsx2
-rw-r--r--src/pages/shop/quotation/finish.jsx58
-rw-r--r--src/pages/shop/search.jsx7
-rw-r--r--src/pages/sitemap/products/[id].xml.js2
7 files changed, 43 insertions, 57 deletions
diff --git a/src/pages/forgot-password.jsx b/src/pages/forgot-password.jsx
index 6211d237..23239363 100644
--- a/src/pages/forgot-password.jsx
+++ b/src/pages/forgot-password.jsx
@@ -91,7 +91,11 @@ const FormComponent = () => {
placeholder='Masukan alamat email'
autoFocus
/>
- <button type='submit' disabled={!email || isLoading} className='btn-yellow font-semibold mt-4 w-full'>
+ <button
+ type='submit'
+ disabled={!email || isLoading}
+ className='btn-yellow font-semibold mt-4 w-full'
+ >
{isLoading ? 'Loading...' : 'Kirim Permintaan'}
</button>
</form>
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index 851bcf56..e7ae27fd 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -19,10 +19,7 @@ export default function Menu() {
return (
<IsAuth>
<AppLayout title='Menu Utama'>
- <Link
- href='/my/profile'
- className='p-4 flex items-center'
- >
+ <Link href='/my/profile' className='p-4 flex items-center'>
<div className='rounded-full p-3 bg-gray_r-6 text-gray_r-12/80'>
<UserIcon className='w-5' />
</div>
@@ -64,10 +61,7 @@ export default function Menu() {
<LinkItem href='/my/address'>Daftar Alamat</LinkItem>
</div>
- <div
- onClick={logout}
- className='p-4 mt-2'
- >
+ <div onClick={logout} className='p-4 mt-2'>
<button className='w-full btn-red'>Keluar Akun</button>
</div>
</div>
@@ -78,19 +72,13 @@ export default function Menu() {
}
const MenuHeader = ({ children, ...props }) => (
- <div
- {...props}
- className='font-medium px-4 flex'
- >
+ <div {...props} className='font-medium px-4 flex'>
{children}
</div>
)
const LinkItem = ({ children, ...props }) => (
- <Link
- {...props}
- className='!text-gray_r-12/70 !font-normal p-4 flex items-center'
- >
+ <Link {...props} className='!text-gray_r-12/70 !font-normal p-4 flex items-center'>
{children}
<div className='ml-auto !text-gray_r-11'>
<ChevronRightIcon className='w-5' />
diff --git a/src/pages/shop/brands/[slug].jsx b/src/pages/shop/brands/[slug].jsx
index 9c5193ad..88f19bc0 100644
--- a/src/pages/shop/brands/[slug].jsx
+++ b/src/pages/shop/brands/[slug].jsx
@@ -11,7 +11,7 @@ const Brand = dynamic(() => import('@/lib/brand/components/Brand'))
export default function BrandDetail() {
const router = useRouter()
const { slug = '' } = router.query
-
+
const brandName = getNameFromSlug(slug)
return (
<BasicLayout>
@@ -21,8 +21,7 @@ export default function BrandDetail() {
additionalMetaTags={[
{
property: 'keywords',
- content:
- `Jual ${brandName}, beli ${brandName}, Distributor ${brandName} Indonesia, cari ${brandName}, produk ${brandName}, ${brandName} Indonesia, harga ${brandName}`
+ content: `Jual ${brandName}, beli ${brandName}, Distributor ${brandName} Indonesia, cari ${brandName}, produk ${brandName}, ${brandName} Indonesia, harga ${brandName}`
}
]}
/>
diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx
index 7c39718c..2c3bebcf 100644
--- a/src/pages/shop/checkout/[status].jsx
+++ b/src/pages/shop/checkout/[status].jsx
@@ -21,7 +21,7 @@ export default function Finish() {
return (
<>
<Seo title='Checkout Indoteknik.com' />
-
+
<IsAuth>
<BasicLayout>
<FinishCheckoutComponent query={router.query || {}} />
diff --git a/src/pages/shop/quotation/finish.jsx b/src/pages/shop/quotation/finish.jsx
index f6c0ac6b..0e9c5672 100644
--- a/src/pages/shop/quotation/finish.jsx
+++ b/src/pages/shop/quotation/finish.jsx
@@ -12,37 +12,37 @@ export default function FinishQuotation() {
const { id } = router.query
return (
<>
- <Seo title='Quotation Indoteknik.com' />
-
- <IsAuth>
- <BasicLayout>
- <div className='mx-auto container'>
- <div className='m-4 md:m-0 md:mt-10 px-4 py-6 shadow-md border border-gray_r-3'>
- <div className='flex'>
- <span className='p-3 mx-auto bg-warning-100 border border-warning-300 rounded'>
- <EnvelopeIcon className='w-8 text-warning-800' />
- </span>
- </div>
- <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p>
- <p className='text-center mt-3 leading-6 text-gray_r-11'>
- Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera
- menghubungi anda.
- </p>
- {id && (
- <Link
- href={`/my/transaction/${id}`}
- className='btn-yellow !text-gray_r-12 mt-6 w-full md:w-1/3 md:mx-auto'
- >
- Lihat Penawaran
+ <Seo title='Quotation Indoteknik.com' />
+
+ <IsAuth>
+ <BasicLayout>
+ <div className='mx-auto container'>
+ <div className='m-4 md:m-0 md:mt-10 px-4 py-6 shadow-md border border-gray_r-3'>
+ <div className='flex'>
+ <span className='p-3 mx-auto bg-warning-100 border border-warning-300 rounded'>
+ <EnvelopeIcon className='w-8 text-warning-800' />
+ </span>
+ </div>
+ <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p>
+ <p className='text-center mt-3 leading-6 text-gray_r-11'>
+ Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera
+ menghubungi anda.
+ </p>
+ {id && (
+ <Link
+ href={`/my/transaction/${id}`}
+ className='btn-yellow !text-gray_r-12 mt-6 w-full md:w-1/3 md:mx-auto'
+ >
+ Lihat Penawaran
+ </Link>
+ )}
+ <Link href='/' className='btn-light !text-gray_r-12 mt-2 w-full md:w-1/3 md:mx-auto'>
+ Ke Halaman Utama
</Link>
- )}
- <Link href='/' className='btn-light !text-gray_r-12 mt-2 w-full md:w-1/3 md:mx-auto'>
- Ke Halaman Utama
- </Link>
+ </div>
</div>
- </div>
- </BasicLayout>
- </IsAuth>
+ </BasicLayout>
+ </IsAuth>
</>
)
}
diff --git a/src/pages/shop/search.jsx b/src/pages/shop/search.jsx
index bf38d0bc..907465b7 100644
--- a/src/pages/shop/search.jsx
+++ b/src/pages/shop/search.jsx
@@ -13,12 +13,7 @@ export default function Search() {
<BasicLayout>
<Seo title={`Cari produk ${router.query.q || ''} di Indoteknik.com`} />
- {!_.isEmpty(router.query) && (
- <ProductSearch
- query={router.query}
- prefixUrl='/shop/search'
- />
- )}
+ {!_.isEmpty(router.query) && <ProductSearch query={router.query} prefixUrl='/shop/search' />}
</BasicLayout>
)
}
diff --git a/src/pages/sitemap/products/[id].xml.js b/src/pages/sitemap/products/[id].xml.js
index e9caaa00..98c2bf40 100644
--- a/src/pages/sitemap/products/[id].xml.js
+++ b/src/pages/sitemap/products/[id].xml.js
@@ -8,7 +8,7 @@ export async function getServerSideProps({ res }) {
const limit = 2500
const query = { limit }
const products = await productSearchApi({ query: _.toQuery(query) })
- console.log(products);
+ console.log(products)
// const sitemap = create('urlset', { encoding: 'UTF-8' })
// const date = new Date()