|
1 | 1 | 'use client' |
2 | 2 |
|
3 | | -import { usePathname } from 'next/navigation' |
4 | | - |
5 | | -export default function StepIndicators() { |
6 | | - const pathname = usePathname() |
| 3 | +interface StepIndicatorProps { |
| 4 | + currentStep: number |
| 5 | +} |
7 | 6 |
|
8 | | - const isStep2 = pathname.includes('step2') |
9 | | - const isStep3 = |
10 | | - pathname.includes('step3') || pathname.includes('confirmSetup') |
| 7 | +export default function StepIndicator({ currentStep }: StepIndicatorProps) { |
| 8 | + const isStep2 = currentStep >= 2 |
| 9 | + const isStep3 = currentStep >= 3 |
11 | 10 |
|
12 | 11 | return ( |
13 | 12 | <div className="w-full flex justify-between items-center md:px-8 relative"> |
14 | | - {/* Horizontal Lines */} |
15 | | - <div |
16 | | - className={`${isStep2 || isStep3 ? 'bg-[#6F2FCE]' : 'bg-[#8E9BAE]'} absolute top-[22.5px] md:left-[18%] left-[23%] w-[15%] md:w-[25%] h-[1px]`} |
17 | | - ></div> |
18 | | - <div |
19 | | - className={`${isStep3 ? 'bg-[#6F2FCE]' : 'bg-[#8E9BAE]'} absolute top-[22.5px] md:right-[18%] right-[23%] w-[15%] md:w-[25%] h-[1px]`} |
20 | | - ></div> |
21 | | - |
22 | | - {/* Step 1 */} |
| 13 | + <div className="absolute top-[22.5px] md:left-[18%] left-[23%] w-[15%] md:w-[25%] h-[1px] bg-[#8E9BAE] overflow-hidden"> |
| 14 | + <div |
| 15 | + className={`absolute top-0 left-0 h-full bg-[#6F2FCE] transition-all duration-500 ease-in-out ${isStep2 || isStep3 ? 'w-full' : 'w-0'}`} |
| 16 | + ></div> |
| 17 | + </div> |
| 18 | + <div className="absolute top-[22.5px] md:right-[18%] right-[23%] w-[15%] md:w-[25%] h-[1px] bg-[#8E9BAE] overflow-hidden"> |
| 19 | + <div |
| 20 | + className={`absolute top-0 left-0 h-full bg-[#6F2FCE] transition-all duration-500 ease-in-out ${isStep3 ? 'w-full' : 'w-0'}`} |
| 21 | + ></div> |
| 22 | + </div> |
23 | 23 | <div className="flex flex-col items-center gap-8 relative"> |
24 | | - <div className="bg-[#6F2FCE] text-white flex justify-center items-center w-[45px] h-[45px] rounded-full font-[700] text-lg z-10"> |
| 24 | + <div className="bg-[#6F2FCE] text-white flex justify-center items-center w-[45px] h-[45px] rounded-full font-[700] text-lg z-10 transition-colors duration-300"> |
25 | 25 | 1 |
26 | 26 | </div> |
27 | 27 | <h4 className="text-white text-sm text-center font-[400]"> |
28 | 28 | Account Details |
29 | 29 | </h4> |
30 | 30 | </div> |
31 | | - |
32 | | - {/* Step 2 */} |
33 | 31 | <div className="flex flex-col items-center gap-8 relative"> |
34 | 32 | <div |
35 | | - className={`${isStep2 || isStep3 ? 'bg-[#6F2FCE] text-white ' : 'bg-[#1C1D1F] text-[#8E9BAE]'} flex justify-center items-center w-[45px] h-[45px] rounded-full font-[700] text-lg z-10`} |
| 33 | + className={`${isStep2 || isStep3 ? 'bg-[#6F2FCE] text-white ' : 'bg-[#1C1D1F] text-[#8E9BAE]'} flex justify-center items-center w-[45px] h-[45px] rounded-full font-[700] text-lg z-10 transition-colors duration-300`} |
36 | 34 | > |
37 | 35 | 2 |
38 | 36 | </div> |
39 | 37 | <h4 |
40 | | - className={`${isStep2 || isStep3 ? 'text-white ' : 'text-[#8E9BAE]'} text-sm text-center font-[400]`} |
| 38 | + className={`${isStep2 || isStep3 ? 'text-white ' : 'text-[#8E9BAE]'} text-sm text-center font-[400] transition-colors duration-300`} |
41 | 39 | > |
42 | 40 | Members & Threshold |
43 | 41 | </h4> |
44 | 42 | </div> |
45 | | - |
46 | | - {/* Step 3 */} |
47 | 43 | <div className="flex flex-col items-center gap-8 relative"> |
48 | 44 | <div |
49 | | - className={`${isStep3 ? 'bg-[#6F2FCE] text-white ' : 'bg-[#1C1D1F] text-[#8E9BAE]'} flex justify-center items-center w-[45px] h-[45px] rounded-full bg-[#1C1D1F] text-[#8E9BAE] font-[700] text-lg z-10`} |
| 45 | + className={`${isStep3 ? 'bg-[#6F2FCE] text-white ' : 'bg-[#1C1D1F] text-[#8E9BAE]'} flex justify-center items-center w-[45px] h-[45px] rounded-full font-[700] text-lg z-10 transition-colors duration-300`} |
50 | 46 | > |
51 | 47 | 3 |
52 | 48 | </div> |
53 | 49 | <h4 |
54 | | - className={`${isStep3 ? 'text-white ' : 'text-[#8E9BAE]'} text-sm text-center font-[400]`} |
| 50 | + className={`${isStep3 ? 'text-white ' : 'text-[#8E9BAE]'} text-sm text-center font-[400] transition-colors duration-300`} |
55 | 51 | > |
56 | 52 | Confirm & Setup |
57 | 53 | </h4> |
58 | 54 | </div> |
| 55 | + |
| 56 | + <style jsx>{` |
| 57 | + @keyframes slide-right { |
| 58 | + from { |
| 59 | + width: 0; |
| 60 | + } |
| 61 | + to { |
| 62 | + width: 100%; |
| 63 | + } |
| 64 | + } |
| 65 | + `}</style> |
59 | 66 | </div> |
60 | 67 | ) |
61 | 68 | } |
0 commit comments