Skip to content

Commit 81fa204

Browse files
committed
fix: backdrop transform issues
1 parent 999c084 commit 81fa204

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

apps/evm/src/components/Notice/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export const Notice = ({
2626
}: NoticeProps) => (
2727
<div
2828
className={cn(
29-
'relative rounded-lg border backdrop-blur-lg transition-colors overflow-hidden',
30-
(variant === 'info' || variant === 'loading') && 'bg-blue/10 border-lightGrey',
31-
variant === 'error' && 'bg-red/10 border-red',
32-
variant === 'success' && 'bg-green/10 border-green',
33-
variant === 'warning' && 'bg-orange/10 border-orange',
29+
'relative bg-background rounded-lg border transition-colors overflow-hidden',
30+
(variant === 'info' || variant === 'loading') && 'border-lightGrey',
31+
variant === 'error' && 'border-red',
32+
variant === 'success' && 'border-green',
33+
variant === 'warning' && 'border-orange',
3434
className,
3535
)}
3636
{...otherProps}
@@ -39,6 +39,10 @@ export const Notice = ({
3939
className={cn(
4040
'flex transition-colors ease-linear px-3 py-2',
4141
size === 'md' && 'md:px-4 md:py-3',
42+
variant === 'info' && 'bg-blue/5',
43+
variant === 'error' && 'bg-red/5',
44+
variant === 'success' && 'bg-green/5',
45+
variant === 'warning' && 'bg-orange/5',
4246
)}
4347
>
4448
<div className="flex grow overflow-hidden">

apps/evm/src/libs/notifications/NotificationCenter/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { cn } from '@venusprotocol/ui';
12
import { AnimatePresence, motion } from 'motion/react';
23
import { createPortal } from 'react-dom';
34

@@ -18,14 +19,19 @@ const NotificationCenter: React.FC = () => {
1819
data-testid={TEST_IDS.container}
1920
>
2021
<AnimatePresence mode="popLayout" initial={false}>
21-
{notifications.map(({ id, ...otherNotificationProps }) => (
22+
{notifications.map(({ id, variant = 'info', ...otherNotificationProps }) => (
2223
<motion.li
2324
key={id}
24-
className="mb-2 last:mb-0"
25+
className={cn(
26+
'mb-2 last:mb-0 rounded-lg border backdrop-blur-lg overflow-hidden',
27+
(variant === 'info' || variant === 'loading') && 'bg-blue/10 border-lightGrey',
28+
variant === 'error' && 'bg-red/10 border-red',
29+
variant === 'success' && 'bg-green/10 border-green',
30+
variant === 'warning' && 'bg-orange/10 border-orange',
31+
)}
2532
layout
26-
initial={{ opacity: 0, x: '100%' }}
33+
initial={{ x: '110%' }}
2734
animate={{
28-
opacity: 1,
2935
x: 0,
3036
transition: {
3137
x: {
@@ -36,7 +42,6 @@ const NotificationCenter: React.FC = () => {
3642
opacity: {
3743
ease: EASE,
3844
duration: ANIMATION_BASE_DURATION_S,
39-
delay: (ANIMATION_BASE_DURATION_S * 1) / 3,
4045
},
4146
},
4247
}}
@@ -49,7 +54,11 @@ const NotificationCenter: React.FC = () => {
4954
duration: ANIMATION_BASE_DURATION_S,
5055
}}
5156
>
52-
<Notice {...otherNotificationProps} />
57+
<Notice
58+
variant={variant}
59+
className="bg-transparent border-transparent backdrop-blur-none rounded-none"
60+
{...otherNotificationProps}
61+
/>
5362
</motion.li>
5463
))}
5564
</AnimatePresence>

0 commit comments

Comments
 (0)