@@ -9,6 +9,7 @@ import { EmailField } from '~/common/email-field';
9
9
import { EmailOrPhoneNumberField } from '~/common/email-or-phone-number-field' ;
10
10
import { EmailOrUsernameField } from '~/common/email-or-username-field' ;
11
11
import { EmailOrUsernameOrPhoneNumberField } from '~/common/email-or-username-or-phone-number-field' ;
12
+ import { GlobalError } from '~/common/global-error' ;
12
13
import { OTPField } from '~/common/otp-field' ;
13
14
import { PasswordField } from '~/common/password-field' ;
14
15
import { PhoneNumberField } from '~/common/phone-number-field' ;
@@ -21,7 +22,6 @@ import { useEnvironment } from '~/hooks/use-environment';
21
22
import { useLocalizations } from '~/hooks/use-localizations' ;
22
23
import { useResetPasswordFactor } from '~/hooks/use-reset-password-factor' ;
23
24
import { useSupportEmail } from '~/hooks/use-support-email' ;
24
- import { Alert } from '~/primitives/alert' ;
25
25
import { Button } from '~/primitives/button' ;
26
26
import * as Card from '~/primitives/card' ;
27
27
import * as Icon from '~/primitives/icon' ;
@@ -144,11 +144,7 @@ export function SignInComponentLoaded() {
144
144
< Card . Description > { t ( 'signIn.start.subtitle' , { applicationName } ) } </ Card . Description >
145
145
</ Card . Header >
146
146
147
- < Common . GlobalError >
148
- { ( { message } ) => {
149
- return < Alert > { message } </ Alert > ;
150
- } }
151
- </ Common . GlobalError >
147
+ < GlobalError />
152
148
153
149
< Card . Body >
154
150
< Connections disabled = { isGlobalLoading } />
@@ -313,11 +309,7 @@ export function SignInComponentLoaded() {
313
309
</ Card . Description >
314
310
</ Card . Header >
315
311
316
- < Common . GlobalError >
317
- { ( { message } ) => {
318
- return < Alert > { message } </ Alert > ;
319
- } }
320
- </ Common . GlobalError >
312
+ < GlobalError />
321
313
322
314
< Card . Body >
323
315
< PasswordField
@@ -403,11 +395,7 @@ export function SignInComponentLoaded() {
403
395
</ Card . Description >
404
396
</ Card . Header >
405
397
406
- < Common . GlobalError >
407
- { ( { message } ) => {
408
- return < Alert > { message } </ Alert > ;
409
- } }
410
- </ Common . GlobalError >
398
+ < GlobalError />
411
399
412
400
< Common . Loading >
413
401
{ isSubmitting => {
@@ -466,11 +454,7 @@ export function SignInComponentLoaded() {
466
454
< Card . Description > { t ( 'signIn.backupCodeMfa.subtitle' ) } </ Card . Description >
467
455
</ Card . Header >
468
456
469
- < Common . GlobalError >
470
- { ( { message } ) => {
471
- return < Alert > { message } </ Alert > ;
472
- } }
473
- </ Common . GlobalError >
457
+ < GlobalError />
474
458
475
459
< Card . Body >
476
460
< BackupCodeField />
@@ -541,11 +525,7 @@ export function SignInComponentLoaded() {
541
525
</ Card . Description >
542
526
</ Card . Header >
543
527
544
- < Common . GlobalError >
545
- { ( { message } ) => {
546
- return < Alert > { message } </ Alert > ;
547
- } }
548
- </ Common . GlobalError >
528
+ < GlobalError />
549
529
550
530
< Card . Body >
551
531
< OTPField
@@ -631,11 +611,7 @@ export function SignInComponentLoaded() {
631
611
</ Card . Description >
632
612
</ Card . Header >
633
613
634
- < Common . GlobalError >
635
- { ( { message } ) => {
636
- return < Alert > { message } </ Alert > ;
637
- } }
638
- </ Common . GlobalError >
614
+ < GlobalError />
639
615
640
616
< Card . Body >
641
617
< OTPField
@@ -722,11 +698,7 @@ export function SignInComponentLoaded() {
722
698
</ Card . Description >
723
699
</ Card . Header >
724
700
725
- < Common . GlobalError >
726
- { ( { message } ) => {
727
- return < Alert > { message } </ Alert > ;
728
- } }
729
- </ Common . GlobalError >
701
+ < GlobalError />
730
702
731
703
< Card . Body >
732
704
< SignIn . Action
@@ -765,11 +737,7 @@ export function SignInComponentLoaded() {
765
737
</ Card . Description >
766
738
</ Card . Header >
767
739
768
- < Common . GlobalError >
769
- { ( { message } ) => {
770
- return < Alert > { message } </ Alert > ;
771
- } }
772
- </ Common . GlobalError >
740
+ < GlobalError />
773
741
774
742
< Card . Body >
775
743
< OTPField
@@ -832,11 +800,7 @@ export function SignInComponentLoaded() {
832
800
< Card . Description > { t ( 'signIn.totpMfa.subtitle' , { applicationName } ) } </ Card . Description >
833
801
</ Card . Header >
834
802
835
- < Common . GlobalError >
836
- { ( { message } ) => {
837
- return < Alert > { message } </ Alert > ;
838
- } }
839
- </ Common . GlobalError >
803
+ < GlobalError />
840
804
841
805
< Card . Body >
842
806
< OTPField
@@ -895,11 +859,7 @@ export function SignInComponentLoaded() {
895
859
< Card . Description > { t ( 'signIn.alternativeMethods.subtitle' ) } </ Card . Description >
896
860
</ Card . Header >
897
861
898
- < Common . GlobalError >
899
- { ( { message } ) => {
900
- return < Alert > { message } </ Alert > ;
901
- } }
902
- </ Common . GlobalError >
862
+ < GlobalError />
903
863
904
864
< Card . Body >
905
865
< div className = 'flex flex-col gap-6' >
@@ -1046,11 +1006,7 @@ export function SignInComponentLoaded() {
1046
1006
< Card . Title > { t ( 'signIn.forgotPasswordAlternativeMethods.title' ) } </ Card . Title >
1047
1007
</ Card . Header >
1048
1008
1049
- < Common . GlobalError >
1050
- { ( { message } ) => {
1051
- return < Alert > { message } </ Alert > ;
1052
- } }
1053
- </ Common . GlobalError >
1009
+ < GlobalError />
1054
1010
1055
1011
< Card . Body >
1056
1012
< SignIn . SupportedStrategy
@@ -1181,11 +1137,7 @@ export function SignInComponentLoaded() {
1181
1137
< Card . Title > { t ( 'signIn.resetPassword.title' ) } </ Card . Title >
1182
1138
</ Card . Header >
1183
1139
1184
- < Common . GlobalError >
1185
- { ( { message } ) => {
1186
- return < Alert > { message } </ Alert > ;
1187
- } }
1188
- </ Common . GlobalError >
1140
+ < GlobalError />
1189
1141
1190
1142
< Card . Body >
1191
1143
< div className = 'flex flex-col justify-center gap-4' >
0 commit comments