@@ -3,115 +3,106 @@ import { useRouter } from 'next/navigation'
33import React , { useState } from 'react'
44
55const StepOne = ( ) => {
6- const [ accountName , setAccountName ] = useState ( "" )
7- const [ desc , setDesc ] = useState ( "" )
6+ const [ accountName , setAccountName ] = useState ( '' )
7+ const [ desc , setDesc ] = useState ( '' )
88
9- const router = useRouter ( )
9+ const router = useRouter ( )
1010
11- /**
12- * Handles form submission for Step 1 of the onboarding process.
13- * Checks if both the account name and description inputs are not empty.
14- * If not, it throws an error.
15- * If valid, logs the inputs to console and navigates to Step 2.
16- * If an error occurs during navigation, it's logged to console.
17- */
18- const handleSubmitStepOne = async ( ) => {
19- if ( ! accountName && ! desc ) {
20- throw Error ( "Inputs are required" ) ;
21- }
22-
23- try {
24- console . log ( { accountName, description : desc } ) ;
25- // Necessay submit logic
26- router . push ( "/onboarding/step2" ) ;
27- } catch ( error ) {
28- console . error ( error )
29- }
11+ /**
12+ * Handles form submission for Step 1 of the onboarding process.
13+ * Checks if both the account name and description inputs are not empty.
14+ * If not, it throws an error.
15+ * If valid, logs the inputs to console and navigates to Step 2.
16+ * If an error occurs during navigation, it's logged to console.
17+ */
18+ const handleSubmitStepOne = async ( ) => {
19+ if ( ! accountName && ! desc ) {
20+ throw Error ( 'Inputs are required' )
3021 }
3122
32- return (
33- < section className = "max-w-2xl mx-auto md:mt-28 mt-20" >
34- < main className = 'w-full flex flex-col items-center gap-6' >
35- { /* Step Indicators */ }
36- < div className = "w-full flex justify-between items-center md:px-8 relative" >
37- { /* Horizontal Lines */ }
38- < div className = "absolute top-[22.5px] md:left-[18%] left-[23%] w-[15%] md:w-[25%] h-[1px] bg-[#8E9BAE]" > </ div >
39- < div className = "absolute top-[22.5px] md:right-[18%] right-[23%] w-[15%] md:w-[25%] h-[1px] bg-[#8E9BAE]" > </ div >
40-
41- { /* Step 1 */ }
42- < div className = "flex flex-col items-center gap-8 relative" >
43- < div className = "flex justify-center items-center w-[45px] h-[45px] rounded-full bg-[#6F2FCE] text-white font-[700] text-lg z-10" >
44- 1
45- </ div >
46- < h4 className = "text-white text-sm text-center font-[400]" > Account Details</ h4 >
47- </ div >
48-
49- { /* Step 2 */ }
50- < div className = "flex flex-col items-center gap-8 relative" >
51- < div className = "flex justify-center items-center w-[45px] h-[45px] rounded-full bg-[#1C1D1F] text-[#8E9BAE] font-[700] text-lg z-10" >
52- 2
53- </ div >
54- < h4 className = "text-[#8E9BAE] text-sm text-center font-[400]" > Members & Threshold </ h4 >
55- </ div >
56-
57- { /* Step 3 */ }
58- < div className = "flex flex-col items-center gap-8 relative" >
59- < div className = "flex justify-center items-center w-[45px] h-[45px] rounded-full bg-[#1C1D1F] text-[#8E9BAE] font-[700] text-lg z-10" >
60- 3
61- </ div >
62- < h4 className = "text-[#8E9BAE] text-sm text-center font-[400]" > Confirm & Setup </ h4 >
63- </ div >
64- </ div >
65-
66- { /* Writeup */ }
67- < div className = 'max-w-sm my-12' >
68- < h1 className = 'text-center text-white font-[700] text-[40px] leading-[47.42px]' > Secure Your Digital Assets Seamlessly</ h1 >
69- < p className = 'font-[400] text-[16px] leading-[25px] text-center text-[#8E9BAE] lg:px-8 mt-3' > Name your Spherre account, Spherre ensures seamless integration, giving you full control over your digital assets.</ p >
70- </ div >
23+ try {
24+ console . log ( { accountName, description : desc } )
25+ // Necessay submit logic
26+ router . push ( '/onboarding/step2' )
27+ } catch ( error ) {
28+ console . error ( error )
29+ }
30+ }
7131
32+ return (
33+ < >
34+ { /* Writeup */ }
35+ < div className = "max-w-sm my-12" >
36+ < h1 className = "text-center text-white font-[700] text-[40px] leading-[47.42px]" >
37+ Secure Your Digital Assets Seamlessly
38+ </ h1 >
39+ < p className = "font-[400] text-[16px] leading-[25px] text-center text-[#8E9BAE] lg:px-8 mt-3" >
40+ Name your Spherre account, Spherre ensures seamless integration,
41+ giving you full control over your digital assets.
42+ </ p >
43+ </ div >
7244
73- { /* form */ }
74- < div className = ' rounded-[10px] bg-[#1C1D1F] w-full overflow-hidden' >
75- < div className = ' bg-[#272729] py-[18px] md:px-[26px] px-4 w-full h-[62px]' >
76- < h4 className = "text-white font-[700] text-xl" > Create Account</ h4 >
77- </ div >
45+ { /* form */ }
46+ < div className = " rounded-[10px] bg-[#1C1D1F] w-full overflow-hidden" >
47+ < div className = " bg-[#272729] py-[18px] md:px-[26px] px-4 w-full h-[62px]" >
48+ < h4 className = "text-white font-[700] text-xl" > Create Account</ h4 >
49+ </ div >
7850
79- { /* Inputs */ }
80- < form onSubmit = { handleSubmitStepOne } className = 'w-full flex flex-col gap-6 py-4 md:px-[26px] px-4' >
81- { /* Account name */ }
82- < div className = 'w-full' >
83- < label htmlFor = "accountName" className = 'font-[400] text-[14px]leading-[24px] text-white mb-1 block' > Spherre Account Name</ label >
84- < input
85- type = 'text'
86- name = 'accountName'
87- id = 'accountName'
88- value = { accountName }
89- onChange = { ( e ) => setAccountName ( e . target . value ) }
90- className = 'w-full border border-[#292929] rounded-[7px] placeholder:text-[#8E9BAE] px-4 py-3 bg-transparent outline-none'
91- placeholder = 'Enter a team name'
92- required />
93- </ div >
51+ { /* Inputs */ }
52+ < form
53+ onSubmit = { handleSubmitStepOne }
54+ className = "w-full flex flex-col gap-6 py-4 md:px-[26px] px-4"
55+ >
56+ { /* Account name */ }
57+ < div className = "w-full" >
58+ < label
59+ htmlFor = "accountName"
60+ className = "font-[400] text-[14px]leading-[24px] text-white mb-1 block"
61+ >
62+ Spherre Account Name
63+ </ label >
64+ < input
65+ type = "text"
66+ name = "accountName"
67+ id = "accountName"
68+ value = { accountName }
69+ onChange = { ( e ) => setAccountName ( e . target . value ) }
70+ className = "w-full border border-[#292929] rounded-[7px] placeholder:text-[#8E9BAE] px-4 py-3 bg-transparent outline-none"
71+ placeholder = "Enter a team name"
72+ required
73+ />
74+ </ div >
9475
95- { /* Description */ }
96- < div className = 'w-full' >
97- < label htmlFor = "description" className = 'font-[400] text-[14px]leading-[24px] text-white mb-1 block' > Spherre Description</ label >
98- < textarea
99- name = 'description'
100- id = "description"
101- value = { desc }
102- onChange = { ( e ) => setDesc ( e . target . value ) }
103- className = 'w-full h-[100px] border border-[#292929] rounded-[7px] placeholder:text-[#8E9BAE] px-4 py-3 bg-transparent outline-none resize-y shadow-[0px_1.08px_2.16px_0px_#1018280A]'
104- placeholder = 'Write here...'
105- required > </ textarea >
106- </ div >
76+ { /* Description */ }
77+ < div className = "w-full" >
78+ < label
79+ htmlFor = "description"
80+ className = "font-[400] text-[14px]leading-[24px] text-white mb-1 block"
81+ >
82+ Spherre Description
83+ </ label >
84+ < textarea
85+ name = "description"
86+ id = "description"
87+ value = { desc }
88+ onChange = { ( e ) => setDesc ( e . target . value ) }
89+ className = "w-full h-[100px] border border-[#292929] rounded-[7px] placeholder:text-[#8E9BAE] px-4 py-3 bg-transparent outline-none resize-y shadow-[0px_1.08px_2.16px_0px_#1018280A]"
90+ placeholder = "Write here..."
91+ required
92+ > </ textarea >
93+ </ div >
10794
108- { /* Button */ }
109- < button type = 'submit' className = 'w-full h-[50px] flex justify-center items-center bg-white shadow-[0px_1.08px_2.16px_0px_#1018280A] text-[#101213] font-[500] text-base rounded-[7px]' > Continue</ button >
110- </ form >
111- </ div >
112- </ main >
113- </ section >
114- )
95+ { /* Button */ }
96+ < button
97+ type = "submit"
98+ className = "w-full h-[50px] flex justify-center items-center bg-white shadow-[0px_1.08px_2.16px_0px_#1018280A] text-[#101213] font-[500] text-base rounded-[7px]"
99+ >
100+ Continue
101+ </ button >
102+ </ form >
103+ </ div >
104+ </ >
105+ )
115106}
116107
117- export default StepOne
108+ export default StepOne
0 commit comments