Skip to content

Commit e0eb094

Browse files
committed
feat: update toast component to use handleCloseToast function + animation exit improvements
1 parent a5f0ec8 commit e0eb094

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

library/src/components/toast.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Toast = (props: ToastComponentProps) => {
106106
{props.action.text ?? 'Action'}
107107
</button>
108108
)}
109-
<button onClick={props.onClose} title="Close toast">
109+
<button onClick={handleCloseToast} title="Close toast">
110110
Close
111111
</button>
112112
</div>

library/src/styles/toast-component.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
opacity: 1;
180180
transform: translateX(0);
181181
}
182-
100% {
182+
90% {
183183
opacity: 0;
184184
transform: translateX(-90%);
185185
}
@@ -209,9 +209,9 @@
209209
opacity: 1;
210210
transform: translateY(0);
211211
}
212-
100% {
212+
90% {
213213
opacity: 0;
214-
transform: translateY(100%);
214+
transform: translateY(90%);
215215
}
216216
}
217217

@@ -224,9 +224,9 @@
224224
opacity: 1;
225225
transform: translateY(0);
226226
}
227-
100% {
227+
90% {
228228
opacity: 0;
229-
transform: translateY(-100%);
229+
transform: translateY(-90%);
230230
}
231231
}
232232

@@ -239,7 +239,7 @@
239239
opacity: 1;
240240
transform: translateX(0);
241241
}
242-
100% {
242+
90% {
243243
opacity: 0;
244244
transform: translateX(90%);
245245
}

0 commit comments

Comments
 (0)