Update isItMyAddress.js

This commit is contained in:
marcosrdz 2020-12-07 13:24:24 -05:00
parent 57ec7c9813
commit 6899d78ea0

View File

@ -14,17 +14,27 @@ import {
} from '../../BlueComponents'; } from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes'; import { BlueCurrentTheme } from '../../components/themes';
import { BlueStorageContext } from '../../blue_modules/storage-context'; import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useNavigation, useRoute } from '@react-navigation/native'; import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
const IsItMyAddress = () => { const IsItMyAddress = () => {
/** @type {AbstractWallet[]} */ /** @type {AbstractWallet[]} */
const wallets = useContext(BlueStorageContext).wallets; const wallets = useContext(BlueStorageContext).wallets;
const navigation = useNavigation(); const { navigate } = useNavigation();
const route = useRoute(); const { name } = useRoute();
const { colors } = useTheme();
const [address, setAddress] = useState(''); const [address, setAddress] = useState('');
const [result, setResult] = useState(''); const [result, setResult] = useState('');
const stylesHooks = StyleSheet.create({
blueArea: {
backgroundColor: colors.background,
},
text: {
color: colors.foregroundColor,
},
});
const handleUpdateAddress = nextValue => setAddress(nextValue.trim()); const handleUpdateAddress = nextValue => setAddress(nextValue.trim());
const checkAddress = async () => { const checkAddress = async () => {
@ -44,18 +54,18 @@ const IsItMyAddress = () => {
}; };
const importScan = async () => { const importScan = async () => {
navigation.navigate('ScanQRCodeRoot', { navigate('ScanQRCodeRoot', {
screen: 'ScanQRCode', screen: 'ScanQRCode',
params: { params: {
launchedBy: route.name, launchedBy: name,
onBarScanned: onBarScanned, onBarScanned,
showFileImportButton: true, showFileImportButton: true,
}, },
}); });
}; };
return ( return (
<SafeBlueArea style={styles.blueArea}> <SafeBlueArea style={[styles.blueArea, stylesHooks.blueArea]}>
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null} keyboardShouldPersistTaps="handled"> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null} keyboardShouldPersistTaps="handled">
<View style={styles.wrapper}> <View style={styles.wrapper}>
<BlueCard style={styles.mainCard}> <BlueCard style={styles.mainCard}>
@ -63,7 +73,7 @@ const IsItMyAddress = () => {
<BlueFormLabel>{loc.is_it_my_address.enter_address}</BlueFormLabel> <BlueFormLabel>{loc.is_it_my_address.enter_address}</BlueFormLabel>
</View> </View>
<TextInput <TextInput
style={styles.text} style={[styles.text, stylesHooks.text]}
maxHeight={100} maxHeight={100}
minHeight={100} minHeight={100}
maxWidth="100%" maxWidth="100%"
@ -111,9 +121,6 @@ const styles = StyleSheet.create({
height: '100%', height: '100%',
width: '100%', width: '100%',
}, },
link: {
color: BlueCurrentTheme.colors.foregroundColor,
},
mainCard: { mainCard: {
padding: 0, padding: 0,
display: 'flex', display: 'flex',