Skip to content

Commit 4392718

Browse files
committed
fixes
1 parent 5ab43b6 commit 4392718

File tree

3 files changed

+46
-47
lines changed

3 files changed

+46
-47
lines changed

client/modules/User/components/LoginForm.jsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,22 @@ function LoginForm() {
5050
</Field>
5151
<Field name="password">
5252
{(field) => (
53-
<div style={{ position: 'relative' }}>
53+
<div>
5454
<p className="form__field">
5555
<label htmlFor="password" className="form__label">
5656
{t('LoginForm.Password')}
5757
</label>
58+
<button
59+
className="form__eye__icon"
60+
type="button"
61+
onClick={handleVisibility}
62+
>
63+
{showPassword ? (
64+
<AiOutlineEyeInvisible />
65+
) : (
66+
<AiOutlineEye />
67+
)}
68+
</button>
5869
<input
5970
className="form__input"
6071
aria-label={t('LoginForm.PasswordARIA')}
@@ -67,19 +78,6 @@ function LoginForm() {
6778
<span className="form-error">{field.meta.error}</span>
6879
)}
6980
</p>
70-
<button
71-
type="button"
72-
onClick={handleVisibility}
73-
style={{
74-
fontSize: '25px',
75-
position: 'absolute',
76-
top: '38%',
77-
right: '2px',
78-
paddingTop: '4.5px'
79-
}}
80-
>
81-
{showPassword ? <AiOutlineEyeInvisible /> : <AiOutlineEye />}
82-
</button>
8381
</div>
8482
)}
8583
</Field>

client/modules/User/components/SignupForm.jsx

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,22 @@ function SignupForm() {
104104
</Field>
105105
<Field name="password">
106106
{(field) => (
107-
<div style={{ position: 'relative' }}>
107+
<div>
108108
<p className="form__field">
109109
<label htmlFor="password" className="form__label">
110110
{t('SignupForm.Password')}
111111
</label>
112+
<button
113+
className="form__eye__icon"
114+
type="button"
115+
onClick={handleVisibility}
116+
>
117+
{showPassword ? (
118+
<AiOutlineEyeInvisible />
119+
) : (
120+
<AiOutlineEye />
121+
)}
122+
</button>
112123
<input
113124
className="form__input"
114125
aria-label={t('SignupForm.PasswordARIA')}
@@ -121,19 +132,6 @@ function SignupForm() {
121132
<span className="form-error">{field.meta.error}</span>
122133
)}
123134
</p>
124-
<button
125-
type="button"
126-
onClick={handleVisibility}
127-
style={{
128-
fontSize: '25px',
129-
position: 'absolute',
130-
top: '38%',
131-
right: '1.5px',
132-
paddingTop: '4.5px'
133-
}}
134-
>
135-
{showPassword ? <AiOutlineEyeInvisible /> : <AiOutlineEye />}
136-
</button>
137135
</div>
138136
)}
139137
</Field>
@@ -144,6 +142,17 @@ function SignupForm() {
144142
<label htmlFor="confirmPassword" className="form__label">
145143
{t('SignupForm.ConfirmPassword')}
146144
</label>
145+
<button
146+
className="form__eye__icon"
147+
type="button"
148+
onClick={handleVisibility}
149+
>
150+
{showPassword ? (
151+
<AiOutlineEyeInvisible />
152+
) : (
153+
<AiOutlineEye />
154+
)}
155+
</button>
147156
<input
148157
className="form__input"
149158
type={showConfirmPassword ? 'text' : 'password'}
@@ -156,23 +165,6 @@ function SignupForm() {
156165
<span className="form-error">{field.meta.error}</span>
157166
)}
158167
</p>
159-
<button
160-
type="button"
161-
onClick={handleConfirmVisibility}
162-
style={{
163-
fontSize: '25px',
164-
position: 'absolute',
165-
top: '38%',
166-
right: '1.5px',
167-
paddingTop: '4px'
168-
}}
169-
>
170-
{showConfirmPassword ? (
171-
<AiOutlineEyeInvisible />
172-
) : (
173-
<AiOutlineEye />
174-
)}
175-
</button>
176168
</div>
177169
)}
178170
</Field>

client/styles/components/_forms.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,22 @@
6666
color: getThemifyVariable("form-input-text-color");
6767
background-color: getThemifyVariable("input-background-color");
6868
}
69-
69+
7070
@media (max-width: 770px) {
7171
max-width: 100%;
72-
width:100%;
72+
width: 100%;
7373
}
7474
}
7575

76+
.form__eye__icon {
77+
font-size: 28px;
78+
position: relative;
79+
top: 5px;
80+
right: -355px;
81+
margin-left: -40px;
82+
}
83+
84+
7685
.form__input[type='password']::-ms-reveal {
7786
display: none;
7887
}

0 commit comments

Comments
 (0)