fixes login page in tenant admin pwa
This commit is contained in:
@@ -86,6 +86,8 @@ export default function LoginPage(): JSX.Element {
|
||||
},
|
||||
});
|
||||
|
||||
const isSubmitting = (mutation as { isPending?: boolean; isLoading: boolean }).isPending ?? mutation.isLoading;
|
||||
|
||||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
setError(null);
|
||||
@@ -164,11 +166,21 @@ export default function LoginPage(): JSX.Element {
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
className="mt-2 h-12 w-full justify-center rounded-xl bg-gradient-to-r from-[#ff5f87] via-[#ec4899] to-[#6366f1] text-base font-semibold shadow-[0_18px_35px_-18px_rgba(236,72,153,0.7)] transition hover:from-[#ff4470] hover:via-[#ec4899] hover:to-[#4f46e5]"
|
||||
disabled={mutation.isLoading}
|
||||
className={`mt-2 h-12 w-full justify-center rounded-xl bg-gradient-to-r from-[#ff5f87] via-[#ec4899] to-[#6366f1] text-base font-semibold shadow-[0_18px_35px_-18px_rgba(236,72,153,0.7)] transition hover:from-[#ff4470] hover:via-[#ec4899] hover:to-[#4f46e5] ${
|
||||
isSubmitting ? 'cursor-wait opacity-90 saturate-75 shadow-none' : ''
|
||||
}`}
|
||||
disabled={isSubmitting}
|
||||
aria-live="polite"
|
||||
aria-busy={isSubmitting}
|
||||
data-loading={isSubmitting ? 'true' : undefined}
|
||||
>
|
||||
{mutation.isLoading ? <Loader2 className="mr-2 h-5 w-5 animate-spin" /> : null}
|
||||
{mutation.isLoading ? t('login.loading', 'Anmeldung …') : t('login.submit', 'Anmelden')}
|
||||
<span className="flex w-full items-center justify-center gap-2">
|
||||
<Loader2
|
||||
className={`h-5 w-5 text-white transition-opacity ${isSubmitting ? 'animate-spin opacity-100' : 'opacity-0'}`}
|
||||
aria-hidden={!isSubmitting}
|
||||
/>
|
||||
<span>{isSubmitting ? t('login.loading', 'Anmeldung …') : t('login.submit', 'Anmelden')}</span>
|
||||
</span>
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user