fix(SW-993): toast is now full width on mobile

updated sonner to latest version

increased default duration of toast to 5 sec
This commit is contained in:
Christian Andolf
2024-11-22 16:24:51 +01:00
parent b3ab0613f6
commit 257900b7a8
4 changed files with 14 additions and 10 deletions

View File

@@ -16,7 +16,7 @@ import { toastVariants } from "./variants"
import styles from "./toasts.module.css"
export function ToastHandler() {
return <Toaster position="bottom-right" />
return <Toaster position="bottom-right" duration={5000} />
}
function getIcon(variant: ToastsProps["variant"]) {

View File

@@ -6,7 +6,12 @@
background: var(--Base-Surface-Primary-light-Normal);
box-shadow: 0px 0px 8px 2px rgba(0, 0, 0, 0.08);
align-items: center;
width: var(--width);
}
@media screen and (min-width: 768px) {
.toast {
width: var(--width);
}
}
.toast .message {

13
package-lock.json generated
View File

@@ -53,7 +53,7 @@
"react-international-phone": "^4.2.6",
"react-intl": "^6.6.8",
"server-only": "^0.0.1",
"sonner": "^1.5.0",
"sonner": "^1.7.0",
"superjson": "^2.2.1",
"usehooks-ts": "3.1.0",
"zod": "^3.22.4",
@@ -18205,13 +18205,12 @@
}
},
"node_modules/sonner": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.5.0.tgz",
"integrity": "sha512-FBjhG/gnnbN6FY0jaNnqZOMmB73R+5IiyYAw8yBj7L54ER7HB3fOSE5OFiQiE2iXWxeXKvg6fIP4LtVppHEdJA==",
"license": "MIT",
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/sonner/-/sonner-1.7.0.tgz",
"integrity": "sha512-W6dH7m5MujEPyug3lpI2l3TC3Pp1+LTgK0Efg+IHDrBbtEjyCmCHHo6yfNBOsf1tFZ6zf+jceWwB38baC8yO9g==",
"peerDependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
"react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
}
},
"node_modules/sort-object-keys": {

View File

@@ -68,7 +68,7 @@
"react-international-phone": "^4.2.6",
"react-intl": "^6.6.8",
"server-only": "^0.0.1",
"sonner": "^1.5.0",
"sonner": "^1.7.0",
"superjson": "^2.2.1",
"usehooks-ts": "3.1.0",
"zod": "^3.22.4",