Skip to content

Commit

Permalink
fix: lnurl success action links
Browse files Browse the repository at this point in the history
  • Loading branch information
reneaaron committed Sep 25, 2024
1 parent d0ca1d7 commit 355c039
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pages/send/PaymentSuccess.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Link, router, useLocalSearchParams } from "expo-router";
import { router, useLocalSearchParams } from "expo-router";
import { View } from "react-native";
import { Paid } from "~/animations/Paid";
import { Button } from "~/components/ui/button";
import { Text } from "~/components/ui/text";
import Screen from "~/components/Screen";
import { useGetFiatAmount } from "~/hooks/useGetFiatAmount";
import { LNURLPaymentSuccessAction } from "lib/lnurl";
import { openURL } from "expo-linking";

export function PaymentSuccess() {
const getFiatAmount = useGetFiatAmount();
Expand Down Expand Up @@ -47,20 +48,18 @@ export function PaymentSuccess() {
}
{lnurlSuccessAction.tag == "url" &&
<>
<Text className="text-foreground text-center text-2xl font-medium2">
{lnurlSuccessAction.description}
</Text>
{lnurlSuccessAction.description &&
<Text className="text-foreground text-center text-2xl font-medium2">
{lnurlSuccessAction.description}
</Text>
}
{lnurlSuccessAction.url &&
<Link href={lnurlSuccessAction.url}>
<Button variant="secondary">
<Text>Open Link</Text>
</Button>
</Link>
<Button variant="secondary" onPress={() => openURL(lnurlSuccessAction.url ?? "")}>
<Text>Open Link</Text>
</Button>
}
</>
}


</View>}
{originalText !== invoice &&
<View>
Expand Down

0 comments on commit 355c039

Please sign in to comment.