Update sonner
This commit is contained in:
@@ -38,15 +38,12 @@ export function useGuaranteePaymentFailedToast() {
|
|||||||
if (!errorCode || errorCode === BookingErrorCodeEnum.TransactionCancelled)
|
if (!errorCode || errorCode === BookingErrorCodeEnum.TransactionCancelled)
|
||||||
return
|
return
|
||||||
|
|
||||||
// setTimeout is needed to show toasts on page load: https://sonner.emilkowal.ski/toast#render-toast-on-page-load
|
|
||||||
setTimeout(() => {
|
|
||||||
const toastType =
|
const toastType =
|
||||||
errorCode === BookingErrorCodeEnum.TransactionCancelled
|
errorCode === BookingErrorCodeEnum.TransactionCancelled
|
||||||
? "warning"
|
? "warning"
|
||||||
: "error"
|
: "error"
|
||||||
|
|
||||||
toast[toastType](errorMessage)
|
toast[toastType](errorMessage)
|
||||||
})
|
|
||||||
const ancillary = searchParams.get("ancillary")
|
const ancillary = searchParams.get("ancillary")
|
||||||
if ((errorCode && ancillary) || errorCode === "AncillaryFailed") {
|
if ((errorCode && ancillary) || errorCode === "AncillaryFailed") {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -41,15 +41,11 @@ export function usePaymentFailedToast() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!errorCode) return
|
if (!errorCode) return
|
||||||
|
|
||||||
// setTimeout is needed to show toasts on page load: https://sonner.emilkowal.ski/toast#render-toast-on-page-load
|
|
||||||
setTimeout(() => {
|
|
||||||
const toastType =
|
const toastType =
|
||||||
errorCode === BookingErrorCodeEnum.TransactionCancelled
|
errorCode === BookingErrorCodeEnum.TransactionCancelled
|
||||||
? "warning"
|
? "warning"
|
||||||
: "error"
|
: "error"
|
||||||
|
|
||||||
toast[toastType](errorMessage)
|
toast[toastType](errorMessage)
|
||||||
})
|
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(searchParams.toString())
|
const queryParams = new URLSearchParams(searchParams.toString())
|
||||||
queryParams.delete("errorCode")
|
queryParams.delete("errorCode")
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
"react-to-print": "^3.1.0",
|
"react-to-print": "^3.1.0",
|
||||||
"server-only": "^0.0.1",
|
"server-only": "^0.0.1",
|
||||||
"slugify": "^1.6.6",
|
"slugify": "^1.6.6",
|
||||||
"sonner": "^1.7.0",
|
"sonner": "^2.0.3",
|
||||||
"supercluster": "^8.0.1",
|
"supercluster": "^8.0.1",
|
||||||
"superjson": "^2.2.2",
|
"superjson": "^2.2.2",
|
||||||
"usehooks-ts": "3.1.1",
|
"usehooks-ts": "3.1.1",
|
||||||
|
|||||||
10
yarn.lock
10
yarn.lock
@@ -8304,7 +8304,7 @@ __metadata:
|
|||||||
schema-dts: "npm:^1.1.5"
|
schema-dts: "npm:^1.1.5"
|
||||||
server-only: "npm:^0.0.1"
|
server-only: "npm:^0.0.1"
|
||||||
slugify: "npm:^1.6.6"
|
slugify: "npm:^1.6.6"
|
||||||
sonner: "npm:^1.7.0"
|
sonner: "npm:^2.0.3"
|
||||||
start-server-and-test: "npm:^2.0.11"
|
start-server-and-test: "npm:^2.0.11"
|
||||||
supercluster: "npm:^8.0.1"
|
supercluster: "npm:^8.0.1"
|
||||||
superjson: "npm:^2.2.2"
|
superjson: "npm:^2.2.2"
|
||||||
@@ -22222,13 +22222,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"sonner@npm:^1.7.0":
|
"sonner@npm:^2.0.3":
|
||||||
version: 1.7.4
|
version: 2.0.3
|
||||||
resolution: "sonner@npm:1.7.4"
|
resolution: "sonner@npm:2.0.3"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
react: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
||||||
react-dom: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
react-dom: ^18.0.0 || ^19.0.0 || ^19.0.0-rc
|
||||||
checksum: 10c0/2856a43c1afaacec5ca74c7f6bb8eb439edf1fdadb045bd201590f809e6e9b711eabcf7d1e8f3448cf414e1333d97e3e16372a989011a3190f20952947b1f60a
|
checksum: 10c0/59f84142f7a692dd1ec90e6df2003a70ff0b325eaef1d5dd17ad250e7f992b71053824f1a7ab3912f8c4caa5ce30523a096b5f5108b3e8ae13f906048691aca1
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user