Skip to content

Commit dfed26f

Browse files
Adding SignUp DateOfBirth Compo
1 parent 8d261f1 commit dfed26f

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React from 'react'
2+
import Input from './Input'
3+
4+
const DateBirth = () => {
5+
const currentYear = new Date().getFullYear()
6+
const years = Array.from({length:currentYear-1899},(_,i)=> 1900+i)
7+
console.log(years)
8+
//
9+
const DateBirth = Array.from({length:31},(_,i)=> i+1)
10+
const months = [
11+
{ value: "01", name: "January" },
12+
{ value: "02", name: "February" },
13+
{ value: "03", name: "March" },
14+
{ value: "04", name: "April" },
15+
{ value: "05", name: "May" },
16+
{ value: "06", name: "June" },
17+
{ value: "07", name: "July" },
18+
{ value: "08", name: "August" },
19+
{ value: "09", name: "September" },
20+
{ value: "10", name: "October" },
21+
{ value: "11", name: "November" },
22+
{ value: "12", name: "December" },
23+
];
24+
// console.log(DateBirth)
25+
return (
26+
<>
27+
<main className='border-2 flex gap-5'>
28+
<select name="birth">
29+
{
30+
DateBirth.map((date)=>(
31+
<option key={date} value={date} >{date}</option>
32+
))
33+
}
34+
</select>
35+
{/* */}
36+
<select name="month">
37+
{
38+
months.map((mon)=>(
39+
<option key={mon.value} >
40+
{mon.name}
41+
</option>
42+
))
43+
}
44+
</select>
45+
{/* */}
46+
<select name="month">
47+
{
48+
years.map((year)=>(
49+
<option key={year} >
50+
{year}
51+
</option>
52+
))
53+
}
54+
</select>
55+
</main>
56+
</>
57+
)
58+
}
59+
60+
export default DateBirth

facebook-login-clone/src/Components/SignUp.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
import React from "react";
22
import { NavLink } from "react-router-dom";
3-
import { Input,BtnSubmit } from "./index";
3+
import { Input,BtnSubmit,DateBirth} from "./index";
44

55
const SignUp = () => {
66
return <>
77
<main>
8-
<BtnSubmit/>
8+
<section>
9+
<div>
10+
<Input/>
11+
<Input/>
12+
</div>
13+
<div>
14+
<DateBirth/>
15+
</div>
16+
</section>
917
</main>
1018
</>;
1119
};
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export {default as Login} from './Login'
22
export {default as SignUp} from './SignUp'
33
export {default as Input} from './Common/Input'
4-
export {default as BtnSubmit} from './Common/BtnSubmit'
4+
export {default as BtnSubmit} from './Common/BtnSubmit'
5+
export {default as DateBirth} from './Common/DateBirth'

0 commit comments

Comments
 (0)