Fix button ui when disabled (#8056)

This commit is contained in:
Elias Nahum 2024-07-09 07:12:59 +08:00 committed by GitHub
parent 773fcc3494
commit 10135091d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 2 deletions

View file

@ -183,6 +183,7 @@ const EditServerForm = ({
<Button
containerStyle={styles.connectButton}
buttonStyle={styleButtonBackground}
disabledStyle={styleButtonBackground}
disabled={buttonDisabled}
onPress={onUpdate}
testID={saveButtonTestId}

View file

@ -234,7 +234,8 @@ const ForgotPassword = ({componentId, serverUrl, theme}: Props) => {
/>
<Button
testID='forgot.password.button'
buttonStyle={[styles.returnButton, buttonBackgroundStyle(theme, 'lg', 'primary', email ? 'default' : 'disabled'), error ? styles.error : undefined]}
buttonStyle={[styles.returnButton, buttonBackgroundStyle(theme, 'lg', 'primary', 'default'), error ? styles.error : undefined]}
disabledStyle={[styles.returnButton, buttonBackgroundStyle(theme, 'lg', 'primary', 'disabled'), error ? styles.error : undefined]}
disabled={!email}
onPress={submitResetPassword}
>

View file

@ -274,6 +274,7 @@ const LoginForm = ({config, extra, serverDisplayName, launchError, launchType, l
disabled={buttonDisabled}
onPress={onLogin}
buttonStyle={[styles.loginButton, styleButtonBackground]}
disabledStyle={[styles.loginButton, styleButtonBackground]}
testID={signinButtonTestId}
>
{buttonIcon}

View file

@ -236,7 +236,8 @@ const MFA = ({componentId, config, goToHome, license, loginId, password, serverD
/>
<Button
testID='login_mfa.submit'
buttonStyle={[styles.proceedButton, buttonBackgroundStyle(theme, 'lg', 'primary', token ? 'default' : 'disabled'), error ? styles.error : undefined]}
buttonStyle={[styles.proceedButton, buttonBackgroundStyle(theme, 'lg', 'primary', 'default'), error ? styles.error : undefined]}
disabledStyle={[styles.proceedButton, buttonBackgroundStyle(theme, 'lg', 'primary', 'disabled'), error ? styles.error : undefined]}
disabled={!token}
onPress={submit}
>

View file

@ -224,6 +224,7 @@ const ServerForm = ({
onPress={onConnect}
testID={connectButtonTestId}
buttonStyle={styleButtonBackground}
disabledStyle={styleButtonBackground}
>
{buttonIcon}
<FormattedText