Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hideBalance option fix #2057

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/components/ui/data-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import {TextProps, View, ViewStyle} from 'react-native';

import {Color} from '@app/colors';
import {Text, TextPosition} from '@app/components/ui/text';
import {Text, TextPosition, TextVariant} from '@app/components/ui/text';
import {createTheme} from '@app/helpers';
import {I18N} from '@app/i18n';

Expand Down Expand Up @@ -49,7 +49,7 @@ export const DataContent = ({
]}>
<View style={styles.titleContainer}>
<Text
t11
variant={TextVariant.t11}
style={[styles.title, bold && styles.boldTitle]}
color={titleColor}
ellipsizeMode="tail"
Expand All @@ -60,16 +60,24 @@ export const DataContent = ({
{title}
</Text>
</View>
{(subtitleI18n || subtitle) && (
{subtitleI18n || subtitle ? (
<Text
t14
variant={TextVariant.t14}
i18n={subtitleI18n!}
i18params={subtitleI18nParams}
color={Color.textBase2}
position={TextPosition.left}
{...(subtitleProps || {})}>
{subtitle}
</Text>
) : (
<Text
variant={TextVariant.t14}
color={Color.textBase2}
position={TextPosition.left}
{...(subtitleProps || {})}>
{''}
</Text>
)}
</View>
);
Expand Down
12 changes: 5 additions & 7 deletions src/components/wallet-row-variant-5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ export const WalletRowVariant5 = ({
{addressString}
</Text>
</CardSmall>
{!hideBalance && (
<DataContent
style={styles.info}
title={item.name}
subtitle={balance.toBalanceString()}
/>
)}
<DataContent
style={styles.info}
title={item.name}
subtitle={!hideBalance ? balance.toBalanceString() : undefined}
/>
</MenuNavigationButton>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/await-for-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export async function awaitForWallet({
initialAddress,
type,
suggestedAddress,
hideBalance,
autoSelectWallet = true,
eventSuffix = '',
}: AwaitForWalletParams): Promise<string> {
Expand Down Expand Up @@ -98,6 +99,7 @@ export async function awaitForWallet({
title,
autoSelectWallet,
initialAddress,
hideBalance,
...event,
});
}
Expand Down
Loading