1- import { openURL } from "expo-linking" ;
21import { router , useLocalSearchParams } from "expo-router" ;
32import { type LNURLPaymentSuccessAction } from "lib/lnurl" ;
43import React from "react" ;
54import { View } from "react-native" ;
65import { Tick } from "~/animations/Tick" ;
76import AlbyGoLogo from "~/components/AlbyGoLogo" ;
8- import { Receiver } from "~/components/Receiver" ;
97import Screen from "~/components/Screen" ;
8+ import { SuccessMessage } from "~/components/SuccessMessage" ;
109import { Button } from "~/components/ui/button" ;
1110import { Text } from "~/components/ui/text" ;
1211import { useGetFiatAmount } from "~/hooks/useGetFiatAmount" ;
1312import { useAppStore } from "~/lib/state/appStore" ;
13+ import { cn } from "~/lib/utils" ;
1414
1515export function PaymentSuccess ( ) {
1616 const getFiatAmount = useGetFiatAmount ( ) ;
@@ -30,61 +30,56 @@ export function PaymentSuccess() {
3030
3131 return (
3232 < View className = "flex-1 flex flex-col" >
33- < Screen title = "" />
34- < View className = "flex-1 gap-8" >
35- < AlbyGoLogo className = "w-52 h-16 mx-auto" />
36- < View className = "flex-1 flex justify-center items-center" >
37- < Tick />
38- </ View >
39- < View className = "flex flex-col items-center gap-2" >
40- < View className = "flex flex-row items-end justify-center" >
41- < Text className = "text-3xl text-foreground font-semibold2" >
42- { bitcoinDisplayFormat === "bip177" && "₿ " }
43- { new Intl . NumberFormat ( ) . format ( Math . ceil ( + amount ) ) }
44- </ Text >
45- { bitcoinDisplayFormat === "sats" && (
46- < Text className = "text-2xl text-muted-foreground font-semibold2" >
47- { " " }
48- sats
49- </ Text >
50- ) }
33+ < Screen title = "Success" />
34+ < View className = "flex-1" >
35+ < AlbyGoLogo className = "w-52 h-16 mx-auto my-4" />
36+ < View className = "flex-1 gap-6" >
37+ < View className = "flex-[0.45] flex justify-center items-center" >
38+ < Tick />
5139 </ View >
52- { getFiatAmount && (
53- < Text className = "text-2xl text-muted-foreground font-semibold2" >
54- { getFiatAmount ( + amount ) }
55- </ Text >
56- ) }
57- </ View >
58- < Receiver lightningAddress = { receiver } />
59- { lnurlSuccessAction && (
60- < View className = "flex flex-col gap-2 items-center" >
61- < Text className = "text-muted-foreground text-center font-semibold2" >
62- Message From Receiver
63- </ Text >
64- { lnurlSuccessAction . tag === "message" && (
65- < Text className = "text-foreground text-center text-xl font-medium2" >
66- { lnurlSuccessAction . message }
40+ < View className = "flex-[0.55] flex flex-col justify-center items-center gap-4" >
41+ < View className = "flex" >
42+ < Text className = "text-2xl text-muted-foreground text-center font-semibold2" >
43+ Sent to
6744 </ Text >
68- ) }
69- { lnurlSuccessAction . tag === "url" && (
70- < >
71- { lnurlSuccessAction . description && (
72- < Text className = "text-foreground text-center text-xl font-medium2" >
73- { lnurlSuccessAction . description }
45+ < Text className = "text-center text-foreground text-2xl font-semibold2" >
46+ { receiver . toLowerCase ( ) . replace ( "lightning:" , "" ) }
47+ </ Text >
48+ </ View >
49+ < View className = "flex items-center" >
50+ < View className = "flex flex-row items-end" >
51+ < Text
52+ className = { cn (
53+ "text-5xl gap-2 font-semibold2 text-muted-foreground" ,
54+ bitcoinDisplayFormat === "bip177" && "leading-[1.5]" ,
55+ ) }
56+ >
57+ -{ bitcoinDisplayFormat === "bip177" && " ₿" } { " " }
58+ </ Text >
59+ < Text
60+ className = { cn (
61+ "text-5xl gap-2 font-semibold2 text-foreground" ,
62+ bitcoinDisplayFormat === "bip177" && "leading-[1.5]" ,
63+ ) }
64+ >
65+ { new Intl . NumberFormat ( ) . format ( Math . ceil ( + amount ) ) }
66+ </ Text >
67+ { bitcoinDisplayFormat === "sats" && (
68+ < Text className = "text-3xl font-semibold2 text-muted-foreground mb-1" >
69+ { " " }
70+ sats
7471 </ Text >
7572 ) }
76- { lnurlSuccessAction . url && (
77- < Button
78- variant = "secondary"
79- onPress = { ( ) => openURL ( lnurlSuccessAction . url ?? "" ) }
80- >
81- < Text > Open Link</ Text >
82- </ Button >
83- ) }
84- </ >
85- ) }
73+ </ View >
74+ { getFiatAmount && (
75+ < Text className = "text-3xl font-semibold2 text-muted-foreground" >
76+ { getFiatAmount ( + amount ) }
77+ </ Text >
78+ ) }
79+ </ View >
80+ < SuccessMessage lnurlSuccessAction = { lnurlSuccessAction } />
8681 </ View >
87- ) }
82+ </ View >
8883 </ View >
8984 < View className = "p-6" >
9085 < Button
0 commit comments