Skip to content

Commit 97bc174

Browse files
author
Swarnim Pratap Singh
committed
Solving some git conflict
2 parents 2f5f4f0 + 4175a66 commit 97bc174

6 files changed

Lines changed: 141 additions & 169 deletions

File tree

src/components/Footbt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as routes from "../constants/routes";
66
function Footbtn() {
77
return (<>
88
<div className="footer">
9-
<Link to ={routes.SIGNUP}><Button variant ="primary" style={{background:'teal',color:'white',width:'40%',height:'200%',position:'relative','box-shadow': 'inset 0 0.2 0.2 0.8 grey'}}>Register Yourself
9+
<Link to ={routes.SIGNUP}><Button variant ="primary" style={{background:'white',color:'white',width:'40%',height:'200%',position:'relative','box-shadow': 'inset 0 0.2 0.2 0.8 grey'}}>Register Yourself
1010
</Button></Link>
1111
</div>
1212
</>);

src/screens/EmailAuth.js

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import React, { useState } from "react";
2+
import { auth, db } from "../firebase";
3+
import { Form, Button } from "react-bootstrap";
4+
import "./Welcome.css";
5+
function Signup() {
6+
const [name, setName] = useState(null);
7+
const [InsId, setInsId] = useState(null);
8+
const [email, setEmail] = useState(null);
9+
const [password, setPassword] = useState(null);
10+
11+
const handleSubmit = async (e) => {
12+
e.preventDefault();
13+
if (name && email && password && InsId) {
14+
await auth
15+
.createUserWithEmailAndPassword(email, password)
16+
.then(async (authUser) => {
17+
if (authUser) {
18+
const uid = authUser?.user?.uid;
19+
20+
db.collection("users").doc(uid).set({
21+
name: name,
22+
finishedSetup: false,
23+
features: null, // means get the institute id and face features of the student
24+
collegeId: InsId,
25+
});
26+
}
27+
})
28+
.catch((err) => console.log(err));
29+
}
30+
};
31+
32+
return (
33+
<>
34+
<div className="poster-signup">
35+
<div
36+
className="container mt-4"
37+
style={{ width: "70%", padding: "10%" }}
38+
>
39+
<h2>Welcome to The Attendlt!</h2>
40+
<h3
41+
style={{
42+
color: "#ff3300",
43+
textAlign: "center",
44+
textDecoration: "bold",
45+
}}
46+
>
47+
You need to fill the following details to register!
48+
</h3>
49+
<Form onSubmit={handleSubmit} className="form">
50+
<Form.Group>
51+
<Form.Label>Name</Form.Label>
52+
<Form.Control
53+
type="text"
54+
placeholder="Enter your name"
55+
value={name}
56+
onChange={(e) => setName(e.target.value)}
57+
/>
58+
</Form.Group>
59+
60+
<Form.Group>
61+
<Form.Label>Institute ID</Form.Label>
62+
<Form.Control
63+
type="text"
64+
placeholder="Enter InstituteID"
65+
value={InsId}
66+
onChange={(e) => setInsId(e.target.value)}
67+
/>
68+
</Form.Group>
69+
70+
<Form.Group>
71+
<Form.Label>Email address</Form.Label>
72+
<Form.Control
73+
type="email"
74+
placeholder="Enter email"
75+
value={email}
76+
onChange={(e) => setEmail(e.target.value)}
77+
/>
78+
</Form.Group>
79+
80+
<Form.Group>
81+
<Form.Label>Password</Form.Label>
82+
<Form.Control
83+
type="password"
84+
placeholder="Password"
85+
value={password}
86+
onChange={(e) => setPassword(e.target.value)}
87+
/>
88+
</Form.Group>
89+
<Button
90+
type="submit"
91+
style={{ width: "45%", background: "#ff3300" }}
92+
>
93+
Register
94+
</Button>
95+
</Form>
96+
</div>
97+
</div>
98+
</>
99+
);
100+
}
101+
102+
export default Signup;

src/screens/Home.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* {
22
box-sizing: border-box;
3+
/* color:whitesmoke; */
34
}
45
body,
56
html {
@@ -131,9 +132,9 @@ span {
131132
box-sizing: border-box;
132133
text-align: center;
133134
}
134-
.button {
135-
background-color: crimson; /* Green */
136-
border-radius: 10px;
135+
/* .button{
136+
background-color: crimson; Green
137+
border-radius:10px;
137138
color: white;
138139
padding: 15px 32px;
139140
margin: 2em;
@@ -142,4 +143,4 @@ span {
142143
display: inline-block;
143144
font-size: 3em;
144145
box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%);
145-
}
146+
} */

src/screens/Signup.js

Lines changed: 32 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@ import React, { useState } from "react";
22
import { auth, db } from "../firebase";
33
import { Form, Button } from "react-bootstrap";
44
import "./Welcome.css";
5-
function Signup() {
6-
const [name, setName] = useState(null);
7-
const [InsId, setInsId] = useState(null);
8-
const [email, setEmail] = useState(null);
9-
const [password, setPassword] = useState(null);
105

6+
function EmailAuth() {
7+
const [email, setEmail] = useState(null);
118
const handleSubmit = async (e) => {
129
e.preventDefault();
13-
if (name && email && password && InsId) {
10+
if (email) {
1411
await auth
15-
.createUserWithEmailAndPassword(email, password)
12+
.createUserWithEmailAndPassword(email)
1613
.then(async (authUser) => {
1714
if (authUser) {
1815
const uid = authUser?.user?.uid;
1916

2017
db.collection("users").doc(uid).set({
21-
name: name,
2218
finishedSetup: false,
2319
features: null, // means get the institute id and face features of the student
24-
collegeId: InsId,
2520
});
2621
}
2722
})
@@ -36,77 +31,38 @@ function Signup() {
3631
className="container mt-4"
3732
style={{ width: "70%", padding: "10%" }}
3833
>
39-
<div className="form">
40-
<h2
41-
style={{
42-
color: "grey",
43-
textAlign: "center",
44-
textDecoration: "bold",
45-
}}
46-
>
47-
Welcome to The Attendlt!
48-
</h2>
49-
<h3
50-
style={{
51-
color: "#ff3300",
52-
textAlign: "center",
53-
textDecoration: "bold",
54-
}}
55-
>
56-
You need to fill the following details to register!
57-
</h3>
58-
<Form onSubmit={handleSubmit} className="form">
59-
<Form.Group>
60-
<Form.Label>Name</Form.Label>
61-
<Form.Control
62-
type="text"
63-
placeholder="Enter your name"
64-
value={name}
65-
onChange={(e) => setName(e.target.value)}
66-
/>
67-
</Form.Group>
34+
<h2>Welcome to The Attendlt!</h2>
35+
<h3
36+
style={{
37+
color: "#ff3300",
38+
textAlign: "center",
39+
textDecoration: "bold",
40+
}}
41+
>
42+
You need to verify your email first to register!
43+
</h3>
44+
<Form onSubmit={handleSubmit} className="form">
45+
<Form.Group>
46+
<Form.Label>Email address</Form.Label>
47+
<Form.Control
48+
type="email"
49+
placeholder="Enter email"
50+
value={email}
51+
onChange={(e) => setEmail(e.target.value)}
52+
/>
53+
</Form.Group>
6854

69-
<Form.Group>
70-
<Form.Label>Institute ID</Form.Label>
71-
<Form.Control
72-
type="text"
73-
placeholder="Enter InstituteID"
74-
value={InsId}
75-
onChange={(e) => setInsId(e.target.value)}
76-
/>
77-
</Form.Group>
78-
79-
<Form.Group>
80-
<Form.Label>Email address</Form.Label>
81-
<Form.Control
82-
type="email"
83-
placeholder="Enter email"
84-
value={email}
85-
onChange={(e) => setEmail(e.target.value)}
86-
/>
87-
</Form.Group>
88-
89-
<Form.Group>
90-
<Form.Label>Password</Form.Label>
91-
<Form.Control
92-
type="password"
93-
placeholder="Password"
94-
value={password}
95-
onChange={(e) => setPassword(e.target.value)}
96-
/>
97-
</Form.Group>
98-
<Button
99-
type="submit"
100-
style={{ width: "45%", background: "#ff3300" }}
101-
>
102-
Register
103-
</Button>
104-
</Form>
105-
</div>
55+
<Button
56+
type="submit"
57+
style={{ width: "45%", background: "#ff3300" }}
58+
>
59+
Verify
60+
</Button>
61+
</Form>
10662
</div>
10763
</div>
10864
</>
10965
);
11066
}
11167

112-
export default Signup;
68+
export default EmailAuth;

src/screens/Welcome.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function Welcome() {
8484
<div className="about">
8585
<h2>Here Are Few Of The Testimonials For {tagline}:Attendance System</h2> </div>
8686
<div className="footer">
87-
<Link to ={routes.ABOUT}><Button variant ="primary" style={{background:'teal',color:'white',width:'40%',height:'2000%',position:'relative','box-shadow': 'inset 0 0.2 0.2 0.8 grey'}}>Testimonials
87+
<Link to ={routes.ABOUT}><Button variant ="primary" style={{background:'pink',color:'white',width:'40%',height:'2000%',position:'relative','box-shadow': 'inset 0 0.2 0.2 0.8 grey'}}>Testimonials
8888
</Button></Link>
8989
</div>
9090
</div>

src/screens/emailauth.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)