Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the loading state #2177

Merged
merged 5 commits into from
Aug 17, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/screens/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,7 @@ const loginPage = (): JSX.Element => {
}
};

if (
componentLoader ||
loginLoading ||
signinLoading ||
recaptchaLoading ||
loading
) {
if (componentLoader || recaptchaLoading || loading) {
return <Loader />;
}
const socialIconsList = socialMediaLinks.map(({ href, logo, tag }, index) =>
Expand Down Expand Up @@ -435,6 +429,7 @@ const loginPage = (): JSX.Element => {
<div className="position-relative">
<Form.Control
type="email"
disabled={loginLoading}
placeholder={tCommon('enterEmail')}
required
value={formState.email}
Expand Down Expand Up @@ -471,6 +466,7 @@ const loginPage = (): JSX.Element => {
password: e.target.value,
});
}}
disabled={loginLoading}
autoComplete="current-password"
/>
<Button
Expand Down Expand Up @@ -510,6 +506,7 @@ const loginPage = (): JSX.Element => {
<></>
)}
<Button
disabled={loginLoading}
type="submit"
className="mt-3 mb-3 w-100"
value="Login"
Expand Down Expand Up @@ -550,6 +547,7 @@ const loginPage = (): JSX.Element => {
<div>
<Form.Label>{tCommon('firstName')}</Form.Label>
<Form.Control
disabled={signinLoading}
type="text"
id="signfirstname"
className="mb-3"
Expand All @@ -569,6 +567,7 @@ const loginPage = (): JSX.Element => {
<div>
<Form.Label>{tCommon('lastName')}</Form.Label>
<Form.Control
disabled={signinLoading}
type="text"
id="signlastname"
className="mb-3"
Expand All @@ -589,6 +588,7 @@ const loginPage = (): JSX.Element => {
<Form.Label>{tCommon('email')}</Form.Label>
<div className="position-relative">
<Form.Control
disabled={signinLoading}
type="email"
data-testid="signInEmail"
className="mb-3"
Expand Down Expand Up @@ -616,6 +616,7 @@ const loginPage = (): JSX.Element => {
<Form.Label>{tCommon('password')}</Form.Label>
<div className="position-relative">
<Form.Control
disabled={signinLoading}
type={showPassword ? 'text' : 'password'}
data-testid="passwordField"
placeholder={tCommon('password')}
Expand Down Expand Up @@ -770,6 +771,7 @@ const loginPage = (): JSX.Element => {
<Form.Label>{tCommon('confirmPassword')}</Form.Label>
<div className="position-relative">
<Form.Control
disabled={signinLoading}
type={showConfirmPassword ? 'text' : 'password'}
placeholder={tCommon('confirmPassword')}
required
Expand Down Expand Up @@ -851,6 +853,7 @@ const loginPage = (): JSX.Element => {
className="mt-4 w-100 mb-3"
value="Register"
data-testid="registrationBtn"
disabled={signinLoading}
>
{tCommon('register')}
</Button>
Expand Down
Loading