diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/auth/components/CompanyProfile.jsx | 70 | ||||
| -rw-r--r-- | src/lib/auth/components/Menu.jsx | 5 | ||||
| -rw-r--r-- | src/lib/auth/components/PersonalProfile.jsx | 54 | ||||
| -rw-r--r-- | src/lib/home/components/CategoryHome.jsx | 2 | ||||
| -rw-r--r-- | src/lib/home/components/CategoryHomeId.jsx | 2 | ||||
| -rw-r--r-- | src/lib/home/components/HeroBanner.jsx | 19 | ||||
| -rw-r--r-- | src/lib/invoice/components/Invoices.jsx | 6 | ||||
| -rw-r--r-- | src/lib/product/components/Product/ProductDesktop.jsx | 2 | ||||
| -rw-r--r-- | src/lib/product/components/ProductCard.jsx | 8 | ||||
| -rw-r--r-- | src/lib/review/components/CustomerReviews.jsx | 14 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transactions.jsx | 4 |
11 files changed, 98 insertions, 88 deletions
diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx index 13d4a194..ff673953 100644 --- a/src/lib/auth/components/CompanyProfile.jsx +++ b/src/lib/auth/components/CompanyProfile.jsx @@ -60,7 +60,6 @@ const CompanyProfile = () => { } const isUpdated = await odooApi('PUT', `/api/v1/partner/${auth.parentId}`, data) if (isUpdated?.id) { - setIsOpen(false) toast.success('Berhasil mengubah profil', { duration: 1500 }) return } @@ -69,59 +68,58 @@ const CompanyProfile = () => { return ( <> - <button type='button' onClick={toggle} className='p-4 flex items-center text-left'> + <button type='button' onClick={toggle} className='p-4 flex items-center text-left w-full'> <div> <div className='font-semibold mb-2'>Informasi Usaha</div> <div className='text-gray_r-11'> Dibawah ini adalah data usaha yang anda masukkan, periksa kembali data usaha anda. </div> </div> - <div className='ml-2 p-2 bg-gray_r-3 rounded'> + <div className='ml-auto p-2 bg-gray_r-3 rounded'> {!isOpen && <ChevronDownIcon className='w-6' />} {isOpen && <ChevronUpIcon className='w-6' />} </div> </button> {isOpen && ( - <form - className='p-4 border-t border-gray_r-6 flex flex-col gap-y-4' - onSubmit={handleSubmit(onSubmitHandler)} - > - <div> - <label className='block mb-3'>Klasifikasi Jenis Usaha</label> - <Controller - name='industry' - control={control} - render={(props) => <HookFormSelect {...props} options={industries} />} - /> - </div> - <div className='flex flex-wrap'> - <div className='w-full mb-3'>Nama Usaha</div> - <div className='w-3/12 pr-1'> + <form className='p-4 border-t border-gray_r-6' onSubmit={handleSubmit(onSubmitHandler)}> + <div className='grid grid-cols-1 sm:grid-cols-2 gap-4'> + <div> + <label className='block mb-3'>Klasifikasi Jenis Usaha</label> <Controller - name='companyType' + name='industry' control={control} - render={(props) => <HookFormSelect {...props} options={companyTypes} />} + render={(props) => <HookFormSelect {...props} options={industries} />} /> </div> - <div className='w-9/12 pl-1'> - <input - {...register('name')} - type='text' - className='form-input' - placeholder='Cth: Indoteknik Dotcom Gemilang' - /> + <div className='flex flex-wrap'> + <div className='w-full mb-3'>Nama Usaha</div> + <div className='w-3/12 pr-1'> + <Controller + name='companyType' + control={control} + render={(props) => <HookFormSelect {...props} options={companyTypes} />} + /> + </div> + <div className='w-9/12 pl-1'> + <input + {...register('name')} + type='text' + className='form-input' + placeholder='Cth: Indoteknik Dotcom Gemilang' + /> + </div> + </div> + <div> + <label>Nama Wajib Pajak</label> + <input {...register('taxName')} type='text' className='form-input mt-3' /> + </div> + <div> + <label>Nomor NPWP</label> + <input {...register('npwp')} type='text' className='form-input mt-3' /> </div> </div> - <div> - <label>Nama Wajib Pajak</label> - <input {...register('taxName')} type='text' className='form-input mt-3' /> - </div> - <div> - <label>Nomor NPWP</label> - <input {...register('npwp')} type='text' className='form-input mt-3' /> - </div> - <button type='submit' className='btn-yellow w-full mt-2'> + <button type='submit' className='btn-yellow w-full mt-6'> Simpan </button> </form> diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx index 8a8e2e8a..386b817c 100644 --- a/src/lib/auth/components/Menu.jsx +++ b/src/lib/auth/components/Menu.jsx @@ -7,7 +7,7 @@ const Menu = () => { const routeStartWith = (route) => router.pathname.startsWith(route) return ( - <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4'> + <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'> <div className='mt-4 mb-1 font-medium'>Menu</div> <LinkItem href='/my/quotations' active={routeStartWith('/my/quotations')}> Daftar Quotation @@ -29,6 +29,9 @@ const Menu = () => { <LinkItem href='/my/address' active={routeStartWith('/my/address')}> Daftar Alamat </LinkItem> + <LinkItem href='/my/profile' active={routeStartWith('/my/profile')}> + Profil Saya + </LinkItem> <button type='button' className='text-gray_r-12/80 p-2 text-left'> Keluar Akun </button> diff --git a/src/lib/auth/components/PersonalProfile.jsx b/src/lib/auth/components/PersonalProfile.jsx index bca54e24..b9fb3f5f 100644 --- a/src/lib/auth/components/PersonalProfile.jsx +++ b/src/lib/auth/components/PersonalProfile.jsx @@ -38,7 +38,6 @@ const PersonalProfile = () => { if (isUpdated?.user) { setAuth(isUpdated.user) setValue('password', '') - setIsOpen(false) toast.success('Berhasil mengubah profil', { duration: 1500 }) return } @@ -47,46 +46,45 @@ const PersonalProfile = () => { return ( <> - <button type='button' onClick={toggle} className='p-4 flex items-center text-left'> + <button type='button' onClick={toggle} className='p-4 flex items-center text-left w-full'> <div> <div className='font-semibold mb-2'>Informasi Akun</div> <div className='text-gray_r-11'> Dibawah ini adalah data diri yang anda masukan, periksa kembali data diri anda </div> </div> - <div className='ml-2 p-2 bg-gray_r-3 rounded'> + <div className='ml-auto p-2 bg-gray_r-3 rounded'> {!isOpen && <ChevronDownIcon className='w-6' />} {isOpen && <ChevronUpIcon className='w-6' />} </div> </button> {isOpen && ( - <form - className='p-4 border-t border-gray_r-6 flex flex-col gap-y-4' - onSubmit={handleSubmit(onSubmitHandler)} - > - <div> - <label>Email</label> - <input {...register('email')} type='text' disabled className='form-input mt-3' /> + <form className='p-4 border-t border-gray_r-6' onSubmit={handleSubmit(onSubmitHandler)}> + <div className='grid grid-cols-1 sm:grid-cols-2 gap-4'> + <div> + <label>Email</label> + <input {...register('email')} type='text' disabled className='form-input mt-3' /> + </div> + <div> + <label>Nama Lengkap</label> + <input {...register('name')} type='text' className='form-input mt-3' /> + </div> + <div> + <label>No. Handphone</label> + <input {...register('mobile')} type='tel' className='form-input mt-3' /> + </div> + <div> + <label>Kata Sandi</label> + <input + {...register('password')} + type='password' + className='form-input mt-3' + placeholder='Isi jika ingin mengubah kata sandi' + /> + </div> </div> - <div> - <label>Nama Lengkap</label> - <input {...register('name')} type='text' className='form-input mt-3' /> - </div> - <div> - <label>No. Handphone</label> - <input {...register('mobile')} type='tel' className='form-input mt-3' /> - </div> - <div> - <label>Kata Sandi</label> - <input - {...register('password')} - type='password' - className='form-input mt-3' - placeholder='Isi jika ingin mengubah kata sandi' - /> - </div> - <button type='submit' className='btn-yellow w-full mt-2'> + <button type='submit' className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6'> Simpan </button> </form> diff --git a/src/lib/home/components/CategoryHome.jsx b/src/lib/home/components/CategoryHome.jsx index 8fe3788c..4566bc4b 100644 --- a/src/lib/home/components/CategoryHome.jsx +++ b/src/lib/home/components/CategoryHome.jsx @@ -6,7 +6,7 @@ const CategoryHome = ({ id }) => { const { categoryHome } = useCategoryHome({ id }) return ( - <div className='p-4 sm:py-8 relative bg-warning-100 border border-warning-300'> + <div className='p-4 sm:py-8 relative bg-warning-100 border border-warning-300 min-h-[240px]'> {categoryHome.data ? ( <ProductSlider products={{ diff --git a/src/lib/home/components/CategoryHomeId.jsx b/src/lib/home/components/CategoryHomeId.jsx index c37a6af7..4899f216 100644 --- a/src/lib/home/components/CategoryHomeId.jsx +++ b/src/lib/home/components/CategoryHomeId.jsx @@ -6,7 +6,7 @@ const CategoryHomeId = () => { const { categoryHomeIds } = useCategoryHomeId() return ( - <div className='flex flex-col gap-y-6'> + <div className='flex flex-col gap-y-10'> {categoryHomeIds.data?.map((id) => ( <LazyLoadComponent key={id}> <CategoryHome id={id} /> diff --git a/src/lib/home/components/HeroBanner.jsx b/src/lib/home/components/HeroBanner.jsx index 50cfc0ff..889bb2ce 100644 --- a/src/lib/home/components/HeroBanner.jsx +++ b/src/lib/home/components/HeroBanner.jsx @@ -15,22 +15,23 @@ import Link from '@/core/components/elements/Link/Link' const HeroBanner = () => { const { heroBanners } = useHeroBanner() - const swiperBannerMobile = { - pagination: { dynamicBullets: true, clickable: true }, + const swiperBanner = { autoplay: { delay: 6000, disableOnInteraction: false }, - modules: [Pagination, Autoplay] + modules: [Pagination, Autoplay], + loop: true + } + + const swiperBannerMobile = { + ...swiperBanner, + pagination: { dynamicBullets: true, clickable: true } } const swiperBannerDesktop = { - pagination: { dynamicBullets: false, clickable: true }, - autoplay: { - delay: 6000, - disableOnInteraction: false - }, - modules: [Pagination, Autoplay] + ...swiperBanner, + pagination: { dynamicBullets: false, clickable: true } } return ( diff --git a/src/lib/invoice/components/Invoices.jsx b/src/lib/invoice/components/Invoices.jsx index 96686bbb..5edcfdbf 100644 --- a/src/lib/invoice/components/Invoices.jsx +++ b/src/lib/invoice/components/Invoices.jsx @@ -71,7 +71,7 @@ const Invoices = () => { {!invoices.isLoading && invoices.data?.invoices?.length === 0 && ( <Alert type='info' className='text-center'> - Tidak ada data invoice + Tidak ada invoice </Alert> )} @@ -198,7 +198,7 @@ const Invoices = () => { <tbody> {invoices.isLoading && ( <tr> - <td colSpan={5}> + <td colSpan={6}> <div className='flex justify-center my-2'> <Spinner className='w-6 text-gray_r-12/50 fill-gray_r-12' /> </div> @@ -208,7 +208,7 @@ const Invoices = () => { {!invoices.isLoading && (!invoices?.data?.invoices || invoices?.data?.invoices?.length == 0) && ( <tr> - <td colSpan={6}>Tidak ada data invoice</td> + <td colSpan={6}>Tidak ada invoice</td> </tr> )} {invoices.data?.invoices?.map((invoice) => ( diff --git a/src/lib/product/components/Product/ProductDesktop.jsx b/src/lib/product/components/Product/ProductDesktop.jsx index 8ce6da00..75b37b9d 100644 --- a/src/lib/product/components/Product/ProductDesktop.jsx +++ b/src/lib/product/components/Product/ProductDesktop.jsx @@ -106,7 +106,7 @@ const ProductDesktop = ({ product, wishlist, toggleWishlist }) => { <Image src={product.image} alt={product.name} - className='h-96 object-contain object-center w-full border border-gray_r-4' + className='h-[430px] object-contain object-center w-full border border-gray_r-4' /> </div> diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 9a5fe9a2..8b48cf06 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -36,7 +36,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { product?.manufacture?.name, product?.manufacture.id )} - className='mb-1 font-normal' + className='mb-1' > {product.manufacture.name} </Link> @@ -45,7 +45,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} <Link href={createSlug('/shop/product/', product?.name, product?.id)} - className={`font-normal mb-2 !text-gray_r-12 leading-6 block ${ + className={`mb-2 !text-gray_r-12 leading-6 block ${ simpleTitle ? 'line-clamp-2 h-12' : 'line-clamp-3 h-[64px]' }`} title={product?.name} @@ -108,7 +108,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { product?.manufacture?.name, product?.manufacture.id )} - className='mb-1 font-normal' + className='mb-1' > {product.manufacture.name} </Link> @@ -117,7 +117,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} <Link href={createSlug('/shop/product/', product?.name, product?.id)} - className={`font-normal mb-2 !text-gray_r-12 ${ + className={`mb-2 !text-gray_r-12 leading-6 ${ simpleTitle ? 'line-clamp-2' : 'line-clamp-3' }`} > diff --git a/src/lib/review/components/CustomerReviews.jsx b/src/lib/review/components/CustomerReviews.jsx index 935d4a3d..5cc179e9 100644 --- a/src/lib/review/components/CustomerReviews.jsx +++ b/src/lib/review/components/CustomerReviews.jsx @@ -2,6 +2,7 @@ import DesktopView from '@/core/components/views/DesktopView' import MobileView from '@/core/components/views/MobileView' import Image from 'next/image' import { Swiper, SwiperSlide } from 'swiper/react' +import { Autoplay } from 'swiper' const { useQuery } = require('react-query') const { getCustomerReviews } = require('../api/customerReviewsApi') @@ -14,7 +15,7 @@ const CustomerReviews = () => { <div className='font-medium sm:text-h-lg mb-4'>Ulasan Konsumen Kami</div> <DesktopView> - <Swiper slidesPerView={3.2} spaceBetween={16}> + <Swiper slidesPerView={3.2} spaceBetween={16} {...swiperProps}> {customerReviews && customerReviews?.map((customerReview) => ( <SwiperSlide className='pb-4' key={customerReview.id}> @@ -25,7 +26,7 @@ const CustomerReviews = () => { </DesktopView> <MobileView> - <Swiper slidesPerView={1.1} spaceBetween={8}> + <Swiper slidesPerView={1.1} spaceBetween={8} {...swiperProps}> {customerReviews && customerReviews?.map((customerReview) => ( <SwiperSlide className='pb-4' key={customerReview.id}> @@ -38,6 +39,15 @@ const CustomerReviews = () => { ) } +const swiperProps = { + autoplay: { + delay: 6000, + disableOnInteraction: false + }, + loop: true, + modules: [Autoplay] +} + const Card = ({ customerReview }) => ( <div className='bg-gray-200 rounded-md px-5 py-6 shadow-md shadow-gray-500/20 h-full'> <div className='flex items-center space-x-3 mb-4'> diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx index c1c27a51..642881a6 100644 --- a/src/lib/transaction/components/Transactions.jsx +++ b/src/lib/transaction/components/Transactions.jsx @@ -83,7 +83,7 @@ const Transactions = ({ context = '' }) => { {!transactions.isLoading && transactions.data?.saleOrders?.length === 0 && ( <Alert type='info' className='text-center'> - Tidak ada data transaksi + Tidak ada transaksi </Alert> )} @@ -246,7 +246,7 @@ const Transactions = ({ context = '' }) => { (!transactions?.data?.saleOrders || transactions?.data?.saleOrders?.length == 0) && ( <tr> - <td colSpan={7}>Tidak ada data transaksi</td> + <td colSpan={7}>Tidak ada transaksi</td> </tr> )} {transactions.data?.saleOrders?.map((saleOrder) => ( |
