From d42b9f75821f5b22e24ade91af0d31bdb5e7fe46 Mon Sep 17 00:00:00 2001 From: qdqd <33158502+qd-qd@users.noreply.github.com> Date: Wed, 6 Apr 2022 12:21:07 +0200 Subject: [PATCH 1/2] style: improve LLD button by passing disabled prop --- src/renderer/components/Button.ui.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/Button.ui.tsx b/src/renderer/components/Button.ui.tsx index e14e75c6b6..ebb8e39545 100644 --- a/src/renderer/components/Button.ui.tsx +++ b/src/renderer/components/Button.ui.tsx @@ -47,7 +47,7 @@ export default function Button({ } }; const inner = ( - + {children} ); From 0d49a284007dbf5b7289f294d1c75a2a348fbd56 Mon Sep 17 00:00:00 2001 From: qdqd <33158502+qd-qd@users.noreply.github.com> Date: Wed, 6 Apr 2022 12:21:51 +0200 Subject: [PATCH 2/2] feat(account): improve the empty state Until now, the header in the account page for an empty account (no txs) wasn't rendered. Because of this, walletconnect button wasn't rendered, you needed some tokens to see it appears. This commit fixes this, from now, walletconnect button and receive/buy buttons would be rendered for any empty accounts. As it is not required to own tokens to use walletconnect, this modification makes sense to me. Regarding the receive/buy buttons, I think it's better to have them always available, even for empty accounts (we missed a business opportunity by hidding the buy button in this case). --- .../screens/account/AccountHeaderActions.js | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/renderer/screens/account/AccountHeaderActions.js b/src/renderer/screens/account/AccountHeaderActions.js index fd147c6b5d..50b0f04ac7 100644 --- a/src/renderer/screens/account/AccountHeaderActions.js +++ b/src/renderer/screens/account/AccountHeaderActions.js @@ -130,6 +130,7 @@ const AccountHeaderSettingsButtonComponent = ({ account, parentAccount, openModa const AccountHeaderActions = ({ account, parentAccount, openModal, t }: Props) => { const mainAccount = getMainAccount(account, parentAccount); const contrastText = useTheme("colors.palette.text.shade60"); + const isAccountHasToken = useMemo(() => !isAccountEmpty(account), [account.id]); const decorators = perFamilyAccountActions[mainAccount.currency.family]; const manage = perFamilyManageActions[mainAccount.currency.family]; @@ -275,21 +276,17 @@ const AccountHeaderActions = ({ account, parentAccount, openModal, t }: Props) = const ManageActionsHeader = manageActions.map(item => renderAction(item)); - const NonEmptyAccountHeader = ( - - {availableOnBuy && BuyHeader} - {availableOnSwap && SwapHeader} - {manageActions.length > 0 && ManageActionsHeader} - {canSend(account, parentAccount) && ( - - )} - - - ); - return ( - {!isAccountEmpty(account) ? NonEmptyAccountHeader : null} + + {availableOnBuy && BuyHeader} + {isAccountHasToken && availableOnSwap && SwapHeader} + {manageActions.length > 0 && ManageActionsHeader} + {isAccountHasToken && canSend(account, parentAccount) && ( + + )} + + ); };