Skip to content

Commit 7cc98cc

Browse files
committed
🌟 validate SignUp form and update colors for global variable colors
1 parent 74cb2ad commit 7cc98cc

File tree

10 files changed

+103
-103
lines changed

10 files changed

+103
-103
lines changed

src/components/Form/Buttons/Buttons.module.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828

2929
overflow: hidden;
3030

31+
outline: none;
32+
3133
a {
32-
color: #0101018f;
34+
color: var(--grayDarkPrimary90opacity);
3335
text-decoration: none;
3436
font-weight: 600;
3537
font-family: Poppins;
@@ -40,34 +42,41 @@
4042
cursor: default;
4143
user-select: none;
4244
pointer-events: none;
45+
4346
}
4447

4548
&.active {
46-
background-color: #ff9f19;
49+
background-color: var(--yellowPrimary);
4750
color: #1e1e1e;
4851
cursor: pointer;
4952
user-select: none;
5053
pointer-events: all;
5154

55+
&:focus {
56+
background-color: var(--yellowPastel);
57+
outline: 1px solid var(--yellowPrimary);
58+
}
59+
5260
a {
5361
user-select: none;
5462
pointer-events: all;
55-
color: #1e1e1e;
63+
color: var(--grayDarkPrimary);
5664
cursor: pointer;
5765

5866
&:hover {
59-
background-color: #f2991d;
60-
67+
background-color: var(--yellowPastel);
6168
}
6269
}
6370
}
6471
}
6572

6673
.c_btn_create {
67-
margin: 10px 0 30px 0;
74+
margin: 15px 0 30px 0;
75+
border: none;
76+
background-color: transparent;
6877

6978
span>a {
70-
color: #ffbe1899;
79+
color: var(--yellowtDescriptions);
7180
font-weight: 300;
7281
font-size: 12px;
7382
}

src/components/Form/Buttons/Buttons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Link from "next/link"
2-
import { AnchorHTMLAttributes, ButtonHTMLAttributes, useEffect, useRef, useState } from "react"
2+
import { useEffect, useRef, useState } from "react"
33
import styles from "./Buttons.module.scss"
44

55
function Buttons({ statusLogin }) {
@@ -45,13 +45,13 @@ function Buttons({ statusLogin }) {
4545
<span ref={c_btn_span} />
4646
</Link>
4747
</button>
48-
<div className={styles.c_btn_create}>
48+
<button className={styles.c_btn_create}>
4949
<span>
5050
<Link href={hrefLinkByStateLogin}>
5151
<span ref={c_btn_create_span} />
5252
</Link>
5353
</span>
54-
</div>
54+
</button>
5555
</div>
5656
)
5757
}

src/components/Form/Footer/Footer.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.footer {
2-
background-color: #ffbd18;
2+
background-color: var(--yellowLightPrimary);
33
height: 24px;
44
width: 100%;
55

@@ -18,8 +18,8 @@
1818
align-items: center;
1919

2020
list-style: none;
21-
color: #1f1f1e;
22-
font-size: 1.2em;
21+
color: var(--grayDarkPrimary);
22+
font-size: 1.1em;
2323

2424
margin: 0 2px;
2525
padding: 0 5px;

src/components/Form/Form.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
flex-direction: column;
88
justify-content: space-between;
99

10-
background-color: #1e1e1e;
10+
background-color: var(--grayDarkPrimary);
1111
border-radius: 4px;
1212

1313
position: relative;

src/components/Form/Form.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@ import SignUp from "./SignUp/SignUp"
99

1010
function Form({ state }) {
1111
const [statusLogin, setStatusLogin] = useState<Boolean>(false)
12+
const [path, setPath] = useState<String>('/')
13+
14+
function verifyIfCanSubmit(e){
15+
if(statusLogin){
16+
setPath('/logged')
17+
}
18+
else {
19+
setPath('/')
20+
e.preventDefault()
21+
}
22+
}
23+
1224

1325
return (
14-
<div className={styles.container}>
26+
<form className={styles.container} onSubmit={e => verifyIfCanSubmit(e)} action={`${path}`}>
1527
<div className={styles.tick} />
16-
{state == 'signIn' ? <SignIn setStatusLogin={setStatusLogin} /> : <SignUp setStatusLogin={setStatusLogin} />}
28+
{state == 'signIn' ?
29+
<SignIn setStatusLogin={setStatusLogin} />
30+
:
31+
<SignUp setStatusLogin={setStatusLogin} />}
1732
<Buttons statusLogin={statusLogin} />
1833
<Footer />
19-
</div>
34+
</form>
2035
)
2136
}
2237

23-
export default Form
38+
export default Form

src/components/Form/Header/Header.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
h1 {
1616
font-size: 23px;
17-
color: rgb(236, 255, 255);
17+
color: var(--grayLightH1);
1818
font-weight: 700;
1919
}
2020

2121
h2 {
2222
font-size: 12px;
23-
color: rgb(121, 147, 148);
23+
color: var(--grayLightH2);
2424
font-weight: 400;
2525
}
2626
}

src/components/Form/SignIn/SignIn.module.scss renamed to src/components/Form/Inputs.module.scss

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
position: relative;
1313

14-
gap: 20px;
14+
gap: 15px;
1515

1616
.input {
1717

@@ -26,26 +26,30 @@
2626
position: relative;
2727

2828
label{
29-
color: #fff;
29+
color: var(--grayDarkLight);
3030
font-size: 13px;
3131
font-weight: 300;
32-
margin-bottom: 4px;
32+
margin-bottom: 2px;
3333
}
3434

3535
.icon{
3636
position: absolute;
37-
color: #fff;
37+
color: var(--grayDarkMedium);
3838
top: 37px;
3939
left: 5px;
4040
}
4141

4242
input {
43-
border: 1px solid rgba(255, 255, 255, 0.411);
44-
color: #fff;
43+
border: 1px solid var(--grayDarkMedium);
44+
color: var(--write);
4545
padding: 10px 28px;
4646
border-radius: 4px;
4747

4848
background-color: transparent;
49+
50+
&:focus{
51+
outline: 1px solid var(--yellow75opacity);
52+
}
4953
}
5054
}
5155

src/components/Form/SignIn/SignIn.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styles from "./SignIn.module.scss"
1+
import styles from "../Inputs.module.scss"
22
import { AiOutlineUser } from "react-icons/ai"
33
import { RiLockPasswordLine } from "react-icons/ri"
44
import { useEffect, useState } from "react"
@@ -51,16 +51,16 @@ function SignIn({ setStatusLogin }) {
5151
<Header title={'Login'} description={'Access your account now'} />
5252
<div className={styles.inputs}>
5353
<div className={styles.input}>
54-
<label htmlFor="login">Login</label>
54+
<label htmlFor="email">Email</label>
5555
<div className={styles.icon}>
5656
<AiOutlineUser />
5757
</div>
5858
<input
5959
autoComplete="off"
6060
onInput={(e: any) => setEmail(e.target.value)}
61-
id="login"
61+
id="email"
6262
type="text"
63-
placeholder="Login" />
63+
placeholder="Email" />
6464
</div>
6565
<div className={styles.input}>
6666
<label htmlFor="pass">Senha</label>

src/components/Form/SignUp/SignUp.module.scss

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

0 commit comments

Comments
 (0)