Skip to content

Commit 198e3ad

Browse files
authored
Merge pull request #379 from getAlby/chore/revert-toast
chore: revert adding toastify-react-native
2 parents 93aef95 + 6eeced7 commit 198e3ad

File tree

18 files changed

+29
-66
lines changed

18 files changed

+29
-66
lines changed

app/_layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { swrConfiguration } from "lib/swr";
1414
import * as React from "react";
1515
import { GestureHandlerRootView } from "react-native-gesture-handler";
1616
import { SafeAreaView } from "react-native-safe-area-context";
17+
import Toast from "react-native-toast-message";
1718
import { SWRConfig } from "swr";
18-
import ToastManager from "toastify-react-native";
1919
import { toastConfig } from "~/components/ToastConfig";
2020
import { NotificationProvider } from "~/context/Notification";
2121
import { UserInactivityProvider } from "~/context/UserInactivity";
@@ -125,12 +125,11 @@ export default Sentry.wrap(function RootLayout() {
125125
<Slot />
126126
</SessionProvider>
127127
</UserInactivityProvider>
128-
<ToastManager
128+
<Toast
129129
config={toastConfig}
130130
position="bottom"
131131
bottomOffset={140}
132132
topOffset={140}
133-
useModal={false}
134133
/>
135134
</BottomSheetModalProvider>
136135
</GestureHandlerRootView>

components/CreateInvoice.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Clipboard from "expo-clipboard";
33
import { router } from "expo-router";
44
import React from "react";
55
import { Share, View } from "react-native";
6-
import { Toast } from "toastify-react-native";
6+
import Toast from "react-native-toast-message";
77
import DismissableKeyboardView from "~/components/DismissableKeyboardView";
88
import { DualCurrencyInput } from "~/components/DualCurrencyInput";
99
import { CopyIcon, ShareIcon } from "~/components/Icons";

components/ToastConfig.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Link } from "expo-router";
22
import { View } from "react-native";
3+
import { type ToastConfig } from "react-native-toast-message";
34
import { CheckCircleIcon, XCircleIcon } from "~/components/Icons";
45
import { Button } from "./ui/button";
56
import { Text } from "./ui/text";
67

7-
export const toastConfig = {
8-
success: ({ text1, text2 }: { text1: string; text2: string }) => (
8+
export const toastConfig: ToastConfig = {
9+
success: ({ text1, text2 }) => (
910
<View className="bg-foreground rounded-xl px-6 py-3 mx-6">
1011
<View className="flex flex-row gap-2 justify-center items-center">
1112
<CheckCircleIcon className="text-background" width={16} height={16} />
@@ -14,7 +15,7 @@ export const toastConfig = {
1415
{text2 && <Text className="text-background text-center">{text2}</Text>}
1516
</View>
1617
),
17-
info: ({ text1, text2 }: { text1: string; text2: string }) => (
18+
info: ({ text1, text2, hide }) => (
1819
<View className="bg-yellow-500 rounded-full px-6 py-3 mx-6">
1920
<View className="flex flex-row gap-2 justify-center items-center">
2021
<XCircleIcon className="text-background" width={16} height={16} />
@@ -23,7 +24,7 @@ export const toastConfig = {
2324
{text2 && <Text className="text-background text-center">{text2}</Text>}
2425
</View>
2526
),
26-
error: ({ text1, text2 }: { text1: string; text2: string }) => (
27+
error: ({ text1, text2, hide }) => (
2728
<View className="bg-destructive rounded-xl px-6 py-3 mx-6">
2829
<View className="flex flex-row gap-2 justify-center items-center">
2930
<XCircleIcon className="text-background" width={16} height={16} />
@@ -32,7 +33,7 @@ export const toastConfig = {
3233
{text2 && <Text className="text-background text-center">{text2}</Text>}
3334
</View>
3435
),
35-
connectionError: ({ text1 }: { text1: string }) => {
36+
connectionError: ({ text1, text2, hide }) => {
3637
return (
3738
<View className="bg-foreground rounded-xl px-6 py-3 mx-6 flex flex-col gap-2">
3839
<View className="flex flex-row gap-2 justify-center items-center">

components/WalletSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from "@gorhom/bottom-sheet";
77
import React, { useCallback, useMemo, useRef } from "react";
88
import { FlatList, TouchableOpacity, View } from "react-native";
9-
import { Toast } from "toastify-react-native";
9+
import Toast from "react-native-toast-message";
1010
import { ChevronDownIcon, WalletIcon } from "~/components/Icons";
1111
import { Text } from "~/components/ui/text";
1212
import { DEFAULT_WALLET_NAME } from "~/lib/constants";

lib/errorToast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Toast } from "toastify-react-native";
1+
import Toast from "react-native-toast-message";
22

33
export function errorToast(error: Error | unknown) {
44
Toast.show({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@
7676
"react-native-safe-area-context": "^5.6.1",
7777
"react-native-screens": "~4.16.0",
7878
"react-native-svg": "15.12.1",
79+
"react-native-toast-message": "^2.3.3",
7980
"react-native-url-polyfill": "^2.0.0",
8081
"react-native-webview": "13.15.0",
8182
"react-native-worklets": "0.5.1",
8283
"swr": "^2.2.5",
8384
"tailwind-merge": "^2.3.0",
8485
"text-encoding": "^0.7.0",
85-
"toastify-react-native": "^7.2.3",
8686
"yarn": "^1.22.22",
8787
"zustand": "^5.0.6"
8888
},

pages/Transaction.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Link, useLocalSearchParams } from "expo-router";
66
import { nip19 } from "nostr-tools";
77
import React from "react";
88
import { Pressable, ScrollView, TouchableOpacity, View } from "react-native";
9-
import { Toast } from "toastify-react-native";
9+
import Toast from "react-native-toast-message";
1010
import { LinkIcon } from "~/components/Icons";
1111
import AcceptedTransactionIcon from "~/components/icons/AcceptedTransaction";
1212
import FailedTransactionIcon from "~/components/icons/FailedTransaction";

pages/receive/Receive.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as Clipboard from "expo-clipboard";
22
import { router } from "expo-router";
33
import React from "react";
44
import { Share, TouchableOpacity, View } from "react-native";
5-
import { Toast } from "toastify-react-native";
5+
import Toast from "react-native-toast-message";
66
import { CreateInvoice } from "~/components/CreateInvoice";
77
import { AddressIcon, EditIcon, ScanIcon, ShareIcon } from "~/components/Icons";
88
import RedeemIcon from "~/components/icons/RedeemIcon";

pages/send/LNURLPay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { router, useLocalSearchParams } from "expo-router";
22
import React, { useEffect } from "react";
33
import { View } from "react-native";
4-
import { Toast } from "toastify-react-native";
4+
import Toast from "react-native-toast-message";
55
import DismissableKeyboardView from "~/components/DismissableKeyboardView";
66
import { DualCurrencyInput } from "~/components/DualCurrencyInput";
77
import Loading from "~/components/Loading";

pages/settings/FiatCurrency.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { router } from "expo-router";
22
import React, { useEffect, useState } from "react";
33
import { FlatList, TouchableOpacity, View } from "react-native";
4-
import { Toast } from "toastify-react-native";
4+
import Toast from "react-native-toast-message";
55
import { CountryFlag } from "~/components/Flag";
66
import Loading from "~/components/Loading";
77
import Screen from "~/components/Screen";

0 commit comments

Comments
 (0)