Skip to content

Commit edb66db

Browse files
authored
Login / Register style fixes (#23)
- Add error message styling. - Remove horizontal scrolling.
1 parent d3bb969 commit edb66db

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

src/app/components/Authentication/Login.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class Login extends React.Component<LoginInterfaces.Props, LoginInterface
5959
}
6060

6161
return (
62-
<div className={classnames(styles.root)}>
62+
<div className={classnames(styles.loginRoot)}>
6363
<div className={classnames(styles.welcomeBack)}>
6464
<h1> Welcome! </h1>
6565
<p> Log in to access your dashboard and profile </p>
@@ -132,7 +132,7 @@ export class Login extends React.Component<LoginInterfaces.Props, LoginInterface
132132
</div>
133133
</div>
134134
</div>
135-
<div className="form-row">
135+
<div className={classnames('form-row', styles['error-row'])}>
136136
<div
137137
className={
138138
!errorMessage
@@ -144,7 +144,8 @@ export class Login extends React.Component<LoginInterfaces.Props, LoginInterface
144144
: classnames(
145145
'col text-center mt -0 mb-2 errorMessage',
146146
styles['register-error-active'],
147-
registerStyles.errorMessage,
147+
registerStyles.errorMessageLogin,
148+
styles['login-error-active'],
148149
)
149150
}
150151
>

src/app/components/Authentication/Register.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Register extends React.Component<RegisterInterfaces.Props, Register
9494
}
9595

9696
return (
97-
<div className={classnames(authStyles.root)}>
97+
<div className={classnames(authStyles.registerRoot)}>
9898
<div className={classnames(authStyles.registerMessage)}>
9999
<h1 className={classnames(authStyles['register-h1'])}> Register to CodeCharacter! </h1>
100100
<p> Register now and code your way through!! </p>
@@ -154,7 +154,7 @@ export class Register extends React.Component<RegisterInterfaces.Props, Register
154154
required
155155
/>
156156
<div className={classnames('invalid-feedback', authStyles['register-error'])}>
157-
Enter a valid username.It should have a minimum of 5 characters and must be
157+
Enter a valid username. It should have a minimum of 5 characters and must be
158158
alphanumeric
159159
</div>
160160
</div>

src/app/styles/Authentication.module.css

+25-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
z-index: 10;
99
}
1010

11+
.loginRoot,.registerRoot {
12+
max-width: 100%;
13+
overflow-x: hidden;
14+
user-select: none;
15+
text-align: center;
16+
}
17+
18+
1119
.Authentication .customBtn:focus,
1220
.buttonPanel:focus {
1321
outline: none;
@@ -160,25 +168,29 @@
160168
padding: 9px;
161169
margin-top: 0;
162170
text-align: left;
171+
color: #7a0825;
163172
}
164173
.register-error {
165174
background-color: #fee5d4;
166175
padding: 9px;
167176
margin-top: -20px;
168177
margin-bottom: 10px;
178+
text-align: left;
179+
color: #7a0825;
169180
}
170181

171182
.register-error-inactive {
172183
display: none;
173184
}
174185
.register-error-active {
175186
background-color: #fee5d4;
176-
padding: 9px;
187+
padding: 9px !important;
177188
display: block;
178189
width: 100%;
179190
margin: auto;
180191
margin-top: 10px;
181-
color: red;
192+
color: #7a0825 !important;
193+
text-align: left !important;
182194
}
183195

184196
.login-label {
@@ -188,11 +200,6 @@
188200
font-family: 'Karla', sans-serif;
189201
}
190202

191-
.root {
192-
user-select: none;
193-
text-align: center;
194-
}
195-
196203
.welcomeBack {
197204
margin-top: 57px;
198205
margin-bottom: 10px;
@@ -457,3 +464,14 @@
457464
.main-register-form {
458465
margin-top: 20px;
459466
}
467+
468+
.error-row {
469+
width: 100%;
470+
margin-right: 0;
471+
margin-left: -3px;
472+
}
473+
474+
.login-error-active {
475+
position: relative;
476+
left: 1%;
477+
}

src/app/styles/Register.module.css

+10-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@
1616

1717
.errorMessage {
1818
width: 100%;
19-
margin-top: 0.25rem;
19+
margin-bottom: 0 !important;
2020
font-size: 80%;
21-
color: #dc3545;
21+
color: #7a0825;
22+
text-align: left !important;
23+
}
24+
25+
.errorMessageLogin {
26+
width: 100%;
27+
margin-top: 1.7rem;
28+
font-size: 80%;
29+
color: #7a0825;
2230
}
2331

2432
.checkbox-input {

0 commit comments

Comments
 (0)