Skip to content

Commit

Permalink
Merge pull request #44 from Gamboster/feat/longPressHideShowBalance
Browse files Browse the repository at this point in the history
Feat: longPress hide/show balance
  • Loading branch information
JohnathanWhite authored May 31, 2022
2 parents 734dd66 + a1787e3 commit 8d40e70
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions src/navigation/wallet/screens/WalletDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ import {Network} from '../../../constants';
import {showBottomNotificationModal} from '../../../store/app/app.actions';
import {startUpdateWalletStatus} from '../../../store/wallet/effects/status/status';
import {findWalletById, isSegwit} from '../../../store/wallet/utils/wallet';
import {updatePortfolioBalance} from '../../../store/wallet/wallet.actions';
import {
toggleHideBalance,
updatePortfolioBalance,
} from '../../../store/wallet/wallet.actions';
import {Key, Wallet} from '../../../store/wallet/wallet.models';
import {
Air,
Expand Down Expand Up @@ -739,20 +742,25 @@ const WalletDetails: React.FC<WalletDetailsScreenProps> = ({route}) => {
<>
<HeaderContainer>
<BalanceContainer>
<Row>
{!hideBalance ? (
<Balance scale={shouldScale(cryptoBalance)}>
{cryptoBalance} {currencyAbbreviation}
</Balance>
) : (
<H2>****</H2>
)}
</Row>
<Row>
{showFiatBalance && !hideBalance && (
<Paragraph>{fiatBalance}</Paragraph>
)}
</Row>
<TouchableOpacity
onLongPress={() => {
dispatch(toggleHideBalance({wallet: fullWalletObj}));
}}>
<Row>
{!hideBalance ? (
<Balance scale={shouldScale(cryptoBalance)}>
{cryptoBalance} {currencyAbbreviation}
</Balance>
) : (
<H2>****</H2>
)}
</Row>
<Row>
{showFiatBalance && !hideBalance && (
<Paragraph>{fiatBalance}</Paragraph>
)}
</Row>
</TouchableOpacity>
{!hideBalance && showBalanceDetailsButton() && (
<TouchableRow
onPress={() => setShowBalanceDetailsModal(true)}>
Expand Down

0 comments on commit 8d40e70

Please sign in to comment.