rn-toastify 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-toastify",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "A customizable and performant toast notification library for React Native, featuring smooth animations, swipe gestures, and flexible styling options.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -13,16 +13,47 @@
13
13
  },
14
14
  "keywords": [
15
15
  "react-native",
16
+ "react native",
16
17
  "toast",
17
- "react-native-toastify",
18
+ "toastify",
19
+ "notification",
20
+ "alert",
21
+ "snackbar",
22
+ "message",
23
+ "popup",
18
24
  "react-native-toast",
25
+ "react-native-toastify",
19
26
  "react-native-toast-message",
27
+ "react-native-notifications",
28
+ "rn-toast",
20
29
  "rn-toastify",
21
- "alert",
22
- "notification",
23
- "library"
30
+ "animated-toast",
31
+ "swipe-toast",
32
+ "promise-toast",
33
+ "success-toast",
34
+ "error-toast",
35
+ "loading-toast",
36
+ "custom-toast",
37
+ "ios",
38
+ "android",
39
+ "cross-platform",
40
+ "reanimated",
41
+ "lottie",
42
+ "gesture",
43
+ "animation",
44
+ "dark-mode",
45
+ "theme",
46
+ "typescript",
47
+ "mobile",
48
+ "notification-library",
49
+ "alert-library",
50
+ "toast-notification",
51
+ "react-native-component"
24
52
  ],
25
- "author": "Mukesh Prajapati",
53
+ "author": {
54
+ "name": "Mukesh Prajapati",
55
+ "url": "https://github.com/muku534"
56
+ },
26
57
  "license": "MIT",
