ADD: Haptic feedback

This commit is contained in:
marcosrdz 2021-04-16 10:05:55 -04:00
parent e200897cdd
commit 51716c3656
5 changed files with 21 additions and 10 deletions

View File

@ -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 }) => {
<ListItem key={`${item.key}`} button onPress={copyAddressToClipboard} containerStyle={styles.container}>
<ListItem.Content style={styles.list}>
<ListItem.Title style={styles.list} numberOfLines={1} ellipsizeMode="middle">
<Text style={styles.index}>{item.index}</Text> <Text style={styles.address}>{item.address}</Text>
<Text style={styles.index}>{item.index}</Text> <Text style={styles.address}>{item.address}</Text>
</ListItem.Title>
<ListItem.Subtitle style={[styles.list, styles.balance]}>{balance}</ListItem.Subtitle>
</ListItem.Content>

View File

@ -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

View File

@ -282,7 +282,7 @@ const LNDViewInvoice = () => {
return (
<SafeBlueArea onLayout={onLayout}>
<StatusBar barStyle="default" />
{render()}
{render()}
</SafeBlueArea>
);
};

View File

@ -98,7 +98,7 @@ const WalletAddresses = () => {
if (showAddresses) {
return (
<View style={stylesHook.root}>
<StatusBar barStyle="light-content" />
<StatusBar barStyle="light-content" />
<FlatList style={stylesHook.root} data={addresses} renderItem={item => <AddressItem {...item} balanceUnit={balanceUnit} />} />
</View>
);

View File

@ -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 = () => {
)}
</View>
</BlueCard>
{(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && (
<BlueListItem onPress={navigateToAddresses} title={loc.wallets.details_show_addresses} chevron />
)}
{(wallet instanceof AbstractHDElectrumWallet || (wallet.type === WatchOnlyWallet.type && wallet.isHd())) && (
<BlueListItem onPress={navigateToAddresses} title={loc.wallets.details_show_addresses} chevron />
)}
<BlueCard style={styles.address}>
<View>
<BlueSpacing20 />