mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
fix(component): toast shouldn't cover whole header (#9032)
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
"react-paginate": "^8.2.0",
|
"react-paginate": "^8.2.0",
|
||||||
"react-router-dom": "^6.22.3",
|
"react-router-dom": "^6.22.3",
|
||||||
"react-transition-state": "^2.1.1",
|
"react-transition-state": "^2.1.1",
|
||||||
"sonner": "^1.4.41",
|
"sonner": "^1.7.0",
|
||||||
"swr": "^2.2.5",
|
"swr": "^2.2.5",
|
||||||
"zod": "^3.22.4"
|
"zod": "^3.22.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import { Toaster } from 'sonner';
|
import { Toaster } from 'sonner';
|
||||||
|
|
||||||
|
import { sonner } from './styles.css';
|
||||||
|
|
||||||
export function MobileNotificationCenter() {
|
export function MobileNotificationCenter() {
|
||||||
return (
|
return (
|
||||||
<Toaster
|
<Toaster
|
||||||
|
className={sonner}
|
||||||
visibleToasts={1}
|
visibleToasts={1}
|
||||||
position="top-center"
|
position="top-center"
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { cssVar } from '@toeverything/theme';
|
import { cssVar } from '@toeverything/theme';
|
||||||
import { keyframes, style } from '@vanilla-extract/css';
|
import { globalStyle, keyframes, style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
cardBorderColor,
|
cardBorderColor,
|
||||||
@@ -16,6 +16,14 @@ const expandIn = keyframes({
|
|||||||
maxWidth: '100vw',
|
maxWidth: '100vw',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
export const sonner = style({
|
||||||
|
left: '0 !important',
|
||||||
|
});
|
||||||
|
globalStyle(`${sonner} li[data-sonner-toast]`, {
|
||||||
|
width: 'fit-content !important',
|
||||||
|
margin: '0px auto',
|
||||||
|
});
|
||||||
|
|
||||||
export const toastRoot = style({
|
export const toastRoot = style({
|
||||||
width: 'fit-content',
|
width: 'fit-content',
|
||||||
height: 44,
|
height: 44,
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ __metadata:
|
|||||||
react-paginate: "npm:^8.2.0"
|
react-paginate: "npm:^8.2.0"
|
||||||
react-router-dom: "npm:^6.22.3"
|
react-router-dom: "npm:^6.22.3"
|
||||||
react-transition-state: "npm:^2.1.1"
|
react-transition-state: "npm:^2.1.1"
|
||||||
sonner: "npm:^1.4.41"
|
sonner: "npm:^1.7.0"
|
||||||
storybook: "npm:^8.2.9"
|
storybook: "npm:^8.2.9"
|
||||||
swr: "npm:^2.2.5"
|
swr: "npm:^2.2.5"
|
||||||
typescript: "npm:^5.6.3"
|
typescript: "npm:^5.6.3"
|
||||||
@@ -30180,7 +30180,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"sonner@npm:^1.4.41, sonner@npm:^1.5.0":
|
"sonner@npm:^1.5.0, sonner@npm:^1.7.0":
|
||||||
version: 1.7.0
|
version: 1.7.0
|
||||||
resolution: "sonner@npm:1.7.0"
|
resolution: "sonner@npm:1.7.0"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user