Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit34dcea1

Browse files
committed
multi step form complete
1 parent9d4aef2 commit34dcea1

File tree

12 files changed

+263
-4
lines changed

12 files changed

+263
-4
lines changed

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview":"vite preview"
1111
},
1212
"dependencies": {
13+
"lucide-react":"^0.477.0",
1314
"react":"^19.0.0",
1415
"react-dom":"^19.0.0"
1516
},

‎pnpm-lock.yaml‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/App.jsx‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
1-
importReactfrom'react'
1+
importIndexAccordianfrom'./components/accordian/IndexAccordian';
2+
importButtonfrom'./components/button/Button';
3+
importMultiStepFormfrom'./components/multi-step-form/MultiStepForm';
4+
importWrapperfrom'./components/Wrapper';
5+
26

37
constApp=()=>{
8+
49
return(
5-
<div>
6-
<h1className='text-7xl font-bold text-center my-10'>Hello world</h1>
7-
</div>
10+
<sectionclassName='bg-slate-100'>
11+
<h1className='text-4xl font-bold text-center py-10 text-cyan-500'>
12+
Frontend System Design
13+
</h1>
14+
15+
16+
<Button
17+
label={"Click Me"}
18+
disabled={false}
19+
loading={false}
20+
onClick={()=>console.log("Clicked")}>
21+
Touch Me
22+
</Button>
23+
24+
{/* Accordian */}
25+
<divclassName='py-10'>
26+
<IndexAccordian/>
27+
</div>
28+
29+
30+
{/* Multi Step Form */}
31+
<divclassName='py-10'>
32+
<MultiStepForm/>
33+
</div>
34+
</section>
835
)
936
}
1037

‎src/components/Title.jsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
importReactfrom'react'
2+
3+
constTitle=({ children})=>{
4+
return(
5+
<h1className='text-3xl text-center font-semibold py-5 text-slate-500'>
6+
{children}
7+
</h1>
8+
)
9+
}
10+
11+
exportdefaultTitle

‎src/components/Wrapper.jsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
constWrapper=({ children})=>{
3+
return(
4+
<sectionclassName="flex justify-center items-center">
5+
<divclassName="w-[500px] rounded shadow bg-white p-5">
6+
{children}
7+
</div>
8+
</section>
9+
)
10+
}
11+
12+
exportdefaultWrapper;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import{useState}from'react';
2+
import{ChevronsUpDown}from'lucide-react';
3+
import{Triangle}from'lucide-react';
4+
5+
6+
constAccordian=({ heading, children})=>{
7+
const[isOpen,setIsOpen]=useState(false);
8+
9+
functionhandleOpen(){
10+
setIsOpen(!isOpen)
11+
};
12+
13+
return(
14+
<section>
15+
<divclassName='flex justify-between bg-blue-400 p-2 rounded text-white'>
16+
<spanclassName='text-xl text-white'>{heading}</span>
17+
{
18+
isOpen ?<TriangleonClick={handleOpen}/> :<ChevronsUpDownonClick={handleOpen}/>
19+
}
20+
</div>
21+
22+
{isOpen&&children}
23+
</section>
24+
)
25+
}
26+
27+
exportdefaultAccordian;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
importTitlefrom"../Title"
2+
importWrapperfrom"../Wrapper"
3+
importAccordianfrom"./Accordian"
4+
5+
6+
constIndexAccordian=()=>{
7+
return(
8+
<section>
9+
<Title>
10+
Accordian
11+
</Title>
12+
13+
<Wrapper>
14+
<Accordianheading="Learn React">
15+
<divclassName='space-y-1 font-semibold pt-2'>
16+
<p>Hello guys, I am learning React.</p>
17+
<p>Hello guys, I am learning React Pro.</p>
18+
<p>Hello guys, I am learning React Pro Level.</p>
19+
</div>
20+
</Accordian>
21+
</Wrapper><br/>
22+
23+
24+
<div>
25+
<Title>
26+
Native Accordian
27+
</Title>
28+
<Wrapper>
29+
<details>
30+
<summaryclassName="text-2xl cursor-pointer">Learn React</summary>
31+
<divclassName='space-y-1 font-semibold pt-2'>
32+
<p>Hello guys, I am learning React.</p>
33+
<p>Hello guys, I am learning React Pro.</p>
34+
<p>Hello guys, I am learning React Pro Level.</p>
35+
</div>
36+
</details>
37+
</Wrapper>
38+
</div>
39+
</section>
40+
)
41+
}
42+
43+
exportdefaultIndexAccordian

‎src/components/button/Button.jsx‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
constButton=({ label, onClick, children, disabled, loading})=>{
3+
if(children){
4+
return<divclassName="flex justify-center items-center">
5+
<buttononClick={onClick}
6+
disabled={disabled}
7+
className='bg-blue-400 active:bg-blue-500 px-4 py-2 rounded text-white font-semibold'>{loading ?"Loading" :children}</button>
8+
</div>
9+
};
10+
return<divclassName="flex justify-center items-center">
11+
<buttononClick={onClick}
12+
disabled={disabled}
13+
className='bg-blue-400 active:bg-blue-500 px-4 py-2 rounded text-white font-semibold'
14+
>{label}</button>
15+
</div>
16+
}
17+
18+
exportdefaultButton
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
importTitlefrom'../Title'
2+
importWrapperfrom'../Wrapper'
3+
4+
constContactInfo=()=>{
5+
return(
6+
<section>
7+
<Title>
8+
Contact Information
9+
</Title>
10+
11+
<Wrapper>
12+
<divclassName="space-y-2">
13+
<divclassName="space-y-2">
14+
<labelclassName="text-xl text-slate-600"htmlFor="tel">Phone</label><br/>
15+
<inputid="tel"type="tel"placeholder="Write your phone number"className="border rounded px-2 h-10 w-full"/>
16+
</div>
17+
18+
<divclassName="space-y-2">
19+
<labelclassName="text-xl text-slate-600"htmlFor="text">City</label><br/>
20+
<inputid="text"type="email"placeholder="City name"className="border rounded px-2 h-10 w-full"/>
21+
</div>
22+
</div>
23+
</Wrapper>
24+
</section>
25+
)
26+
}
27+
28+
exportdefaultContactInfo
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
importReactfrom'react'
2+
importTitlefrom'../Title'
3+
importWrapperfrom'../Wrapper'
4+
5+
constFinancialInformation=()=>{
6+
return(
7+
<section>
8+
<Title>
9+
Sallery Information
10+
</Title>
11+
12+
<Wrapper>
13+
<divclassName="space-y-2">
14+
<divclassName="space-y-2">
15+
<labelclassName="text-xl text-slate-600"htmlFor="sallery">Sallery</label><br/>
16+
<inputid="sallery"type="text"placeholder="Write your phone number"className="border rounded px-2 h-10 w-full"/>
17+
</div>
18+
19+
<divclassName="space-y-2">
20+
<labelclassName="text-xl text-slate-600"htmlFor="bank">Bank</label><br/>
21+
<inputid="bank"type="text"placeholder="City name"className="border rounded px-2 h-10 w-full"/>
22+
</div>
23+
</div>
24+
</Wrapper>
25+
</section>
26+
)
27+
}
28+
29+
exportdefaultFinancialInformation

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp