ADD: show message if no wallets has been found during the import

This commit is contained in:
Ivan Vershigora 2021-09-24 17:43:04 +03:00
parent 1e080ec244
commit 1c9b62361e
2 changed files with 13 additions and 1 deletions

View File

@ -481,6 +481,7 @@
"import_discovery_title": "Discovery",
"import_discovery_subtitle": "Choose a wallet from discovered",
"import_discovery_derivation": "Use custom derivation path",
"import_discovery_no_wallets": "No wallets has been found.",
"import_derivation_found": "found",
"import_derivation_found_not": "not found",
"import_derivation_loading": "loading...",

View File

@ -119,7 +119,13 @@ const ImportWalletDiscovery = () => {
<BlueFormLabel>{loc.wallets.import_discovery_subtitle}</BlueFormLabel>
<BlueSpacing20 />
<FlatList data={wallets} keyExtractor={w => w.id} renderItem={renderItem} />
{!loading && wallets.length === 0 ? (
<View style={styles.noWallets}>
<BlueFormLabel>{loc.wallets.import_discovery_no_wallets}</BlueFormLabel>
</View>
) : (
<FlatList data={wallets} keyExtractor={w => w.id} renderItem={renderItem} />
)}
<View style={[styles.center, stylesHook.center]}>
{loading && (
@ -163,6 +169,11 @@ const styles = StyleSheet.create({
buttonContainer: {
height: 45,
},
noWallets: {
flexGrow: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
ImportWalletDiscovery.navigationOptions = navigationStyle({}, opts => ({ ...opts, title: loc.wallets.import_discovery_title }));