calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.73k stars 265 forks source link

Postion Bottom Issues, Swipeable type missing #541

Open Ritik5Prasad opened 7 months ago

Ritik5Prasad commented 7 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-toast-message@2.2.0 for the project I'm working on. When im passing bottomOffSet -10 its not working there is white space from below and also there is type error from swipeable missing

<Toast visibilityTime={2500} config={toastConfig} bottomOffset={0} swipeable={false} position="bottom" />

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-toast-message/lib/src/components/AnimatedContainer.styles.js b/node_modules/react-native-toast-message/lib/src/components/AnimatedContainer.styles.js
index 9ab2b7f..0a09e23 100644
--- a/node_modules/react-native-toast-message/lib/src/components/AnimatedContainer.styles.js
+++ b/node_modules/react-native-toast-message/lib/src/components/AnimatedContainer.styles.js
@@ -11,6 +11,6 @@ export const styles = StyleSheet.create({
         top: 0
     },
     bottom: {
-        bottom: 0
+        bottom: -10
     }
 });
diff --git a/node_modules/react-native-toast-message/lib/src/types/index.d.ts b/node_modules/react-native-toast-message/lib/src/types/index.d.ts
index e6e502e..a2f5a2b 100644
--- a/node_modules/react-native-toast-message/lib/src/types/index.d.ts
+++ b/node_modules/react-native-toast-message/lib/src/types/index.d.ts
@@ -145,6 +145,8 @@ export declare type ToastProps = {
      * Default value: `4000`
      */
     visibilityTime?: number;
+
+    swipeable?: boolean;
     /**
      * When `true`, the visible Toast automatically hides after a certain number of milliseconds,
      * specified by the `visibilityTime` prop.

This issue body was partially generated by patch-package.