Skip to content
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
15 changes: 6 additions & 9 deletions components/AlbyBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { router } from "expo-router";
import { useState } from "react";
import { TouchableOpacity, View } from "react-native";
import { XIcon } from "~/components/Icons";
import { Text } from "~/components/ui/text";
import { ALBY_LIGHTNING_ADDRESS } from "~/lib/constants";
import { initiatePaymentFlow } from "~/lib/initiatePaymentFlow";
import { useAppStore } from "~/lib/state/appStore";
import { Button } from "./ui/button";

Expand Down Expand Up @@ -54,14 +54,11 @@ function AlbyBanner() {
variant="secondary"
size="sm"
className="flex-1"
onPress={() => {
router.navigate({
pathname: "/send",
params: {
url: ALBY_LIGHTNING_ADDRESS,
amount: value,
},
});
onPress={async () => {
await initiatePaymentFlow(
ALBY_LIGHTNING_ADDRESS,
value.toString(),
);
}}
>
<Text>
Expand Down
11 changes: 3 additions & 8 deletions components/Contact.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { darken, lighten } from "colorizr";
import { router } from "expo-router";
import pastellify from "pastellify";
import { TouchableOpacity, View } from "react-native";
import { TrashLineIcon } from "~/components/Icons";
import { Text } from "~/components/ui/text";
import { initiatePaymentFlow } from "~/lib/initiatePaymentFlow";

export default function Contact({
lnAddress,
Expand All @@ -17,13 +17,8 @@ export default function Contact({
return (
<TouchableOpacity
className="flex flex-row items-center gap-4 px-6 py-4"
onPress={() => {
router.navigate({
pathname: "/send",
params: {
url: lnAddress,
},
});
onPress={async () => {
await initiatePaymentFlow(lnAddress);
}}
>
<View
Expand Down
2 changes: 1 addition & 1 deletion components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Screen({ title, animation, right, left }: ScreenProps) {
<Stack.Screen
options={{
title,
animation,
animation: animation ? animation : "slide_from_right",
headerLeft: left
? left
: ({ canGoBack }) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/initiatePaymentFlow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { convertMerchantQRToLightningAddress } from "~/lib/merchants";

export async function initiatePaymentFlow(
text: string,
amount: string,
amount = "",
): Promise<boolean> {
// Some apps use uppercased LIGHTNING: prefixes
text = text.toLowerCase();
Expand Down
Loading