Skip to content

Commit

Permalink
fix(component): toast shouldn't cover whole header (#9032)
Browse files Browse the repository at this point in the history
  • Loading branch information
CatsJuice committed Dec 6, 2024
1 parent 0a1fa89 commit 53339e3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"react-paginate": "^8.2.0",
"react-router-dom": "^6.22.3",
"react-transition-state": "^2.1.1",
"sonner": "^1.4.41",
"sonner": "^1.7.0",
"swr": "^2.2.5",
"zod": "^3.22.4"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Toaster } from 'sonner';

import { sonner } from './styles.css';

export function MobileNotificationCenter() {
return (
<Toaster
className={sonner}
visibleToasts={1}
position="top-center"
style={{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cssVar } from '@toeverything/theme';
import { keyframes, style } from '@vanilla-extract/css';
import { globalStyle, keyframes, style } from '@vanilla-extract/css';

import {
cardBorderColor,
Expand All @@ -16,6 +16,14 @@ const expandIn = keyframes({
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({
width: 'fit-content',
height: 44,
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ __metadata:
react-paginate: "npm:^8.2.0"
react-router-dom: "npm:^6.22.3"
react-transition-state: "npm:^2.1.1"
sonner: "npm:^1.4.41"
sonner: "npm:^1.7.0"
storybook: "npm:^8.2.9"
swr: "npm:^2.2.5"
typescript: "npm:^5.6.3"
Expand Down Expand Up @@ -30180,7 +30180,7 @@ __metadata:
languageName: node
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
resolution: "sonner@npm:1.7.0"
peerDependencies:
Expand Down

0 comments on commit 53339e3

Please sign in to comment.