* ADD: Dark mode support and Clear button for Is it my address

This commit is contained in:
Marcos Rodriguez Vélez 2020-12-12 13:49:52 -05:00 committed by GitHub
parent 90c0cf212e
commit 19df35f8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 29 deletions

View File

@ -483,8 +483,9 @@
"is_it_my_address": {
"title": "Is it my address?",
"owns": "{label} owns {address}",
"enter_address": "Enter Address:",
"check_address": "Check Address"
"enter_address": "Enter address",
"check_address": "Check address",
"no_wallet_owns_address": "None of the available wallets own the provided address."
},
"cc": {
"change": "Change",

View File

@ -7,12 +7,10 @@ import {
BlueButton,
BlueSpacing10,
BlueSpacing20,
BlueFormLabel,
BlueNavigationStyle,
BlueText,
BlueButtonLink,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
@ -33,6 +31,11 @@ const IsItMyAddress = () => {
text: {
color: colors.foregroundColor,
},
input: {
borderColor: colors.formBorder,
borderBottomColor: colors.formBorder,
backgroundColor: colors.inputBackgroundColor,
},
});
const handleUpdateAddress = nextValue => setAddress(nextValue.trim());
@ -46,6 +49,10 @@ const IsItMyAddress = () => {
}
}
if (_result.length === 0) {
setResult(_result.push(loc.is_it_my_address.no_wallet_owns_address));
}
setResult(_result.join('\n\n'));
};
@ -64,30 +71,38 @@ const IsItMyAddress = () => {
});
};
const clearAddressInput = () => {
setAddress('');
setResult();
};
return (
<SafeBlueArea style={[styles.blueArea, stylesHooks.blueArea]}>
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null} keyboardShouldPersistTaps="handled">
<View style={styles.wrapper}>
<BlueCard style={styles.mainCard}>
<View style={styles.topFormRow}>
<BlueFormLabel>{loc.is_it_my_address.enter_address}</BlueFormLabel>
<View style={[styles.input, stylesHooks.input]}>
<TextInput
style={styles.text}
maxHeight={100}
minHeight={100}
maxWidth="100%"
minWidth="100%"
multiline
editable
placeholder={loc.is_it_my_address.enter_address}
placeholderTextColor="#81868e"
value={address}
onChangeText={handleUpdateAddress}
/>
</View>
<TextInput
style={[styles.text, stylesHooks.text]}
maxHeight={100}
minHeight={100}
maxWidth="100%"
minWidth="100%"
multiline
editable
value={address}
onChangeText={handleUpdateAddress}
/>
<BlueSpacing10 />
<BlueButtonLink title={loc.wallets.import_scan_qr} onPress={importScan} />
<BlueSpacing10 />
<BlueButton title={loc.is_it_my_address.check_address} onPress={checkAddress} />
<BlueButton title={loc.send.input_clear} onPress={clearAddressInput} />
<BlueSpacing20 />
<BlueButton disabled={address.trim().length === 0} title={loc.is_it_my_address.check_address} onPress={checkAddress} />
<BlueSpacing20 />
<BlueText>{result}</BlueText>
</BlueCard>
@ -140,17 +155,16 @@ const styles = StyleSheet.create({
height: 30,
maxHeight: 30,
},
text: {
flex: 1,
borderColor: '#ebebeb',
backgroundColor: '#d2f8d6',
input: {
flexDirection: 'row',
borderWidth: 1,
borderBottomWidth: 0.5,
alignItems: 'center',
borderRadius: 4,
marginTop: 20,
color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 14,
paddingHorizontal: 16,
paddingBottom: 16,
paddingTop: 16,
},
text: {
padding: 8,
minHeight: 33,
color: '#81868e',
},
});