summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-03-29 11:10:53 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-03-29 11:10:53 +0700
commitaa21c215d18d0a80e7f2979f9a18f5af7db02f8c (patch)
tree917ff6ce475701f369af6779a653841d40a359ff /src/pages
parentd700bbb3f841b509d0f664cdf089e656cac4413a (diff)
video page
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/index.jsx26
-rw-r--r--src/pages/video.jsx55
2 files changed, 70 insertions, 11 deletions
diff --git a/src/pages/index.jsx b/src/pages/index.jsx
index c6737037..99f94ee1 100644
--- a/src/pages/index.jsx
+++ b/src/pages/index.jsx
@@ -1,10 +1,10 @@
import dynamic from 'next/dynamic'
-import Seo from '@/core/components/Seo'
import ImageSkeleton from '@/core/components/elements/Skeleton/ImageSkeleton'
import PopularProductSkeleton from '@/lib/home/components/Skeleton/PopularProductSkeleton'
import MobileView from '@/core/components/views/MobileView'
import DesktopView from '@/core/components/views/DesktopView'
import { useRef } from 'react'
+import { NextSeo } from 'next-seo'
const BasicLayout = dynamic(() => import('@/core/components/layouts/BasicLayout'))
@@ -35,19 +35,23 @@ export default function Home() {
return (
<BasicLayout>
- <Seo title='Beranda - Indoteknik' />
+ <NextSeo
+ title='Indoteknik.com: B2B Industrial Supply & Solution'
+ description='Temukan pilihan produk B2B Industri &amp; Alat Teknik untuk Perusahaan, UMKM &amp; Pemerintah dengan lengkap, mudah dan transparan.'
+ canonical={process.env.NEXT_PUBLIC_SELF_HOST}
+ additionalMetaTags={[
+ {
+ property: 'keywords',
+ content:
+ 'indoteknik, indoteknik.com, toko teknik, toko perkakas, jual genset, jual fogging, jual krisbow, harga krisbow, harga alat safety, harga pompa air'
+ }
+ ]}
+ />
<DesktopView>
<div className='container mx-auto'>
- <div
- className='flex h-[360px]'
- ref={wrapperRef}
- onLoad={handleOnLoad}
- >
+ <div className='flex h-[360px]' ref={wrapperRef} onLoad={handleOnLoad}>
<div className='w-3/12'></div>
- <div
- className='w-6/12 px-1'
- ref={bannerRef}
- >
+ <div className='w-6/12 px-1' ref={bannerRef}>
<HeroBanner />
</div>
<div className='w-3/12'>
diff --git a/src/pages/video.jsx b/src/pages/video.jsx
new file mode 100644
index 00000000..c7248da1
--- /dev/null
+++ b/src/pages/video.jsx
@@ -0,0 +1,55 @@
+import Pagination from '@/core/components/elements/Pagination/Pagination'
+import BasicLayout from '@/core/components/layouts/BasicLayout'
+import useVideo from '@/lib/video/hooks/useVideo'
+import { useRouter } from 'next/router'
+
+export default function Video() {
+ const router = useRouter()
+ const limit = 16
+
+ const { page = 1 } = router.query
+ const { video } = useVideo({ limit, offset: limit * (page - 1) })
+
+ const pageCount = Math.ceil(video?.data?.videoTotal / limit)
+
+ return (
+ <BasicLayout>
+ <div className='container mx-auto p-4 md:p-0 my-0 md:my-10'>
+ <h1 className='text-h-sm md:text-title-sm font-semibold mb-6'>Kanal Video Indoteknik</h1>
+ <div className='grid grid-cols-1 md:grid-cols-4 gap-6'>
+ {video.data?.videos?.map((video) => (
+ <div className='shadow bg-white rounded' key={video.id}>
+ <iframe
+ src={`https://www.youtube.com/embed/${video.url.match(/v=([^&]*)/)[1]}`}
+ title='YouTube video player'
+ allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'
+ allowFullScreen={true}
+ width='100%'
+ height={200}
+ className='rounded'
+ />
+ <div className='p-3'>
+ <a
+ href='https://www.youtube.com/@indoteknikb2bindustriale-c778'
+ className='text-red_r-11 mb-2 block'
+ >
+ {video.channelName}
+ </a>
+ <a href={video.url} className='font-medium leading-6'>
+ {video.name}
+ </a>
+ </div>
+ </div>
+ ))}
+ </div>
+
+ <Pagination
+ currentPage={parseInt(page)}
+ pageCount={pageCount}
+ url={`/video`}
+ className='mt-10'
+ />
+ </div>
+ </BasicLayout>
+ )
+}