From c884f48ede4afde390c7976efa061b8c43f4d09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20V=C3=A9lez?= Date: Fri, 8 Oct 2021 14:51:27 -0400 Subject: [PATCH] Update details.js --- screen/transactions/details.js | 188 ++++++++++++++++----------------- 1 file changed, 91 insertions(+), 97 deletions(-) diff --git a/screen/transactions/details.js b/screen/transactions/details.js index b507c98ea..10bd1b14f 100644 --- a/screen/transactions/details.js +++ b/screen/transactions/details.js @@ -1,7 +1,7 @@ -import React, { useContext, useEffect, useRef, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { View, ScrollView, TouchableOpacity, Text, TextInput, Linking, StatusBar, StyleSheet, Keyboard } from 'react-native'; import { useNavigation, useRoute, useTheme } from '@react-navigation/native'; -import { BlueCard, BlueCopyToClipboardButton, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents'; +import { BlueCard, BlueCopyToClipboardButton, BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents'; import navigationStyle from '../../components/navigationStyle'; import HandoffComponent from '../../components/handoff'; import loc from '../../loc'; @@ -35,7 +35,6 @@ const TransactionsDetails = () => { const [tx, setTX] = useState(); const [memo, setMemo] = useState(); const { colors } = useTheme(); - const menuRef = useRef(); const stylesHooks = StyleSheet.create({ txLink: { color: colors.alternativeTextColor2, @@ -111,8 +110,6 @@ const TransactionsDetails = () => { }; const handleOnOpenTransactionOnBlockExporerTapped = () => { - menuRef.current?.dismissMenu(); - const url = `https://mempool.space/tx/${tx.hash}`; Linking.canOpenURL(url).then(supported => { if (supported) { @@ -130,113 +127,110 @@ const TransactionsDetails = () => { } return ( - + - - - - - - + + + + + - {from && ( - <> - - {loc.transactions.details_from} - - - {from.filter(onlyUnique).join(', ')} - - )} + {from && ( + <> + + {loc.transactions.details_from} + + + {from.filter(onlyUnique).join(', ')} + + )} - {to && ( - <> - - {loc.transactions.details_to} - - - {arrDiff(from, to.filter(onlyUnique)).join(', ')} - - )} + {to && ( + <> + + {loc.transactions.details_to} + + + {arrDiff(from, to.filter(onlyUnique)).join(', ')} + + )} - {tx.fee && ( - <> - {loc.send.create_fee} - {tx.fee + ' sats'} - - )} + {tx.fee && ( + <> + {loc.send.create_fee} + {tx.fee + ' sats'} + + )} - {tx.hash && ( - <> - - {loc.transactions.txid} - - - {tx.hash} - - )} + {tx.hash && ( + <> + + {loc.transactions.txid} + + + {tx.hash} + + )} - {tx.received && ( - <> - {loc.transactions.details_received} - {dayjs(tx.received).format('LLL')} - - )} + {tx.received && ( + <> + {loc.transactions.details_received} + {dayjs(tx.received).format('LLL')} + + )} - {tx.block_height > 0 && ( - <> - {loc.transactions.details_block} - {tx.block_height} - - )} + {tx.block_height > 0 && ( + <> + {loc.transactions.details_block} + {tx.block_height} + + )} - {tx.inputs && ( - <> - {loc.transactions.details_inputs} - {tx.inputs.length} - - )} + {tx.inputs && ( + <> + {loc.transactions.details_inputs} + {tx.inputs.length} + + )} - {tx.outputs?.length > 0 && ( - <> - {loc.transactions.details_outputs} - {tx.outputs.length} - - )} - 0 && ( + <> + {loc.transactions.details_outputs} + {tx.outputs.length} + + )} + + - - {loc.transactions.details_show_in_block_explorer} - - - - - + {loc.transactions.details_show_in_block_explorer} + + + + ); };