Skip to content

Commit a62feaa

Browse files
author
Jean Verster
committed
fix: fix bottom position logic
1 parent e11a760 commit a62feaa

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

src/Toast/index.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,21 @@ const shadow = {
4141
}
4242

4343
export const Toast: React.FC<ToastConfig & ToastInternalConfig> = ({
44-
intent,
45-
message,
46-
duration,
47-
onClose,
48-
id,
49-
index,
50-
shouldVibrate,
51-
onPress,
44+
bg,
5245
borderColor,
5346
closeButtonBgColor,
54-
closeIconColor,
5547
closeIconBorderRadius,
56-
bg,
48+
closeIconColor,
5749
color,
50+
duration,
51+
id,
52+
index,
53+
intent,
54+
message,
55+
onClose,
56+
onPress,
57+
position,
58+
shouldVibrate,
5859
subMessage
5960
}) => {
6061
const isSuccess = intent === 'SUCCESS'
@@ -95,7 +96,7 @@ export const Toast: React.FC<ToastConfig & ToastInternalConfig> = ({
9596

9697
const translateY = animation.interpolate({
9798
inputRange: [0, 0.5, 1],
98-
outputRange: [-topOffset, 0, -topOffset],
99+
outputRange: [position === 'BOTTOM' ? topOffset : -topOffset, 0, -topOffset],
99100
extrapolate: 'clamp'
100101
})
101102

0 commit comments

Comments
 (0)