From fe74f742db7a3ff1aac0f5f5bc510ebad99c5266 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Fri, 31 Jul 2020 18:01:04 +0100 Subject: [PATCH] ADD: hodlhodl logout button --- loc/en.json | 1 + screen/wallets/hodlHodlLogin.js | 1 + screen/wallets/hodlHodlMyContracts.js | 40 +++++++++++++++++++++++++-- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/loc/en.json b/loc/en.json index 52adee92b..e4beb9e75 100644 --- a/loc/en.json +++ b/loc/en.json @@ -30,6 +30,7 @@ "network": "Network error" }, "hodl": { + "are_you_sure_you_want_to_logout": "Are you sure you want to logout from HodlHodl?", "cont_address_escrow": "Escrow", "cont_address_to": "To", "cont_buying": "buying", diff --git a/screen/wallets/hodlHodlLogin.js b/screen/wallets/hodlHodlLogin.js index e224f2edf..b50f1a68a 100644 --- a/screen/wallets/hodlHodlLogin.js +++ b/screen/wallets/hodlHodlLogin.js @@ -24,6 +24,7 @@ const HodlHodlLogin = () => { return ( ({ @@ -422,5 +434,29 @@ HodlHodlMyContracts.navigationOptions = ({ navigation }) => ({ headerStyle: { backgroundColor: BlueCurrentTheme.colors.elevated, }, - headerRight: null, + headerRight: () => ( + { + Alert.alert( + loc.hodl.are_you_sure_you_want_to_logout, + '', + [ + { + text: loc._.ok, + onPress: () => { + BlueApp.setHodlHodlApiKey('', ''); + navigation.navigate('WalletsList'); + }, + style: 'default', + }, + { text: loc._.cancel, onPress: () => {}, style: 'cancel' }, + ], + { cancelable: false }, + ); + }} + > + logout + + ), });