Skip to content

Commit 198aac5

Browse files
committed
hide transaction balances
1 parent e1ca0b1 commit 198aac5

File tree

1 file changed

+10
-5
lines changed
  • packages/mobile-app/app/(drawer)/account/transaction

1 file changed

+10
-5
lines changed

packages/mobile-app/app/(drawer)/account/transaction/[hash].tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useFacade } from "../../../../data/facades";
1515
import { CurrencyUtils } from "@ironfish/sdk";
1616
import { useQueries } from "@tanstack/react-query";
1717
import { setStringAsync } from "expo-clipboard";
18+
import { useHideBalances } from "@/hooks/useHideBalances";
1819

1920
const ExternalLinkIcon = (props: IconProps) => (
2021
<Icon {...props} name="external-link-outline" />
@@ -53,6 +54,7 @@ const CopyableText = ({ text, style }: { text: string; style?: any }) => {
5354
export default function TransactionDetails() {
5455
const { hash } = useLocalSearchParams<{ hash: string }>();
5556
const facade = useFacade();
57+
const hideBalances = useHideBalances();
5658

5759
const transactionQuery = facade.getTransaction.useQuery(
5860
{
@@ -180,10 +182,12 @@ export default function TransactionDetails() {
180182
{isReceived ? "Received" : "Sent"}
181183
</Text>
182184
<Text category="h2" style={styles.mainAmount}>
183-
{CurrencyUtils.render(
184-
(mainAmount < 0n ? -mainAmount : mainAmount).toString(),
185-
false,
186-
)}{" "}
185+
{hideBalances
186+
? "•••••"
187+
: CurrencyUtils.render(
188+
(mainAmount < 0n ? -mainAmount : mainAmount).toString(),
189+
false,
190+
)}{" "}
187191
{mainAssetName}
188192
</Text>
189193
<Text category="s1" appearance="hint" style={styles.timestamp}>
@@ -239,7 +243,8 @@ export default function TransactionDetails() {
239243
Fee
240244
</Text>
241245
<Text style={styles.value}>
242-
{CurrencyUtils.render(transaction.fee)} $IRON
246+
{hideBalances ? "•••••" : CurrencyUtils.render(transaction.fee)}{" "}
247+
$IRON
243248
</Text>
244249
</View>
245250
<Divider style={styles.divider} />

0 commit comments

Comments
 (0)