Просмотр исходного кода

Merge pull request #7831 from weseek/imprv/110234-125024-login-form-loading-design

imprv: Don't switch login form  while loading
Yuki Takei 2 лет назад
Родитель
Сommit
30c9ffd875
1 измененных файлов с 12 добавлено и 2 удалено
  1. 12 2
      apps/app/src/components/LoginForm.tsx

+ 12 - 2
apps/app/src/components/LoginForm.tsx

@@ -498,7 +498,12 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
 
         <div className="row">
           <div className="text-right col-12 mt-2 py-2">
-            <a href="#login" id="login" className="link-switch" onClick={switchForm}>
+            <a
+              href="#login"
+              id="login"
+              className="link-switch"
+              style={{ pointerEvents: isLoading ? 'none' : 'auto' }}
+              onClick={switchForm}>
               <i className="icon-fw icon-login"></i>
               {t('Sign in is here')}
             </a>
@@ -534,7 +539,12 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
                 {/* Sign up link */}
                 {isRegistrationEnabled && (
                   <div className="text-right mb-2">
-                    <a href="#register" id="register" className="link-switch" onClick={switchForm}>
+                    <a
+                      href="#register"
+                      id="register"
+                      className="link-switch"
+                      style={{ pointerEvents: isLoading ? 'none' : 'auto' }}
+                      onClick={switchForm}>
                       <i className="ti ti-check-box"></i> {t('Sign up is here')}
                     </a>
                   </div>