Skip to content

Commit cd48904

Browse files
fix(next): imports toast from @payloadcms/ui (#11279)
Restoring a version has two types of messages, success and error, but no matter if this action is a success or a failure, the toast message is never displayed. The fix is to import the toast from `@payloadcms/ui` instead of `sonner` directly. Fixes #11059
1 parent 8b0ae90 commit cd48904

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

packages/next/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"qs-esm": "7.0.2",
9797
"react-diff-viewer-continued": "4.0.4",
9898
"sass": "1.77.4",
99-
"sonner": "^1.7.0",
10099
"uuid": "10.0.0"
101100
},
102101
"devDependencies": {

packages/next/src/views/API/index.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import {
88
MinimizeMaximizeIcon,
99
NumberField,
1010
SetDocumentStepNav,
11+
toast,
1112
useConfig,
1213
useDocumentInfo,
1314
useLocale,
1415
useTranslation,
1516
} from '@payloadcms/ui'
1617
import { useSearchParams } from 'next/navigation.js'
1718
import * as React from 'react'
18-
import { toast } from 'sonner'
1919

2020
import './index.scss'
2121
import { LocaleSelector } from './LocaleSelector/index.js'

packages/next/src/views/Version/Restore/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Button,
66
ConfirmationModal,
77
PopupList,
8+
toast,
89
useConfig,
910
useModal,
1011
useRouteTransition,
@@ -13,7 +14,6 @@ import {
1314
import { formatAdminURL, requests } from '@payloadcms/ui/shared'
1415
import { useRouter } from 'next/navigation.js'
1516
import React, { Fragment, useCallback, useState } from 'react'
16-
import { toast } from 'sonner'
1717

1818
import type { Props } from './types.js'
1919

pnpm-lock.yaml

Lines changed: 39 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)