Skip to content

Commit 00b7425

Browse files
authored
Merge pull request #31 from davedumto/feat-built-onboarding-steps-into-one
Feat built onboarding steps into one
2 parents e9dcb50 + c33e0a2 commit 00b7425

File tree

12 files changed

+467
-297
lines changed

12 files changed

+467
-297
lines changed

.DS_Store

6 KB
Binary file not shown.

frontend/app/onboarding/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import Nav from '@/components/onboarding/Nav'
2-
import StepIndicators from '@/components/onboarding/StepIndicators'
32

43
export default function layout({
54
children,
65
}: Readonly<{
76
children: React.ReactNode
87
}>) {
98
return (
10-
<main className="w-full lg:px-[50px] md:px-6 px-4 md:py-[50px] py-4 overflow-x-hidden">
9+
<main className="w-full lg:px-[50px] md:px-6 px-4 md:py-[50px] py-4 overflow-x-hidden bg-black">
1110
<Nav />
1211
<section className="max-w-2xl mx-auto md:mt-28 mt-20">
1312
<div className="w-full flex flex-col items-center gap-6">
14-
{/* Step Indicators */}
15-
<StepIndicators />
16-
1713
{children}
1814
</div>
1915
</section>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
const step1 = () => {
4+
return <div>step1</div>
5+
}
6+
7+
export default step1

frontend/components/onboarding/Nav.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const Nav = () => {
2525
return (
2626
<header className="w-full flex justify-between items-center">
2727
{/* Logo */}
28-
<Logo href={'/'} className="md:w-[50px] w-[40px]" image={spherreLogo} />
28+
<Logo
29+
href={'/'}
30+
className="md:w-[50px] w-[40px] "
31+
image={spherreLogo}
32+
textColor="white"
33+
/>
2934

3035
{/* Connect button & Hamburger Menu Button */}
3136
<div className="flex items-center gap-4">
Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,68 @@
11
'use client'
22

3-
import { usePathname } from 'next/navigation'
4-
5-
export default function StepIndicators() {
6-
const pathname = usePathname()
3+
interface StepIndicatorProps {
4+
currentStep: number
5+
}
76

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
1110

1211
return (
1312
<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>
2323
<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">
2525
1
2626
</div>
2727
<h4 className="text-white text-sm text-center font-[400]">
2828
Account Details
2929
</h4>
3030
</div>
31-
32-
{/* Step 2 */}
3331
<div className="flex flex-col items-center gap-8 relative">
3432
<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`}
3634
>
3735
2
3836
</div>
3937
<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`}
4139
>
4240
Members & Threshold
4341
</h4>
4442
</div>
45-
46-
{/* Step 3 */}
4743
<div className="flex flex-col items-center gap-8 relative">
4844
<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`}
5046
>
5147
3
5248
</div>
5349
<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`}
5551
>
5652
Confirm & Setup
5753
</h4>
5854
</div>
55+
56+
<style jsx>{`
57+
@keyframes slide-right {
58+
from {
59+
width: 0;
60+
}
61+
to {
62+
width: 100%;
63+
}
64+
}
65+
`}</style>
5966
</div>
6067
)
6168
}

0 commit comments

Comments
 (0)