diff --git a/native/account/registration/keyserver-selection.react.js b/native/account/registration/keyserver-selection.react.js
--- a/native/account/registration/keyserver-selection.react.js
+++ b/native/account/registration/keyserver-selection.react.js
@@ -41,6 +41,13 @@
setCurrentSelection('custom');
}, []);
+ let buttonState = 'disabled';
+ if (
+ currentSelection === 'ashoat' ||
+ (currentSelection === 'custom' && customKeyserver)
+ ) {
+ buttonState = 'enabled';
+ }
const onSubmit = React.useCallback(() => {}, []);
const styles = useStyles(unboundStyles);
@@ -93,7 +100,7 @@
/>
-
+
);
}
diff --git a/native/account/registration/registration-button.react.js b/native/account/registration/registration-button.react.js
--- a/native/account/registration/registration-button.react.js
+++ b/native/account/registration/registration-button.react.js
@@ -9,13 +9,34 @@
type Props = {
+onPress: () => mixed,
+label: string,
+ +state?: 'enabled' | 'disabled' | 'loading',
};
function RegistrationButton(props: Props): React.Node {
- const { onPress, label } = props;
+ const { onPress, label, state } = props;
+
const styles = useStyles(unboundStyles);
+ const buttonStyle = React.useMemo(() => {
+ if (state === 'disabled' || state === 'loading') {
+ return [styles.button, styles.disabledButton];
+ } else {
+ return styles.button;
+ }
+ }, [state, styles.button, styles.disabledButton]);
+ const buttonTextStyle = React.useMemo(() => {
+ if (state === 'disabled') {
+ return [styles.buttonText, styles.disabledButtonText];
+ }
+ return styles.buttonText;
+ }, [state, styles.buttonText, styles.disabledButtonText]);
+
return (
-