From e200897cdddf2a15ba90741c603bb025cd978b61 Mon Sep 17 00:00:00 2001 From: ncoelho Date: Fri, 16 Apr 2021 15:14:06 +0200 Subject: [PATCH 1/3] REF: Styling on Addresses list --- components/addresses/AddressItem.js | 19 ++++++-- components/addresses/AddressTypeBadge.js | 6 +-- components/themes.js | 4 ++ screen/wallets/addresses.js | 55 ++++++++++++++---------- screen/wallets/details.js | 17 ++++---- 5 files changed, 62 insertions(+), 39 deletions(-) diff --git a/components/addresses/AddressItem.js b/components/addresses/AddressItem.js index 20102faa4..7581c977a 100644 --- a/components/addresses/AddressItem.js +++ b/components/addresses/AddressItem.js @@ -1,5 +1,5 @@ import React from 'react'; -import { StyleSheet } from 'react-native'; +import { StyleSheet, Text } from 'react-native'; import { useTheme } from '@react-navigation/native'; import { ListItem } from 'react-native-elements'; import Clipboard from '@react-native-clipboard/clipboard'; @@ -18,6 +18,19 @@ const AddressItem = ({ item, balanceUnit }) => { list: { color: colors.buttonTextColor, }, + address: { + fontWeight: '600', + marginHorizontal: 40, + }, + index: { + color: colors.alternativeTextColor, + fontSize: 15, + }, + balance: { + marginTop: 8, + marginLeft: 14, + color: colors.alternativeTextColor, + }, }); const copyAddressToClipboard = () => { @@ -31,9 +44,9 @@ const AddressItem = ({ item, balanceUnit }) => { - {item.index}.{item.address} + {item.index} {item.address} - {balance} + {balance} diff --git a/components/addresses/AddressTypeBadge.js b/components/addresses/AddressTypeBadge.js index b48ba4c19..bcbcda666 100644 --- a/components/addresses/AddressTypeBadge.js +++ b/components/addresses/AddressTypeBadge.js @@ -6,10 +6,8 @@ import loc from '../../loc'; const styles = StyleSheet.create({ container: { - paddingTop: 2, - paddingBottom: 2, - paddingLeft: 8, - paddingRight: 8, + paddingVertical: 4, + paddingHorizontal: 10, borderRadius: 20, }, badgeText: { diff --git a/components/themes.js b/components/themes.js index 9b1bc1938..05e3f496c 100644 --- a/components/themes.js +++ b/components/themes.js @@ -112,6 +112,10 @@ export const BlueDarkTheme = { newBlue: '#007AFF', redBG: '#5A4E4E', redText: '#FC6D6D', + changeBackground: '#5A4E4E', + changeText: '#F38C47', + receiveBackground: 'rgba(210,248,214,.2)', + receiveText: '#37C0A1', }, }; diff --git a/screen/wallets/addresses.js b/screen/wallets/addresses.js index 628f6f4c9..1935c3020 100644 --- a/screen/wallets/addresses.js +++ b/screen/wallets/addresses.js @@ -1,5 +1,5 @@ import React, { useCallback, useState, useContext } from 'react'; -import { ActivityIndicator, FlatList, StyleSheet, View } from 'react-native'; +import { ActivityIndicator, FlatList, StyleSheet, View, StatusBar } from 'react-native'; import { useFocusEffect, useRoute, useTheme } from '@react-navigation/native'; import Privacy from '../../blue_modules/Privacy'; import { BlueStorageContext } from '../../blue_modules/storage-context'; @@ -40,27 +40,6 @@ export const sortByIndexAndType = (a, b) => { if (a.index < b.index) return -1; }; -const styles = StyleSheet.create({ - loading: { - flex: 1, - justifyContent: 'center', - }, - loadMoreButton: { - borderRadius: 9, - minHeight: 49, - paddingHorizontal: 8, - justifyContent: 'center', - alignItems: 'center', - flexDirection: 'row', - alignSelf: 'auto', - flexGrow: 1, - marginHorizontal: 16, - }, - loadMoreText: { - fontSize: 16, - }, -}); - const WalletAddresses = () => { const [showAddresses, setShowAddresses] = useState(false); @@ -117,7 +96,12 @@ const WalletAddresses = () => { const render = () => { if (showAddresses) { - return } />; + return ( + + + } /> + + ); } return ( @@ -134,6 +118,31 @@ WalletAddresses.navigationOptions = navigationStyle({ closeButton: true, title: loc.addresses.addresses_title, headerLeft: null, + gesturesEnabled: false, }); export default WalletAddresses; + +const styles = StyleSheet.create({ + root: { + flex: 1, + }, + loading: { + flex: 1, + justifyContent: 'center', + }, + loadMoreButton: { + borderRadius: 9, + minHeight: 49, + paddingHorizontal: 8, + justifyContent: 'center', + alignItems: 'center', + flexDirection: 'row', + alignSelf: 'auto', + flexGrow: 1, + marginHorizontal: 16, + }, + loadMoreText: { + fontSize: 16, + }, +}); diff --git a/screen/wallets/details.js b/screen/wallets/details.js index 612f8722a..41e438e9a 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -16,7 +16,7 @@ import { StatusBar, PermissionsAndroid, } from 'react-native'; -import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText, SafeBlueArea, SecondButton } from '../../BlueComponents'; +import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText, SafeBlueArea, SecondButton, BlueListItem } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet'; import { HDLegacyBreadwalletWallet } from '../../class/wallets/hd-legacy-breadwallet-wallet'; @@ -520,7 +520,13 @@ const WalletDetails = () => { {wallet.getMasterFingerprintHex()} )} - + + + {(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && ( + + )} + + @@ -542,13 +548,6 @@ const WalletDetails = () => { )} - {(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && ( - <> - - - - )} - {(wallet.type === HDLegacyBreadwalletWallet.type || wallet.type === HDLegacyP2PKHWallet.type || wallet.type === HDSegwitBech32Wallet.type || From 51716c36564cd2675739cbaec0674e5f64d2f9f3 Mon Sep 17 00:00:00 2001 From: marcosrdz Date: Fri, 16 Apr 2021 10:05:55 -0400 Subject: [PATCH 2/3] ADD: Haptic feedback --- components/addresses/AddressItem.js | 4 +++- ios/Podfile.lock | 4 ++-- screen/lnd/lndViewInvoice.js | 4 ++-- screen/wallets/addresses.js | 2 +- screen/wallets/details.js | 17 +++++++++++++---- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/components/addresses/AddressItem.js b/components/addresses/AddressItem.js index 7581c977a..d6518e9c4 100644 --- a/components/addresses/AddressItem.js +++ b/components/addresses/AddressItem.js @@ -6,6 +6,7 @@ import Clipboard from '@react-native-clipboard/clipboard'; import PropTypes from 'prop-types'; import { AddressTypeBadge } from './AddressTypeBadge'; import { formatBalance } from '../../loc'; +import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; const AddressItem = ({ item, balanceUnit }) => { const { colors } = useTheme(); @@ -35,6 +36,7 @@ const AddressItem = ({ item, balanceUnit }) => { const copyAddressToClipboard = () => { Clipboard.setString(item.address); + ReactNativeHapticFeedback.trigger('selection', { ignoreAndroidSystemSettings: false }); }; const balance = formatBalance(item.balance, balanceUnit, true); @@ -44,7 +46,7 @@ const AddressItem = ({ item, balanceUnit }) => { - {item.index} {item.address} + {item.index} {item.address} {balance} diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e6bcacca8..32bba0373 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -384,7 +384,7 @@ PODS: - RNSentry (1.9.0): - React-Core - Sentry (~> 5.2.0) - - RNShare (5.1.4): + - RNShare (5.1.6): - React-Core - RNSVG (12.1.0): - React @@ -740,7 +740,7 @@ SPEC CHECKSUMS: RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d RNSecureKeyStore: f1ad870e53806453039f650720d2845c678d89c8 RNSentry: 1adaa43b01c6a3ab5091d4d1add66b7c58558898 - RNShare: 8af5349f05fc042d230674dd650d19789187ff9c + RNShare: 2db8b0346a4859f83d15528602ed5b6120a0452a RNSVG: ce9d996113475209013317e48b05c21ee988d42e RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59 RNWatch: e4c5d19506c94506860032fb68aedd5991beb985 diff --git a/screen/lnd/lndViewInvoice.js b/screen/lnd/lndViewInvoice.js index 67f90b0c5..8421af5e7 100644 --- a/screen/lnd/lndViewInvoice.js +++ b/screen/lnd/lndViewInvoice.js @@ -282,7 +282,7 @@ const LNDViewInvoice = () => { return ( - {render()} + {render()} ); }; @@ -290,7 +290,7 @@ const LNDViewInvoice = () => { const styles = StyleSheet.create({ root: { flex: 1, - justifyContent: 'space-between', + justifyContent: 'space-between', }, justifyContentCenter: { justifyContent: 'center', diff --git a/screen/wallets/addresses.js b/screen/wallets/addresses.js index 1935c3020..fae0fefe5 100644 --- a/screen/wallets/addresses.js +++ b/screen/wallets/addresses.js @@ -98,7 +98,7 @@ const WalletAddresses = () => { if (showAddresses) { return ( - + } /> ); diff --git a/screen/wallets/details.js b/screen/wallets/details.js index 41e438e9a..62b95ceff 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -16,7 +16,16 @@ import { StatusBar, PermissionsAndroid, } from 'react-native'; -import { BlueCard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText, SafeBlueArea, SecondButton, BlueListItem } from '../../BlueComponents'; +import { + BlueCard, + BlueLoading, + BlueSpacing10, + BlueSpacing20, + BlueText, + SafeBlueArea, + SecondButton, + BlueListItem, +} from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet'; import { HDLegacyBreadwalletWallet } from '../../class/wallets/hd-legacy-breadwallet-wallet'; @@ -522,9 +531,9 @@ const WalletDetails = () => { )} - {(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && ( - - )} + {(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && ( + + )} From 6cd1f9df1912b425dada2c7d63412b2ebeafba6c Mon Sep 17 00:00:00 2001 From: ncoelho Date: Fri, 16 Apr 2021 16:45:15 +0200 Subject: [PATCH 3/3] remove gestures false --- screen/wallets/addresses.js | 1 - 1 file changed, 1 deletion(-) diff --git a/screen/wallets/addresses.js b/screen/wallets/addresses.js index fae0fefe5..413e9e9e5 100644 --- a/screen/wallets/addresses.js +++ b/screen/wallets/addresses.js @@ -118,7 +118,6 @@ WalletAddresses.navigationOptions = navigationStyle({ closeButton: true, title: loc.addresses.addresses_title, headerLeft: null, - gesturesEnabled: false, }); export default WalletAddresses;