Skip to content

Commit f520bbb

Browse files
authored
Merge pull request #2297 from gluestack/fix/toast-animation
fix: toast animation
2 parents ce72ed6 + f4ce141 commit f520bbb

File tree

2 files changed

+10
-1
lines changed
  • example/storybook-nativewind/src/core-components/nativewind/toast
  • packages/unstyled/toast/src

2 files changed

+10
-1
lines changed

example/storybook-nativewind/src/core-components/nativewind/toast/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cssInterop(UIToast.Title, { className: 'style' });
2828
cssInterop(UIToast.Description, { className: 'style' });
2929

3030
const toastStyle = tva({
31-
base: 'p-4 m-3 rounded-md gap-1 web:pointer-events-auto shadow-hard-5 border-outline-100',
31+
base: 'p-4 m-1 rounded-md gap-1 web:pointer-events-auto shadow-hard-5 border-outline-100',
3232
variants: {
3333
action: {
3434
error: 'bg-error-700',

packages/unstyled/toast/src/ToastList.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ export const ToastList = () => {
113113
opacity: 1,
114114
y: 0,
115115
}}
116+
exit={{
117+
opacity: 0,
118+
y: transitionConfig[position],
119+
}}
120+
transition={{
121+
type: 'timing',
122+
duration: 150,
123+
}}
124+
key={toast.id}
116125
{...toast.config?.containerStyle}
117126
style={{ pointerEvents: 'box-none' }}
118127
>

0 commit comments

Comments
 (0)