diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-02 13:30:21 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-02 13:30:21 +0700 |
| commit | 40c6631086d5bf632fb31427e8adf87de60282d3 (patch) | |
| tree | 3a81dd3dd7ea6d3acd927ed2c5371feedcbbce60 /src/lib/pengajuan-tempo/component/Stepper.jsx | |
| parent | 0c48c602edb0ffb33e6259a774a2aad0fff75713 (diff) | |
<iman> update mobile
Diffstat (limited to 'src/lib/pengajuan-tempo/component/Stepper.jsx')
| -rw-r--r-- | src/lib/pengajuan-tempo/component/Stepper.jsx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/lib/pengajuan-tempo/component/Stepper.jsx b/src/lib/pengajuan-tempo/component/Stepper.jsx index e9b49e12..23c27e5a 100644 --- a/src/lib/pengajuan-tempo/component/Stepper.jsx +++ b/src/lib/pengajuan-tempo/component/Stepper.jsx @@ -1,6 +1,7 @@ import React from 'react'; - +import useDevice from '@/core/hooks/useDevice'; const Stepper = ({ currentStep, numberOfSteps }) => { + const { isDesktop, isMobile } = useDevice(); const stepLabels = [ 'Informasi Perusahaan', 'Kontak Person', @@ -20,7 +21,11 @@ const Stepper = ({ currentStep, numberOfSteps }) => { {Array.from({ length: numberOfSteps }).map((_, index) => ( <React.Fragment key={index}> {isFirstStep(index) ? null : ( - <div className={`w-48 h-[0.8px] ${activeColor(index)}`}></div> + <div + className={`${isMobile ? 'w-12' : 'w-48'} h-[0.8px] ${activeColor( + index + )}`} + ></div> )} <div className={`w-6 h-6 ${ @@ -30,10 +35,20 @@ const Stepper = ({ currentStep, numberOfSteps }) => { } rounded-full flex justify-center items-center`} > <div className='relative text-xs'> - <div className='absolute z-10 -top-14 w-48 h-full -left-24'> + <div + className={`absolute z-10 ${ + isMobile + ? `w-12 h-full top-4 ${ + isFinalStep(index) ? '-left-16' : '-left-4 -top-14' + }` + : 'w-48 h-full -left-24' + } `} + > <div className={`relative w-full max-w-md p-2 text-center ${ - currentStep == index ? 'text-red-500' : '' + currentStep == index + ? 'text-red-500' + : `${isMobile ? 'hidden' : ''}` } text-nowrap`} > {stepLabels[index]} |
