diff --git a/components/TransactionsNavigationHeader.tsx b/components/TransactionsNavigationHeader.tsx index cc1feaa30..841fbfe6c 100644 --- a/components/TransactionsNavigationHeader.tsx +++ b/components/TransactionsNavigationHeader.tsx @@ -35,7 +35,8 @@ const TransactionsNavigationHeader: React.FC unitSwitching = false, }) => { const { hideBalance } = wallet; - const [allowOnchainAddress, setAllowOnchainAddress] = useState(false); + const isLightningWallet = wallet.type === LightningCustodianWallet.type || wallet.type === LightningArkWallet.type; + const [allowOnchainAddress, setAllowOnchainAddress] = useState(isLightningWallet); const { preferredFiatCurrency } = useSettings(); const { direction } = useLocale(); const balanceOpacity = useSharedValue(1); @@ -43,7 +44,7 @@ const TransactionsNavigationHeader: React.FC const previousBalance = useRef(undefined); const verifyIfWalletAllowsOnchainAddress = useCallback(() => { - if (wallet.type === LightningCustodianWallet.type || wallet.type === LightningArkWallet.type) { + if (isLightningWallet) { wallet .allowOnchainAddress() .then((value: boolean) => setAllowOnchainAddress(value)) @@ -52,7 +53,11 @@ const TransactionsNavigationHeader: React.FC setAllowOnchainAddress(false); }); } - }, [wallet]); + }, [isLightningWallet, wallet]); + + useEffect(() => { + setAllowOnchainAddress(isLightningWallet); + }, [isLightningWallet]); useEffect(() => { verifyIfWalletAllowsOnchainAddress(); @@ -205,51 +210,55 @@ const TransactionsNavigationHeader: React.FC {wallet.getLabel()} - - - - {hideBalance ? ( - - ) : ( - - - {balance} - - - )} + + + + + {hideBalance ? ( + + ) : ( + + + {balance} + + + )} + + + + + {unit === BitcoinUnit.LOCAL_CURRENCY ? (preferredFiatCurrency?.endPointKey ?? FiatUnit.USD) : unit} + + + + {(wallet.type === LightningCustodianWallet.type || wallet.type === LightningArkWallet.type) && allowOnchainAddress && ( + + + {loc.lnd.title} + - - - - {unit === BitcoinUnit.LOCAL_CURRENCY ? (preferredFiatCurrency?.endPointKey ?? FiatUnit.USD) : unit} - - - - {(wallet.type === LightningCustodianWallet.type || wallet.type === LightningArkWallet.type) && allowOnchainAddress && ( - - {loc.lnd.title} - - )} + )} + {wallet.type === MultisigHDWallet.type && ( handleManageFundsPressed()}> {loc.multisig.manage_keys} @@ -268,6 +277,10 @@ const styles = StyleSheet.create({ contentContainer: { padding: 15, }, + balanceSection: { + flexDirection: 'column', + alignItems: 'flex-start', + }, walletLabel: { backgroundColor: 'transparent', fontSize: 19, @@ -288,6 +301,10 @@ const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, + manageFundsSection: { + width: '100%', + alignItems: 'flex-start', + }, manageFundsButtonText: { fontWeight: '500', fontSize: 14, diff --git a/screen/wallets/WalletTransactions.tsx b/screen/wallets/WalletTransactions.tsx index 254796708..991143936 100644 --- a/screen/wallets/WalletTransactions.tsx +++ b/screen/wallets/WalletTransactions.tsx @@ -104,7 +104,7 @@ const WalletTransactions: React.FC = ({ route }: { rout backgroundColor: colors.background, }, gradientBackground: { - backgroundColor: headerHeight > 0 ? WalletGradient.headerColorFor(wallet.type) : colors.background, + backgroundColor: WalletGradient.headerColorFor(wallet.type), height: headerHeight > 0 ? headerHeight : '30%', }, activityIndicatorStyle: {