diff --git a/package.json b/package.json
index 9e77916d25..b1b9765b33 100644
--- a/package.json
+++ b/package.json
@@ -66,12 +66,12 @@
"react": "^18.2.0",
"react-confetti": "^6.1.0",
"react-dom": "^18.2.0",
+ "react-hot-toast": "^2.4.1",
"react-i18next": "^12.3.1",
"react-loading-skeleton": "^3.3.1",
"react-modal": "^3.16.1",
"react-qr-code": "^2.0.12",
"react-router-dom": "^6.14.2",
- "react-toastify": "^9.1.3",
"slip77": "^0.2.0",
"stream": "^0.0.2",
"tailwindcss": "^3.3.3",
diff --git a/src/app/components/InputCopyButton/index.tsx b/src/app/components/InputCopyButton/index.tsx
index e8b8d63daa..274b6eb7c7 100644
--- a/src/app/components/InputCopyButton/index.tsx
+++ b/src/app/components/InputCopyButton/index.tsx
@@ -1,7 +1,7 @@
import { CopyIcon as CopyFilledIcon } from "@bitcoin-design/bitcoin-icons-react/filled";
import { CopyIcon } from "@bitcoin-design/bitcoin-icons-react/outline";
import { useState } from "react";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { classNames } from "~/app/utils";
type Props = {
diff --git a/src/app/components/QrcodeScanner/index.tsx b/src/app/components/QrcodeScanner/index.tsx
index 1ed98920dd..a3c1b54c99 100644
--- a/src/app/components/QrcodeScanner/index.tsx
+++ b/src/app/components/QrcodeScanner/index.tsx
@@ -2,7 +2,7 @@ import { QrCodeIcon } from "@bitcoin-design/bitcoin-icons-react/filled";
import { Html5Qrcode, Html5QrcodeScannerState } from "html5-qrcode";
import { useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import Button from "../Button";
diff --git a/src/app/components/SitePreferences/index.tsx b/src/app/components/SitePreferences/index.tsx
index 64ddc0e04b..23f7c0f2f4 100644
--- a/src/app/components/SitePreferences/index.tsx
+++ b/src/app/components/SitePreferences/index.tsx
@@ -6,7 +6,7 @@ import Toggle from "@components/form/Toggle";
import type { FormEvent } from "react";
import { Fragment, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { PreferencesIcon } from "~/app/icons";
diff --git a/src/app/components/Toast/Toaster.tsx b/src/app/components/Toast/Toaster.tsx
new file mode 100644
index 0000000000..a1568e0385
--- /dev/null
+++ b/src/app/components/Toast/Toaster.tsx
@@ -0,0 +1,12 @@
+import { Toaster as HotToaster } from "react-hot-toast";
+
+export default function Toaster() {
+ return (
+
+ );
+}
diff --git a/src/app/components/Toast/index.tsx b/src/app/components/Toast/index.tsx
new file mode 100644
index 0000000000..e4247cbabd
--- /dev/null
+++ b/src/app/components/Toast/index.tsx
@@ -0,0 +1,63 @@
+import { CrossIcon } from "@bitcoin-design/bitcoin-icons-react/outline";
+import { Transition } from "@headlessui/react";
+import { ReactNode } from "react";
+import {
+ CheckmarkIcon,
+ ErrorIcon,
+ ToastOptions,
+ toast as hotToast,
+} from "react-hot-toast";
+
+type ToastType = "error" | "success";
+
+interface ToastMethods {
+ success: (message: string | ReactNode, options?: ToastOptions) => void;
+ error: (message: string | ReactNode, options?: ToastOptions) => void;
+ custom: (
+ children: ReactNode,
+ type: ToastType,
+ options?: ToastOptions
+ ) => void;
+}
+
+const toast: ToastMethods = {
+ success: (message: string | ReactNode, options?: ToastOptions) => {
+ toast.custom(message, "success", options);
+ },
+ error: (message: string | ReactNode, options?: ToastOptions) => {
+ toast.custom(message, "error", { duration: options?.duration ?? 8_000 });
+ },
+ custom: (children: ReactNode, type: ToastType, options?: ToastOptions) => {
+ hotToast.custom(
+ (t: { visible: boolean; id: string }) => (
+
+
+
+ {type == "success" && }
+ {type == "error" && }
+
+
{children}
+ {/* Add close icons for toasts that are displayed for a longer time */}
+ {options?.duration && options?.duration > 10_000 && (
+
hotToast.dismiss(t.id)}
+ />
+ )}
+
+
+ ),
+ options
+ );
+ },
+};
+
+export default toast;
diff --git a/src/app/components/toasts/ConnectionErrorToast.tsx b/src/app/components/toasts/ConnectionErrorToast.tsx
index ab9cd05318..ba0d2cb799 100644
--- a/src/app/components/toasts/ConnectionErrorToast.tsx
+++ b/src/app/components/toasts/ConnectionErrorToast.tsx
@@ -13,10 +13,11 @@ export default function ConnectionErrorToast({
const { t: tCommon } = useTranslation("common");
return (
<>
-
- {tCommon("errors.connection_failed")}
-
({message})
+
+ {tCommon("errors.connection_failed")} (
+ {message})
+
{t("what_you_can_do")}
- {t("double_check")}
diff --git a/src/app/components/toasts/LoginFailedToast.tsx b/src/app/components/toasts/LoginFailedToast.tsx
deleted file mode 100644
index 53bed38597..0000000000
--- a/src/app/components/toasts/LoginFailedToast.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { useTranslation } from "react-i18next";
-
-export default function LoginFailedToast({
- passwordResetUrl,
-}: {
- passwordResetUrl: string;
-}) {
- const { t } = useTranslation("components", {
- keyPrefix: "toasts",
- });
- return (
- <>
- {t("errors.invalid_credentials")}
-
-
- {t("login_failed.password_reset")}
-
-
- >
- );
-}
diff --git a/src/app/context/AccountContext.tsx b/src/app/context/AccountContext.tsx
index eb1c782ad8..db0779f72d 100644
--- a/src/app/context/AccountContext.tsx
+++ b/src/app/context/AccountContext.tsx
@@ -5,7 +5,7 @@ import {
useEffect,
useState,
} from "react";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import api from "~/common/lib/api";
import msg from "~/common/lib/msg";
diff --git a/src/app/context/SettingsContext.tsx b/src/app/context/SettingsContext.tsx
index 0a3ba56e52..64ced88319 100644
--- a/src/app/context/SettingsContext.tsx
+++ b/src/app/context/SettingsContext.tsx
@@ -1,7 +1,7 @@
import dayjs from "dayjs";
import i18n from "i18next";
import { createContext, useContext, useEffect, useRef, useState } from "react";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { setTheme } from "~/app/utils";
import { ACCOUNT_CURRENCIES, CURRENCIES } from "~/common/constants";
import api from "~/common/lib/api";
diff --git a/src/app/hooks/useInvoices.ts b/src/app/hooks/useInvoices.ts
index 7e0d47bb95..a9c2bb3a1f 100644
--- a/src/app/hooks/useInvoices.ts
+++ b/src/app/hooks/useInvoices.ts
@@ -1,6 +1,6 @@
import dayjs from "dayjs";
import { useCallback, useState } from "react";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import api from "~/common/lib/api";
import { Transaction } from "~/types";
diff --git a/src/app/hooks/useTransactions.ts b/src/app/hooks/useTransactions.ts
index dff7c16c48..7fc62c0fc7 100644
--- a/src/app/hooks/useTransactions.ts
+++ b/src/app/hooks/useTransactions.ts
@@ -1,5 +1,5 @@
import { useCallback, useState } from "react";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { convertPaymentsToTransactions } from "~/app/utils/payments";
import api from "~/common/lib/api";
diff --git a/src/app/router/Options/Options.tsx b/src/app/router/Options/Options.tsx
index 9211a8ec63..005b65a5f7 100644
--- a/src/app/router/Options/Options.tsx
+++ b/src/app/router/Options/Options.tsx
@@ -19,9 +19,9 @@ import Transactions from "@screens/Transactions";
import Unlock from "@screens/Unlock";
import { useTranslation } from "react-i18next";
import { HashRouter, Navigate, Outlet, Route, Routes } from "react-router-dom";
-import { ToastContainer } from "react-toastify";
import AccountDetailLayout from "~/app/components/AccountDetailLayout";
import ScrollToTop from "~/app/components/ScrollToTop";
+import Toaster from "~/app/components/Toast/Toaster";
import Providers from "~/app/context/Providers";
import RequireAuth from "~/app/router/RequireAuth";
import { getConnectorRoutes, renderRoutes } from "~/app/router/connectorRoutes";
@@ -148,7 +148,7 @@ function Options() {
element={
<>
-
+
>
}
/>
@@ -170,12 +170,7 @@ const Layout = () => {
{tCommon("wallet")}
-
-
+
);
diff --git a/src/app/router/Options/index.tsx b/src/app/router/Options/index.tsx
index 4108254cdf..996790e005 100644
--- a/src/app/router/Options/index.tsx
+++ b/src/app/router/Options/index.tsx
@@ -1,7 +1,6 @@
import { createRoot } from "react-dom/client";
import "react-loading-skeleton/dist/skeleton.css";
import Modal from "react-modal";
-import "react-toastify/dist/ReactToastify.css";
import "~/app/styles/index.css";
import { setTheme } from "~/app/utils";
import "~/i18n/i18nConfig";
diff --git a/src/app/router/Popup/Popup.tsx b/src/app/router/Popup/Popup.tsx
index ddf30fcdcd..b3278cd1e1 100644
--- a/src/app/router/Popup/Popup.tsx
+++ b/src/app/router/Popup/Popup.tsx
@@ -8,15 +8,15 @@ import LNURLPay from "@screens/LNURLPay";
import LNURLWithdraw from "@screens/LNURLWithdraw";
import Receive from "@screens/Receive";
import Send from "@screens/Send";
-import ScanQRCode from "~/app/screens/ScanQRCode";
import Unlock from "@screens/Unlock";
import { HashRouter, Outlet, Route, Routes } from "react-router-dom";
-import { ToastContainer } from "react-toastify";
import Providers from "~/app/context/Providers";
import LNURLRedeem from "~/app/screens/LNURLRedeem";
import OnChainReceive from "~/app/screens/OnChainReceive";
+import ScanQRCode from "~/app/screens/ScanQRCode";
import SendToBitcoinAddress from "~/app/screens/SendToBitcoinAddress";
+import Toaster from "~/app/components/Toast/Toaster";
import RequireAuth from "../RequireAuth";
function Popup() {
@@ -54,7 +54,7 @@ function Popup() {
element={
<>
-
+
>
}
/>
@@ -71,7 +71,7 @@ const Layout = () => {
-
+
);
diff --git a/src/app/router/Popup/index.tsx b/src/app/router/Popup/index.tsx
index 5ec6dfdabd..861c61dfcb 100644
--- a/src/app/router/Popup/index.tsx
+++ b/src/app/router/Popup/index.tsx
@@ -1,6 +1,5 @@
import { createRoot } from "react-dom/client";
import "react-loading-skeleton/dist/skeleton.css";
-import "react-toastify/dist/ReactToastify.css";
import "~/app/styles/index.css";
import { setTheme } from "~/app/utils";
import "~/i18n/i18nConfig";
diff --git a/src/app/router/Prompt/Prompt.tsx b/src/app/router/Prompt/Prompt.tsx
index ca93228fcf..3f4b13d4a9 100644
--- a/src/app/router/Prompt/Prompt.tsx
+++ b/src/app/router/Prompt/Prompt.tsx
@@ -18,8 +18,8 @@ import NostrConfirmSignMessage from "@screens/Nostr/ConfirmSignMessage";
import NostrConfirmSignSchnorr from "@screens/Nostr/ConfirmSignSchnorr";
import Unlock from "@screens/Unlock";
import { HashRouter, Navigate, Outlet, Route, Routes } from "react-router-dom";
-import { ToastContainer } from "react-toastify";
import AlbyLogo from "~/app/components/AlbyLogo";
+import Toaster from "~/app/components/Toast/Toaster";
import Providers from "~/app/context/Providers";
import RequireAuth from "~/app/router/RequireAuth";
import BitcoinConfirmGetAddress from "~/app/screens/Bitcoin/ConfirmGetAddress";
@@ -140,7 +140,7 @@ function Prompt() {
element={
<>
-
+
>
}
/>
@@ -153,7 +153,7 @@ function Prompt() {
const Layout = () => {
return (
<>
-
+
diff --git a/src/app/router/Prompt/index.tsx b/src/app/router/Prompt/index.tsx
index ad0f0252bd..9478a9cccb 100644
--- a/src/app/router/Prompt/index.tsx
+++ b/src/app/router/Prompt/index.tsx
@@ -1,6 +1,5 @@
import { createRoot } from "react-dom/client";
import "react-loading-skeleton/dist/skeleton.css";
-import "react-toastify/dist/ReactToastify.css";
import "~/app/styles/index.css";
import { setTheme } from "~/app/utils";
import "~/i18n/i18nConfig";
diff --git a/src/app/router/Welcome/Welcome.tsx b/src/app/router/Welcome/Welcome.tsx
index 2966487f1f..e4bd3b04c8 100644
--- a/src/app/router/Welcome/Welcome.tsx
+++ b/src/app/router/Welcome/Welcome.tsx
@@ -5,8 +5,8 @@ import ChooseConnector from "@screens/connectors/ChooseConnector";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Outlet, Route, HashRouter as Router, Routes } from "react-router-dom";
-import { ToastContainer } from "react-toastify";
import Container from "~/app/components/Container";
+import Toaster from "~/app/components/Toast/Toaster";
import { SettingsProvider } from "~/app/context/SettingsContext";
import { getConnectorRoutes, renderRoutes } from "~/app/router/connectorRoutes";
import ChooseConnectorPath from "~/app/screens/connectors/ChooseConnectorPath";
@@ -18,11 +18,7 @@ function Welcome() {
return (
-
+
}>
} />
diff --git a/src/app/router/Welcome/index.tsx b/src/app/router/Welcome/index.tsx
index fa595d49a6..960a944f1e 100644
--- a/src/app/router/Welcome/index.tsx
+++ b/src/app/router/Welcome/index.tsx
@@ -1,7 +1,6 @@
import { createRoot } from "react-dom/client";
import "react-loading-skeleton/dist/skeleton.css";
import Modal from "react-modal";
-import "react-toastify/dist/ReactToastify.css";
import "~/app/styles/index.css";
import { setTheme } from "~/app/utils";
import "~/i18n/i18nConfig";
diff --git a/src/app/screens/Accounts/BackupMnemonic/index.tsx b/src/app/screens/Accounts/BackupMnemonic/index.tsx
index 8cf22196b1..395dfaf736 100644
--- a/src/app/screens/Accounts/BackupMnemonic/index.tsx
+++ b/src/app/screens/Accounts/BackupMnemonic/index.tsx
@@ -3,9 +3,9 @@ import Loading from "@components/Loading";
import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
import Button from "~/app/components/Button";
import { ContentBox } from "~/app/components/ContentBox";
+import toast from "~/app/components/Toast";
import MnemonicDescription from "~/app/components/mnemonic/MnemonicDescription";
import MnemonicInputs from "~/app/components/mnemonic/MnemonicInputs";
import api from "~/common/lib/api";
diff --git a/src/app/screens/Accounts/Detail/index.tsx b/src/app/screens/Accounts/Detail/index.tsx
index c782085159..e120192a30 100644
--- a/src/app/screens/Accounts/Detail/index.tsx
+++ b/src/app/screens/Accounts/Detail/index.tsx
@@ -11,13 +11,13 @@ import { useCallback, useEffect, useRef, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import QRCode from "react-qr-code";
import { Link, useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
import Badge from "~/app/components/Badge";
import Hyperlink from "~/app/components/Hyperlink";
import InputCopyButton from "~/app/components/InputCopyButton";
import MenuDivider from "~/app/components/Menu/MenuDivider";
import Modal from "~/app/components/Modal";
+import toast from "~/app/components/Toast";
import Select from "~/app/components/form/Select";
import Toggle from "~/app/components/form/Toggle";
import { useAccount } from "~/app/context/AccountContext";
diff --git a/src/app/screens/Accounts/GenerateMnemonic/index.tsx b/src/app/screens/Accounts/GenerateMnemonic/index.tsx
index 8dc6d6e18a..a9d4843162 100644
--- a/src/app/screens/Accounts/GenerateMnemonic/index.tsx
+++ b/src/app/screens/Accounts/GenerateMnemonic/index.tsx
@@ -3,10 +3,10 @@ import Loading from "@components/Loading";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
import Button from "~/app/components/Button";
import { ContentBox } from "~/app/components/ContentBox";
+import toast from "~/app/components/Toast";
import Checkbox from "~/app/components/form/Checkbox";
import MnemonicInputs from "~/app/components/mnemonic/MnemonicInputs";
import api from "~/common/lib/api";
diff --git a/src/app/screens/Accounts/ImportMnemonic/index.tsx b/src/app/screens/Accounts/ImportMnemonic/index.tsx
index 246d6ecbea..24117725d7 100644
--- a/src/app/screens/Accounts/ImportMnemonic/index.tsx
+++ b/src/app/screens/Accounts/ImportMnemonic/index.tsx
@@ -5,10 +5,10 @@ import { wordlist } from "@scure/bip39/wordlists/english";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
import Button from "~/app/components/Button";
import { ContentBox } from "~/app/components/ContentBox";
+import toast from "~/app/components/Toast";
import MnemonicInputs from "~/app/components/mnemonic/MnemonicInputs";
import api from "~/common/lib/api";
diff --git a/src/app/screens/Accounts/NostrSettings/index.tsx b/src/app/screens/Accounts/NostrSettings/index.tsx
index dbe7a173bd..7e09f54b6f 100644
--- a/src/app/screens/Accounts/NostrSettings/index.tsx
+++ b/src/app/screens/Accounts/NostrSettings/index.tsx
@@ -3,12 +3,12 @@ import Loading from "@components/Loading";
import { FormEvent, useCallback, useEffect, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { Link, useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
import Button from "~/app/components/Button";
import { ContentBox } from "~/app/components/ContentBox";
import InputCopyButton from "~/app/components/InputCopyButton";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import TextField from "~/app/components/form/TextField";
import api, { GetAccountRes } from "~/common/lib/api";
import { default as nostr, default as nostrlib } from "~/common/lib/nostr";
diff --git a/src/app/screens/ConfirmAddAccount/index.tsx b/src/app/screens/ConfirmAddAccount/index.tsx
index fc3426807d..762a8d6a34 100644
--- a/src/app/screens/ConfirmAddAccount/index.tsx
+++ b/src/app/screens/ConfirmAddAccount/index.tsx
@@ -4,9 +4,9 @@ import ContentMessage from "@components/ContentMessage";
import PublisherCard from "@components/PublisherCard";
import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { toast } from "react-toastify";
import Hyperlink from "~/app/components/Hyperlink";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/ConfirmKeysend/index.tsx b/src/app/screens/ConfirmKeysend/index.tsx
index a84aca566a..785e039402 100644
--- a/src/app/screens/ConfirmKeysend/index.tsx
+++ b/src/app/screens/ConfirmKeysend/index.tsx
@@ -7,8 +7,8 @@ import SuccessMessage from "@components/SuccessMessage";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
diff --git a/src/app/screens/ConfirmPayment/index.tsx b/src/app/screens/ConfirmPayment/index.tsx
index 66c641af81..3badce9ea3 100644
--- a/src/app/screens/ConfirmPayment/index.tsx
+++ b/src/app/screens/ConfirmPayment/index.tsx
@@ -9,8 +9,8 @@ import lightningPayReq from "bolt11";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
diff --git a/src/app/screens/ConfirmSignMessage/index.tsx b/src/app/screens/ConfirmSignMessage/index.tsx
index 6fe4fd06a4..e787872dfb 100644
--- a/src/app/screens/ConfirmSignMessage/index.tsx
+++ b/src/app/screens/ConfirmSignMessage/index.tsx
@@ -7,8 +7,8 @@ import SuccessMessage from "@components/SuccessMessage";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/Enable/index.tsx b/src/app/screens/Enable/index.tsx
index 984736cfce..07a76a6876 100644
--- a/src/app/screens/Enable/index.tsx
+++ b/src/app/screens/Enable/index.tsx
@@ -4,8 +4,8 @@ import Container from "@components/Container";
import PublisherCard from "@components/PublisherCard";
import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { USER_REJECTED_ERROR } from "~/common/constants";
import msg from "~/common/lib/msg";
import type { OriginData } from "~/types";
diff --git a/src/app/screens/Home/AllowanceView/index.tsx b/src/app/screens/Home/AllowanceView/index.tsx
index cce45c87cb..e836e13b15 100644
--- a/src/app/screens/Home/AllowanceView/index.tsx
+++ b/src/app/screens/Home/AllowanceView/index.tsx
@@ -10,7 +10,7 @@ import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import { FC, useEffect, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { PublisherLnData } from "~/app/screens/Home/PublisherLnData";
import { convertPaymentsToTransactions } from "~/app/utils/payments";
diff --git a/src/app/screens/Home/DefaultView/index.tsx b/src/app/screens/Home/DefaultView/index.tsx
index ac05aa058a..4d04bc88b6 100644
--- a/src/app/screens/Home/DefaultView/index.tsx
+++ b/src/app/screens/Home/DefaultView/index.tsx
@@ -12,8 +12,8 @@ import relativeTime from "dayjs/plugin/relativeTime";
import { FC, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import BalanceBox from "~/app/components/BalanceBox";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useInvoices } from "~/app/hooks/useInvoices";
import { useTransactions } from "~/app/hooks/useTransactions";
@@ -89,7 +89,7 @@ const DefaultView: FC = (props) => {
await msg.request("deleteBlocklist", {
host: props.currentUrl.host,
});
- toast.info(
+ toast.success(
t("default_view.block_removed", { host: props.currentUrl.host })
);
}
diff --git a/src/app/screens/Home/PublisherLnData.tsx b/src/app/screens/Home/PublisherLnData.tsx
index e5fb1270a8..487f4b5276 100644
--- a/src/app/screens/Home/PublisherLnData.tsx
+++ b/src/app/screens/Home/PublisherLnData.tsx
@@ -3,7 +3,7 @@ import PublisherCard from "@components/PublisherCard";
import { FC, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import lnurlLib from "~/common/lib/lnurl";
import { isLNURLDetailsError } from "~/common/utils/typeHelpers";
import type { Battery } from "~/types";
diff --git a/src/app/screens/Keysend/index.tsx b/src/app/screens/Keysend/index.tsx
index c84f9390a0..376e576d72 100644
--- a/src/app/screens/Keysend/index.tsx
+++ b/src/app/screens/Keysend/index.tsx
@@ -10,8 +10,8 @@ import DualCurrencyField from "@components/form/DualCurrencyField";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Container from "~/app/components/Container";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
diff --git a/src/app/screens/LNURLChannel/index.tsx b/src/app/screens/LNURLChannel/index.tsx
index 721009da2c..24285bb738 100644
--- a/src/app/screens/LNURLChannel/index.tsx
+++ b/src/app/screens/LNURLChannel/index.tsx
@@ -9,8 +9,8 @@ import axios from "axios";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import api from "~/common/lib/api";
diff --git a/src/app/screens/LNURLPay/index.tsx b/src/app/screens/LNURLPay/index.tsx
index a1d9a0345b..35d26a0326 100644
--- a/src/app/screens/LNURLPay/index.tsx
+++ b/src/app/screens/LNURLPay/index.tsx
@@ -17,10 +17,10 @@ import axios from "axios";
import React, { Fragment, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Header from "~/app/components/Header";
import IconButton from "~/app/components/IconButton";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
@@ -158,7 +158,7 @@ function LNURLPay() {
};
if (!isSuccessResponse(response.data)) {
- toast.warn(response.data.reason);
+ toast.error(response.data.reason);
return;
}
} catch (e) {
@@ -176,7 +176,7 @@ function LNURLPay() {
});
if (!isValidInvoice) {
- toast.warn("Payment aborted: Invalid invoice.");
+ toast.error("Payment aborted: Invalid invoice.");
return;
}
@@ -202,7 +202,7 @@ function LNURLPay() {
break;
case "aes": // TODO: For aes, LN WALLET must attempt to decrypt a ciphertext with payment preimage
default:
- toast.warn(
+ toast.error(
`Not implemented yet. Please submit an issue to support success action: ${paymentInfo.successAction.tag}`
);
break;
diff --git a/src/app/screens/LNURLRedeem/index.tsx b/src/app/screens/LNURLRedeem/index.tsx
index 152d6e9257..75bf9f422c 100644
--- a/src/app/screens/LNURLRedeem/index.tsx
+++ b/src/app/screens/LNURLRedeem/index.tsx
@@ -7,8 +7,8 @@ import TextField from "@components/form/TextField";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useLocation, useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import QrcodeAdornment from "~/app/components/QrcodeAdornment";
+import toast from "~/app/components/Toast";
import { extractLightningTagData } from "~/app/utils";
import lnurlLib from "~/common/lib/lnurl";
import { isLNURLDetailsError } from "~/common/utils/typeHelpers";
diff --git a/src/app/screens/LNURLWithdraw/index.test.tsx b/src/app/screens/LNURLWithdraw/index.test.tsx
index 9810aa4afe..61b5b1bad4 100644
--- a/src/app/screens/LNURLWithdraw/index.test.tsx
+++ b/src/app/screens/LNURLWithdraw/index.test.tsx
@@ -2,13 +2,13 @@ import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { act } from "react-dom/test-utils";
import { MemoryRouter } from "react-router-dom";
-import { ToastContainer } from "react-toastify";
import { settingsFixture as mockSettings } from "~/../tests/fixtures/settings";
import { SettingsProvider } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { makeInvoice } from "~/common/lib/api";
import type { LNURLWithdrawServiceResponse, OriginData } from "~/types";
+import Toaster from "~/app/components/Toast/Toaster";
import LNURLWithdraw from "./index";
const mockDetailsFiatJef: LNURLWithdrawServiceResponse = {
@@ -134,7 +134,7 @@ describe("LNURLWithdraw", () => {
render(
-
+
diff --git a/src/app/screens/LNURLWithdraw/index.tsx b/src/app/screens/LNURLWithdraw/index.tsx
index 7ff4b25b8f..0a4cb9dab8 100644
--- a/src/app/screens/LNURLWithdraw/index.tsx
+++ b/src/app/screens/LNURLWithdraw/index.tsx
@@ -9,8 +9,8 @@ import axios from "axios";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
diff --git a/src/app/screens/Liquid/ConfirmSignPset.tsx b/src/app/screens/Liquid/ConfirmSignPset.tsx
index cf2d3cf8b0..119458a732 100644
--- a/src/app/screens/Liquid/ConfirmSignPset.tsx
+++ b/src/app/screens/Liquid/ConfirmSignPset.tsx
@@ -7,10 +7,10 @@ import { TFunction } from "i18next";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Hyperlink from "~/app/components/Hyperlink";
import Loading from "~/app/components/Loading";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import api from "~/common/lib/api";
diff --git a/src/app/screens/Nostr/ConfirmSignMessage.tsx b/src/app/screens/Nostr/ConfirmSignMessage.tsx
index 136abb1971..e96aa04f0d 100644
--- a/src/app/screens/Nostr/ConfirmSignMessage.tsx
+++ b/src/app/screens/Nostr/ConfirmSignMessage.tsx
@@ -7,9 +7,9 @@ import Checkbox from "@components/form/Checkbox";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Hyperlink from "~/app/components/Hyperlink";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/Nostr/ConfirmSignSchnorr.tsx b/src/app/screens/Nostr/ConfirmSignSchnorr.tsx
index 2e62904241..a007415859 100644
--- a/src/app/screens/Nostr/ConfirmSignSchnorr.tsx
+++ b/src/app/screens/Nostr/ConfirmSignSchnorr.tsx
@@ -7,8 +7,8 @@ import Checkbox from "@components/form/Checkbox";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import ScreenHeader from "~/app/components/ScreenHeader";
+import toast from "~/app/components/Toast";
import { useNavigationState } from "~/app/hooks/useNavigationState";
import { USER_REJECTED_ERROR } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/Onboard/SetPassword/index.tsx b/src/app/screens/Onboard/SetPassword/index.tsx
index b7c0031848..9e4179fd63 100644
--- a/src/app/screens/Onboard/SetPassword/index.tsx
+++ b/src/app/screens/Onboard/SetPassword/index.tsx
@@ -3,7 +3,7 @@ import PasswordForm from "@components/PasswordForm";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
const initialFormData = {
diff --git a/src/app/screens/Publishers/Detail/index.tsx b/src/app/screens/Publishers/Detail/index.tsx
index 98b19d17c5..038c6c0639 100644
--- a/src/app/screens/Publishers/Detail/index.tsx
+++ b/src/app/screens/Publishers/Detail/index.tsx
@@ -6,7 +6,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
import { useCallback, useEffect, useRef, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { convertPaymentsToTransactions } from "~/app/utils/payments";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/Publishers/index.tsx b/src/app/screens/Publishers/index.tsx
index 1320fc0e1c..2d957a3421 100644
--- a/src/app/screens/Publishers/index.tsx
+++ b/src/app/screens/Publishers/index.tsx
@@ -4,8 +4,8 @@ import PublishersTable from "@components/PublishersTable";
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Button from "~/app/components/Button";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import { Allowance } from "~/types";
diff --git a/src/app/screens/Receive/index.tsx b/src/app/screens/Receive/index.tsx
index 6d7ea48dca..83f0a884c1 100644
--- a/src/app/screens/Receive/index.tsx
+++ b/src/app/screens/Receive/index.tsx
@@ -15,7 +15,7 @@ import Confetti from "react-confetti";
import { useTranslation } from "react-i18next";
import QRCode from "react-qr-code";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { isAlbyLNDHubAccount, isAlbyOAuthAccount } from "~/app/utils";
diff --git a/src/app/screens/Send/index.tsx b/src/app/screens/Send/index.tsx
index e814635ff5..4c31a1f3b3 100644
--- a/src/app/screens/Send/index.tsx
+++ b/src/app/screens/Send/index.tsx
@@ -8,8 +8,8 @@ import lightningPayReq from "bolt11";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useLocation, useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import QrcodeAdornment from "~/app/components/QrcodeAdornment";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import {
extractLightningTagData,
diff --git a/src/app/screens/SendToBitcoinAddress/index.tsx b/src/app/screens/SendToBitcoinAddress/index.tsx
index ca457bab92..8b1c89d749 100644
--- a/src/app/screens/SendToBitcoinAddress/index.tsx
+++ b/src/app/screens/SendToBitcoinAddress/index.tsx
@@ -12,11 +12,11 @@ import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import Skeleton from "react-loading-skeleton";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
import Container from "~/app/components/Container";
import Hyperlink from "~/app/components/Hyperlink";
import ResultCard from "~/app/components/ResultCard";
+import toast from "~/app/components/Toast";
import { useAccount } from "~/app/context/AccountContext";
import { useSettings } from "~/app/context/SettingsContext";
import { useNavigationState } from "~/app/hooks/useNavigationState";
diff --git a/src/app/screens/Settings/index.tsx b/src/app/screens/Settings/index.tsx
index 32578a97a1..291ac9eb06 100644
--- a/src/app/screens/Settings/index.tsx
+++ b/src/app/screens/Settings/index.tsx
@@ -12,8 +12,8 @@ import type { FormEvent } from "react";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Modal from "~/app/components/Modal";
+import toast from "~/app/components/Toast";
import { useSettings } from "~/app/context/SettingsContext";
import { CURRENCIES } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/connectors/ConnectAlby/index.tsx b/src/app/screens/connectors/ConnectAlby/index.tsx
index 5e73d7be50..b0767443dd 100644
--- a/src/app/screens/connectors/ConnectAlby/index.tsx
+++ b/src/app/screens/connectors/ConnectAlby/index.tsx
@@ -2,8 +2,8 @@ import { GetAccountInformationResponse } from "@getalby/sdk/dist/types";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Button from "~/app/components/Button";
+import toast from "~/app/components/Toast";
import { getAlbyAccountName } from "~/app/utils";
import api from "~/common/lib/api";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/connectors/ConnectBtcpay/index.tsx b/src/app/screens/connectors/ConnectBtcpay/index.tsx
index a185066f0b..5efb6d0376 100644
--- a/src/app/screens/connectors/ConnectBtcpay/index.tsx
+++ b/src/app/screens/connectors/ConnectBtcpay/index.tsx
@@ -7,7 +7,7 @@ import axios from "axios";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import logo from "/static/assets/icons/btcpay.svg";
diff --git a/src/app/screens/connectors/ConnectCitadel/index.tsx b/src/app/screens/connectors/ConnectCitadel/index.tsx
index a5bb40c4b7..eb0be4e6e8 100644
--- a/src/app/screens/connectors/ConnectCitadel/index.tsx
+++ b/src/app/screens/connectors/ConnectCitadel/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/citadel.png";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -6,9 +5,10 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
+import logo from "/static/assets/icons/citadel.png";
export default function ConnectCitadel() {
const navigate = useNavigate();
diff --git a/src/app/screens/connectors/ConnectCommando/index.tsx b/src/app/screens/connectors/ConnectCommando/index.tsx
index db3976901a..19d64b8161 100644
--- a/src/app/screens/connectors/ConnectCommando/index.tsx
+++ b/src/app/screens/connectors/ConnectCommando/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/core_ln.svg";
import Button from "@components/Button";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -7,9 +6,10 @@ import * as secp256k1 from "@noble/secp256k1";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
+import logo from "/static/assets/icons/core_ln.svg";
export default function ConnectCommando() {
const navigate = useNavigate();
diff --git a/src/app/screens/connectors/ConnectEclair/index.tsx b/src/app/screens/connectors/ConnectEclair/index.tsx
index 588f08f3e5..625953a493 100644
--- a/src/app/screens/connectors/ConnectEclair/index.tsx
+++ b/src/app/screens/connectors/ConnectEclair/index.tsx
@@ -4,8 +4,8 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import logo from "/static/assets/icons/eclair.jpg";
diff --git a/src/app/screens/connectors/ConnectGaloy/index.tsx b/src/app/screens/connectors/ConnectGaloy/index.tsx
index 7bae030938..2846baad8c 100644
--- a/src/app/screens/connectors/ConnectGaloy/index.tsx
+++ b/src/app/screens/connectors/ConnectGaloy/index.tsx
@@ -6,7 +6,7 @@ import axios from "axios";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import galoyBitcoinBeach from "/static/assets/icons/galoy_bitcoin_beach.png";
diff --git a/src/app/screens/connectors/ConnectKollider/index.tsx b/src/app/screens/connectors/ConnectKollider/index.tsx
index 49c8fc7702..fdbe1208b4 100644
--- a/src/app/screens/connectors/ConnectKollider/index.tsx
+++ b/src/app/screens/connectors/ConnectKollider/index.tsx
@@ -8,8 +8,8 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import Alert from "~/app/components/Alert";
+import toast from "~/app/components/Toast";
import { ACCOUNT_CURRENCIES } from "~/common/constants";
import msg from "~/common/lib/msg";
diff --git a/src/app/screens/connectors/ConnectLnbits/index.tsx b/src/app/screens/connectors/ConnectLnbits/index.tsx
index bfb4840896..73bfeb07fe 100644
--- a/src/app/screens/connectors/ConnectLnbits/index.tsx
+++ b/src/app/screens/connectors/ConnectLnbits/index.tsx
@@ -5,7 +5,7 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import logo from "/static/assets/icons/lnbits.png";
diff --git a/src/app/screens/connectors/ConnectLnc/index.tsx b/src/app/screens/connectors/ConnectLnc/index.tsx
index 05074ebd84..aed88d1c2d 100644
--- a/src/app/screens/connectors/ConnectLnc/index.tsx
+++ b/src/app/screens/connectors/ConnectLnc/index.tsx
@@ -1,13 +1,13 @@
-import logo from "/static/assets/icons/lnd.png";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
+import logo from "/static/assets/icons/lnd.png";
const initialFormData = Object.freeze({
pairingPhrase: "",
diff --git a/src/app/screens/connectors/ConnectLnd/index.tsx b/src/app/screens/connectors/ConnectLnd/index.tsx
index e8dffc3508..49d9ee708a 100644
--- a/src/app/screens/connectors/ConnectLnd/index.tsx
+++ b/src/app/screens/connectors/ConnectLnd/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/lnd.png";
import { SendIcon } from "@bitcoin-design/bitcoin-icons-react/filled";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
@@ -7,10 +6,11 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useRef, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import utils from "~/common/lib/utils";
+import logo from "/static/assets/icons/lnd.png";
const initialFormData = {
url: "",
@@ -81,7 +81,8 @@ export default function ConnectLnd() {
message={validation.error as string}
link={formData.url}
/>,
- { autoClose: false }
+ // Don't auto-close
+ { duration: 100_000 }
);
}
} catch (e) {
diff --git a/src/app/screens/connectors/ConnectLndHub/index.tsx b/src/app/screens/connectors/ConnectLndHub/index.tsx
index 90ced709a1..9bfb8a6f06 100644
--- a/src/app/screens/connectors/ConnectLndHub/index.tsx
+++ b/src/app/screens/connectors/ConnectLndHub/index.tsx
@@ -6,7 +6,7 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import lndhubBlueWallet from "/static/assets/icons/lndhub_bluewallet.png";
diff --git a/src/app/screens/connectors/ConnectMyNode/index.tsx b/src/app/screens/connectors/ConnectMyNode/index.tsx
index d2da3e8451..86a67d0e73 100644
--- a/src/app/screens/connectors/ConnectMyNode/index.tsx
+++ b/src/app/screens/connectors/ConnectMyNode/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/mynode.png";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -6,10 +5,11 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import utils from "~/common/lib/utils";
+import logo from "/static/assets/icons/mynode.png";
const initialFormData = {
url: "",
diff --git a/src/app/screens/connectors/ConnectRaspiBlitz/index.tsx b/src/app/screens/connectors/ConnectRaspiBlitz/index.tsx
index 41615bbf09..46617484c3 100644
--- a/src/app/screens/connectors/ConnectRaspiBlitz/index.tsx
+++ b/src/app/screens/connectors/ConnectRaspiBlitz/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/raspiblitz.png";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -6,9 +5,10 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
+import logo from "/static/assets/icons/raspiblitz.png";
const initialFormData = Object.freeze({
url: "",
diff --git a/src/app/screens/connectors/ConnectStart9/index.tsx b/src/app/screens/connectors/ConnectStart9/index.tsx
index d3f60bb13d..8a3b8c7af1 100644
--- a/src/app/screens/connectors/ConnectStart9/index.tsx
+++ b/src/app/screens/connectors/ConnectStart9/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/start9.png";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -6,10 +5,11 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import utils from "~/common/lib/utils";
+import logo from "/static/assets/icons/start9.png";
const initialFormData = {
url: "",
diff --git a/src/app/screens/connectors/ConnectUmbrel/index.tsx b/src/app/screens/connectors/ConnectUmbrel/index.tsx
index 6ec5925bd2..abd00cbbc3 100644
--- a/src/app/screens/connectors/ConnectUmbrel/index.tsx
+++ b/src/app/screens/connectors/ConnectUmbrel/index.tsx
@@ -1,4 +1,3 @@
-import logo from "/static/assets/icons/umbrel.png";
import CompanionDownloadInfo from "@components/CompanionDownloadInfo";
import ConnectorForm from "@components/ConnectorForm";
import TextField from "@components/form/TextField";
@@ -6,10 +5,11 @@ import ConnectionErrorToast from "@components/toasts/ConnectionErrorToast";
import { useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
-import { toast } from "react-toastify";
import PasswordViewAdornment from "~/app/components/PasswordViewAdornment";
+import toast from "~/app/components/Toast";
import msg from "~/common/lib/msg";
import utils from "~/common/lib/utils";
+import logo from "/static/assets/icons/umbrel.png";
const initialFormData = {
url: "",
diff --git a/yarn.lock b/yarn.lock
index fbf2b0667d..c8bec2549a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3241,11 +3241,6 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==
-clsx@^1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188"
- integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==
-
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
@@ -5328,6 +5323,11 @@ globby@^6.1.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
+goober@^2.1.10:
+ version "2.1.13"
+ resolved "https://registry.yarnpkg.com/goober/-/goober-2.1.13.tgz#e3c06d5578486212a76c9eba860cbc3232ff6d7c"
+ integrity sha512-jFj3BQeleOoy7t93E9rZ2de+ScC4lQICLwiAQmKMg9F6roKGaLSHoCDYKkWlSafg138jejvq/mTdvmnwDQgqoQ==
+
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
@@ -8672,6 +8672,13 @@ react-dom@^18.2.0:
loose-envify "^1.1.0"
scheduler "^0.23.0"
+react-hot-toast@^2.4.1:
+ version "2.4.1"
+ resolved "https://registry.yarnpkg.com/react-hot-toast/-/react-hot-toast-2.4.1.tgz#df04295eda8a7b12c4f968e54a61c8d36f4c0994"
+ integrity sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==
+ dependencies:
+ goober "^2.1.10"
+
react-i18next@^12.3.1:
version "12.3.1"
resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.3.1.tgz#30134a41a2a71c61dc69c6383504929aed1c99e7"
@@ -8738,13 +8745,6 @@ react-router@6.14.2:
dependencies:
"@remix-run/router" "1.7.2"
-react-toastify@^9.1.3:
- version "9.1.3"
- resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-9.1.3.tgz#1e798d260d606f50e0fab5ee31daaae1d628c5ff"
- integrity sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==
- dependencies:
- clsx "^1.1.1"
-
react@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"