@@ -42,7 +42,10 @@ import logger from "~/lib/log";
4242import type { Bolt11Invoice } from "react-native-nitro-ark" ;
4343import { queryClient } from "~/queryClient" ;
4444import { BlinkingCaret } from "~/components/BlinkingCaret" ;
45- import { useBitcoinAmountFormatter } from "~/hooks/useBitcoinAmountFormatter" ;
45+ import {
46+ useBitcoinAmountFormatter ,
47+ useBitcoinAmountUnit ,
48+ } from "~/hooks/useBitcoinAmountFormatter" ;
4649
4750const minAmount = 1 ;
4851const SUBSCRIPTION_RETRY_DELAY_MS = 1000 ;
@@ -185,6 +188,7 @@ const ReceiveScreen = () => {
185188 const iconColor = useIconColor ( ) ;
186189 const colors = useThemeColors ( ) ;
187190 const formatBitcoinAmount = useBitcoinAmountFormatter ( ) ;
191+ const bitcoinAmountUnit = useBitcoinAmountUnit ( ) ;
188192 const { amount, setAmount, currency, toggleCurrency, amountSat, btcPrice, fiatCurrency } =
189193 useReceiveScreen ( ) ;
190194 const fiatCurrencyInfo = getFiatCurrencyInfo ( fiatCurrency ) ;
@@ -238,6 +242,9 @@ const ReceiveScreen = () => {
238242 const hasEnteredAmount = amount . trim ( ) . length > 0 ;
239243 const isEnteredAmountInvalid = hasEnteredAmount && amountSat < minAmount ;
240244 const displayAmount = amount === "" ? ( currency === "FIAT" ? "0.00" : "0" ) : amount ;
245+ const amountPrefix =
246+ currency === "FIAT" ? fiatCurrencyInfo . symbol : bitcoinAmountUnit === "bip177" ? "₿" : null ;
247+ const amountSuffix = currency === "SATS" && bitcoinAmountUnit === "sats" ? "sats" : null ;
241248 const [ isAmountFocused , setIsAmountFocused ] = useState ( false ) ;
242249
243250 const stopSubscription = useCallback (
@@ -705,9 +712,11 @@ const ReceiveScreen = () => {
705712 < View className = "self-center" >
706713 < Pressable onPress = { focusAmountInput } disabled = { isAmountLocked } >
707714 < View className = "flex-row items-center justify-center" >
708- < Text className = "mr-3 text-[46px] font-bold leading-[52px] text-foreground" >
709- { currency === "FIAT" ? fiatCurrencyInfo . symbol : "₿" }
710- </ Text >
715+ { amountPrefix ? (
716+ < Text className = "mr-3 text-[46px] font-bold leading-[52px] text-foreground" >
717+ { amountPrefix }
718+ </ Text >
719+ ) : null }
711720 < Text className = "text-[46px] font-bold leading-[52px] text-foreground" >
712721 { displayAmount }
713722 </ Text >
@@ -716,6 +725,11 @@ const ReceiveScreen = () => {
716725 height = { 40 }
717726 visible = { isAmountFocused && ! isAmountLocked }
718727 />
728+ { amountSuffix ? (
729+ < Text className = "ml-3 text-2xl font-bold text-muted-foreground" >
730+ { amountSuffix }
731+ </ Text >
732+ ) : null }
719733 </ View >
720734 </ Pressable >
721735 </ View >
0 commit comments