27
58
  "peerDependencies": {
28
59
  "react": ">=16.8.0 <20.0.0",
@@ -8,6 +8,7 @@ import {
8
8
  const CustomToast = ({ content, theme = 'light' }) => {
9
9
  const isDark = theme === 'dark';
10
10
  const bg = isDark ? '#111827' : '#FFFFFF';
11
+
11
12
  return (
12
13
  <View style={[styles.customToast, { backgroundColor: bg }]}>
13
14
  {content}
@@ -17,12 +18,24 @@ const CustomToast = ({ content, theme = 'light' }) => {
17
18
 
18
19
  const styles = StyleSheet.create({
19
20
  customToast: {
20
- padding: wp(1),
21
- borderRadius: wp(2),
22
- backgroundColor: 'white',
21
+ minHeight: hp(6.5),
22
+ paddingHorizontal: wp(4),
23
+ paddingVertical: hp(1.2),
24
+ borderRadius: wp(3),
25
+ backgroundColor: '#FFFFFF',
23
26
  flexDirection: 'row',
24
27
  alignItems: 'center',
28
+ // Shadow for iOS
29
+ shadowColor: '#000',
30
+ shadowOffset: {
31
+ width: 0,
32
+ height: 4,
33
+ },
34
+ shadowOpacity: 0.15,
35
+ shadowRadius: 8,
36
+ // Shadow for Android
37
+ elevation: 6,
25
38
  },
26
39
  });
27
40
 
28
- export default CustomToast;
41
+ export default CustomToast;
@@ -7,32 +7,51 @@ import {
7
7
 
8
8
  const EmojiToast = ({ message, emoji, theme = 'light' }) => {
9
9
  const isDark = theme === 'dark';
10
- const bg = isDark ? '#111827' : '#F7F7FC';
11
- const textColor = isDark ? '#F3F4F6' : 'black';
10
+ const bg = isDark ? '#111827' : '#FFFFFF';
11
+ const textColor = isDark ? '#F3F4F6' : '#1F2937';
12
12
 
13
13
  return (
14
14
  <View style={[styles.emojiToast, { backgroundColor: bg }]}>
15
- <Text style={[styles.text, { color: textColor }]}>{emoji} {message}</Text>
15
+ <Text style={styles.emoji}>{emoji}</Text>
16
+ <Text style={[styles.text, { color: textColor }]} numberOfLines={2}>
17
+ {message}
18
+ </Text>
16
19
  </View>
17
20
  );
18
- }
21
+ };
22
+
19
23
  const styles = StyleSheet.create({
20
24
  emojiToast: {
21
25
  width: wp(87),
22
- height: hp(6.8),
26
+ minHeight: hp(6.5),
23
27
  paddingHorizontal: wp(4),
24
- borderRadius: wp(4),
25
- // backgroundColor: '#d2f7d2',
26
- backgroundColor: '#F7F7FC',
28
+ paddingVertical: hp(1.2),
29
+ borderRadius: wp(3),
30
+ backgroundColor: '#FFFFFF',
27
31
  alignItems: 'center',
28
32
  flexDirection: 'row',
29
-
33
+ // Shadow for iOS
34
+ shadowColor: '#000',
35
+ shadowOffset: {
36
+ width: 0,
37
+ height: 4,
38
+ },
39
+ shadowOpacity: 0.15,
40
+ shadowRadius: 8,
41
+ // Shadow for Android
42
+ elevation: 6,
43
+ },
44
+ emoji: {
45
+ fontSize: hp(2.8),
46
+ marginRight: wp(2),
30
47
  },
31
48
  text: {
32
- fontSize: hp(2.2),
33
- color: 'black',
34
- paddingHorizontal: wp(1.5)
49
+ fontSize: hp(1.85),
50
+ color: '#1F2937',
51
+ fontWeight: '500',
52
+ flex: 1,
53
+ lineHeight: hp(2.4),
35
54
  },
36
55
  });
37
56
 
38
- export default EmojiToast;
57
+ export default EmojiToast;
@@ -1,4 +1,3 @@
1
- // src/components/ToastHelpers/ErrorToast.js
2
1
  import LottieView from 'lottie-react-native';
3
2
  import React from 'react';
4
3
  import { View, Text, StyleSheet } from 'react-native';
@@ -9,44 +8,58 @@ import {
9
8
 
10
9
  const ErrorToast = ({ message, theme = 'light' }) => {
11
10
  const isDark = theme === 'dark';
12
- const containerBg = isDark ? '#111827' : '#F7F7FC';
11
+ const containerBg = isDark ? '#111827' : '#FFFFFF';
13
12
  const textColor = isDark ? '#FEE2E2' : '#991B1B';
14
13
 
15
14
  return (
16
15
  <View style={[styles.container, { backgroundColor: containerBg }]}>
17
16
  <LottieView
18
- source={require('../../assets/animated_Icon/ErrorAnimation.json')} // Replace with your success Lottie animation path
17
+ source={require('../../assets/animated_Icon/ErrorAnimation.json')}
19
18
  autoPlay
20
19
  loop={false}
21
20
  speed={1.5}
22
21
  style={styles.lottie}
23
22
  />
24
- <Text style={[styles.text, { color: textColor }]}>{message}</Text>
23
+ <Text style={[styles.text, { color: textColor }]} numberOfLines={2}>
24
+ {message}
25
+ </Text>
25
26
  </View>
26
27
  );
27
- }
28
+ };
28
29
 
29
30
  const styles = StyleSheet.create({
30
31
  container: {
31
32
  width: wp(87),
32
- height: hp(6.8),
33
+ minHeight: hp(6.5),
33
34
  paddingHorizontal: wp(4),
34
- borderRadius: wp(4),
35
- // backgroundColor: '#f8c4c4',
36
- backgroundColor: '#F7F7FC',
35
+ paddingVertical: hp(1.2),
36
+ borderRadius: wp(3),
37
+ backgroundColor: '#FFFFFF',
37
38
  alignItems: 'center',
38
- flexDirection: 'row'
39
+ flexDirection: 'row',
40
+ // Shadow for iOS
41
+ shadowColor: '#000',
42
+ shadowOffset: {
43
+ width: 0,
44
+ height: 4,
45
+ },
46
+ shadowOpacity: 0.15,
47
+ shadowRadius: 8,
48
+ // Shadow for Android
49
+ elevation: 6,
39
50
  },
40
51
  text: {
41
- fontSize: hp(2.3),
42
- color: 'black',
52
+ fontSize: hp(1.85),
53
+ color: '#991B1B',
43
54
  fontWeight: '500',
44
- paddingHorizontal: wp(3)
55
+ paddingHorizontal: wp(2.5),
56
+ flex: 1,
57
+ lineHeight: hp(2.4),
45
58
  },
46
59
  lottie: {
47
- width: wp(8.5),
48
- height: hp(4.5),
60
+ width: wp(7),
61
+ height: hp(3.5),
49
62
  },
50
63
  });
51
64
 
52
- export default ErrorToast;
65
+ export default ErrorToast;
@@ -1,4 +1,3 @@
1
- // src/components/ToastHelpers/LoadingToast.js
2
1
  import React from 'react';
3
2
  import { View, Text, StyleSheet, ActivityIndicator } from 'react-native';
4
3
  import {
@@ -10,24 +9,47 @@ const LoadingToast = ({ message, theme = 'light' }) => {
10
9
  const isDark = theme === 'dark';
11
10
  const bg = isDark ? '#111827' : '#FFFFFF';
12
11
  const indicatorColor = isDark ? '#9CA3AF' : '#6B7280';
12
+ const textColor = isDark ? '#F3F4F6' : '#1F2937';
13
13
 
14
14
  return (
15
15
  <View style={[styles.toast, { backgroundColor: bg }]}>
16
16
  <ActivityIndicator size="small" color={indicatorColor} />
17
- {/** <Text style={styles.text}>{message}</Text> */}
17
+ {message && (
18
+ <Text style={[styles.text, { color: textColor }]} numberOfLines={1}>
19
+ {message}
20
+ </Text>
21
+ )}
18
22
  </View>
19
23
  );
20
- }
24
+ };
25
+
21
26
  const styles = StyleSheet.create({
22
27
  toast: {
23
- padding: wp(1),
24
- borderRadius: wp(10),
25
- backgroundColor: 'white',
28
+ minHeight: hp(6.5),
29
+ paddingHorizontal: wp(4),
30
+ paddingVertical: hp(1.2),
31
+ borderRadius: wp(3),
32
+ backgroundColor: '#FFFFFF',
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ // Shadow for iOS
36
+ shadowColor: '#000',
37
+ shadowOffset: {
38
+ width: 0,
39
+ height: 4,
40
+ },
41
+ shadowOpacity: 0.15,
42
+ shadowRadius: 8,
43
+ // Shadow for Android
44
+ elevation: 6,
26
45
  },
27
46
  text: {
28
- fontSize: hp(2.2),
29
- color: 'black',
47
+ fontSize: hp(1.85),
48
+ color: '#1F2937',
49
+ fontWeight: '500',
50
+ marginLeft: wp(3),
51
+ lineHeight: hp(2.4),
30
52
  },
31
53
  });
32
54
 
33
- export default LoadingToast;
55
+ export default LoadingToast;
@@ -8,19 +8,21 @@ import {
8
8
 
9
9
  const SuccessToast = ({ message, theme = 'light' }) => {
10
10
  const isDark = theme === 'dark';
11
- const containerBg = isDark ? '#111827' : '#F7F7FC';
12
- const textColor = isDark ? '#F3F4F6' : '#064E3B';
11
+ const containerBg = isDark ? '#111827' : '#FFFFFF';
12
+ const textColor = isDark ? '#F3F4F6' : '#1F2937';
13
13
 
14
14
  return (
15
15
  <View style={[styles.container, { backgroundColor: containerBg }]}>
16
16
  <LottieView
17
- source={require('../../assets/animated_Icon/SuccessAnimation.json')} // Replace with your success Lottie animation path
17
+ source={require('../../assets/animated_Icon/SuccessAnimation.json')}
18
18
  autoPlay
19
19
  loop={false}
20
20
  style={styles.lottie}
21
21
  speed={1.2}
22
22
  />
23
- <Text style={[styles.text, { color: textColor }]}>{message}</Text>
23
+ <Text style={[styles.text, { color: textColor }]} numberOfLines={2}>
24
+ {message}
25
+ </Text>
24
26
  </View>
25
27
  );
26
28
  };
@@ -28,24 +30,36 @@ const SuccessToast = ({ message, theme = 'light' }) => {
28
30
  const styles = StyleSheet.create({
29
31
  container: {
30
32
  width: wp(87),
31
- height: hp(6.8),
33
+ minHeight: hp(6.5),
32
34
  paddingHorizontal: wp(4),
33
- borderRadius: wp(4),
34
- // backgroundColor: '#d2f7d2',
35
- backgroundColor: '#F7F7FC',
35
+ paddingVertical: hp(1.2),
36
+ borderRadius: wp(3),
37
+ backgroundColor: '#FFFFFF',
36
38
  alignItems: 'center',
37
39
  flexDirection: 'row',
40
+ // Shadow for iOS
41
+ shadowColor: '#000',
42
+ shadowOffset: {
43
+ width: 0,
44
+ height: 4,
45
+ },
46
+ shadowOpacity: 0.15,
47
+ shadowRadius: 8,
48
+ // Shadow for Android
49
+ elevation: 6,
38
50
  },
39
51
  text: {
40
- fontSize: hp(2.3),
41
- color: 'black',
52
+ fontSize: hp(1.85),
53
+ color: '#1F2937',
42
54
  fontWeight: '500',
43
- paddingHorizontal: wp(3)
55
+ paddingHorizontal: wp(2.5),
56
+ flex: 1,
57
+ lineHeight: hp(2.4),
44
58
  },
45
59
  lottie: {
46
- width: wp(8),
47
- height: hp(4),
60
+ width: wp(7),
61
+ height: hp(3.5),
48
62
  },
49
63
  });
50
64
 
51
- export default SuccessToast;
65
+ export default SuccessToast;