rn-toastify 1.0.10 → 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/index.js +25 -21
- package/package.json +38 -7
- package/src/components/CustomeToast.js +17 -4
- package/src/components/EmojiToast.js +32 -13
- package/src/components/ErrorToast.js +29 -16
- package/src/components/LoadingToast.js +31 -9
- package/src/components/SuccessToast.js +28 -14
- package/src/context/ToastContainer.js +21 -17
package/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const _loadingMod = require('./src/components/LoadingToast');
|
|
1
|
+
// Fixed index.js - Simplified export structure
|
|
2
|
+
const useToastModule = require('./src/hooks/useToast');
|
|
3
|
+
const ToastModule = require('./src/Toast');
|
|
4
|
+
const ToastContainerModule = require('./src/context/ToastContainer');
|
|
5
|
+
const SuccessToastModule = require('./src/components/SuccessToast');
|
|
6
|
+
const CustomeToastModule = require('./src/components/CustomeToast');
|
|
7
|
+
const EmojiToastModule = require('./src/components/EmojiToast');
|
|
8
|
+
const ErrorToastModule = require('./src/components/ErrorToast');
|
|
9
|
+
const LoadingToastModule = require('./src/components/LoadingToast');
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
11
|
+
// Extract default exports properly
|
|
12
|
+
const useToast = useToastModule.default || useToastModule;
|
|
13
|
+
const Toast = ToastModule.default || ToastModule;
|
|
14
|
+
const ToastContainer = ToastContainerModule.default || ToastContainerModule;
|
|
15
|
+
const SuccessToast = SuccessToastModule.default || SuccessToastModule;
|
|
16
|
+
const CustomeToast = CustomeToastModule.default || CustomeToastModule;
|
|
17
|
+
const EmojiToast = EmojiToastModule.default || EmojiToastModule;
|
|
18
|
+
const ErrorToast = ErrorToastModule.default || ErrorToastModule;
|
|
19
|
+
const LoadingToast = LoadingToastModule.default || LoadingToastModule;
|
|
20
20
|
|
|
21
|
-
//
|
|
21
|
+
// Primary default export
|
|
22
22
|
module.exports = useToast;
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
// Named exports
|
|
24
25
|
module.exports.useToast = useToast;
|
|
25
26
|
module.exports.Toast = Toast;
|
|
26
27
|
module.exports.ToastContainer = ToastContainer;
|
|
@@ -28,4 +29,7 @@ module.exports.SuccessToast = SuccessToast;
|
|
|
28
29
|
module.exports.CustomeToast = CustomeToast;
|
|
29
30
|
module.exports.EmojiToast = EmojiToast;
|
|
30
31
|
module.exports.ErrorToast = ErrorToast;
|
|
31
|
-
module.exports.LoadingToast = LoadingToast;
|
|
32
|
+
module.exports.LoadingToast = LoadingToast;
|
|
33
|
+
|
|
34
|
+
// Also support default property for ES6 imports
|
|
35
|
+
module.exports.default = useToast;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-toastify",
|
|
3
|
-
"version": "1.0.
|
|
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,19 +13,50 @@
|
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"react-native",
|
|
16
|
+
"react native",
|
|
16
17
|
"toast",
|
|
17
|
-
"
|
|
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
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
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":
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "Mukesh Prajapati",
|
|
55
|
+
"url": "https://github.com/muku534"
|
|
56
|
+
},
|
|
26
57
|
"license": "MIT",
|
|
27
58
|
"peerDependencies": {
|
|
28
|
-
"react": ">=16.8.0 <
|
|
59
|
+
"react": ">=16.8.0 <20.0.0",
|
|
29
60
|
"react-native": ">=0.60.0 <1.0.0",
|
|
30
61
|
"react-native-reanimated": ">=2.0.0 <5.0.0",
|
|
31
62
|
"lottie-react-native": ">=3.0.0 <9.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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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' : '#
|
|
11
|
-
const textColor = isDark ? '#F3F4F6' : '
|
|
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={
|
|
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
|
-
|
|
26
|
+
minHeight: hp(6.5),
|
|
23
27
|
paddingHorizontal: wp(4),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
backgroundColor: '#
|
|
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(
|
|
33
|
-
color: '
|
|
34
|
-
|
|
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' : '#
|
|
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')}
|
|
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 }]}
|
|
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
|
-
|
|
33
|
+
minHeight: hp(6.5),
|
|
33
34
|
paddingHorizontal: wp(4),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
backgroundColor: '#
|
|
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(
|
|
42
|
-
color: '
|
|
52
|
+
fontSize: hp(1.85),
|
|
53
|
+
color: '#991B1B',
|
|
43
54
|
fontWeight: '500',
|
|
44
|
-
paddingHorizontal: wp(
|
|
55
|
+
paddingHorizontal: wp(2.5),
|
|
56
|
+
flex: 1,
|
|
57
|
+
lineHeight: hp(2.4),
|
|
45
58
|
},
|
|
46
59
|
lottie: {
|
|
47
|
-
width: wp(
|
|
48
|
-
height: hp(
|
|
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
|
-
{
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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(
|
|
29
|
-
color: '
|
|
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' : '#
|
|
12
|
-
const textColor = isDark ? '#F3F4F6' : '#
|
|
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')}
|
|
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 }]}
|
|
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
|
-
|
|
33
|
+
minHeight: hp(6.5),
|
|
32
34
|
paddingHorizontal: wp(4),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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(
|
|
41
|
-
color: '
|
|
52
|
+
fontSize: hp(1.85),
|
|
53
|
+
color: '#1F2937',
|
|
42
54
|
fontWeight: '500',
|
|
43
|
-
paddingHorizontal: wp(
|
|
55
|
+
paddingHorizontal: wp(2.5),
|
|
56
|
+
flex: 1,
|
|
57
|
+
lineHeight: hp(2.4),
|
|
44
58
|
},
|
|
45
59
|
lottie: {
|
|
46
|
-
width: wp(
|
|
47
|
-
height: hp(
|
|
60
|
+
width: wp(7),
|
|
61
|
+
height: hp(3.5),
|
|
48
62
|
},
|
|
49
63
|
});
|
|
50
64
|
|
|
51
|
-
export default SuccessToast;
|
|
65
|
+
export default SuccessToast;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, Appearance, StatusBar, Platform
|
|
2
|
+
import { View, StyleSheet, Appearance, StatusBar, Platform } from 'react-native';
|
|
3
3
|
import Toast from '../Toast';
|
|
4
4
|
import toastManagerInstance from './ToastManager';
|
|
5
5
|
import {
|
|
@@ -35,23 +35,29 @@ const ToastContainer = ({ theme: forcedTheme } = {}) => {
|
|
|
35
35
|
toastManagerInstance.off('remove', handleRemove);
|
|
36
36
|
if (appearanceSub && appearanceSub.remove) appearanceSub.remove();
|
|
37
37
|
};
|
|
38
|
-
}, []);
|
|
38
|
+
}, [forcedTheme]);
|
|
39
|
+
|
|
40
|
+
// Calculate safe top margin for status bar
|
|
41
|
+
const getTopMargin = () => {
|
|
42
|
+
if (Platform.OS === 'android') {
|
|
43
|
+
return StatusBar.currentHeight || 0;
|
|
44
|
+
}
|
|
45
|
+
// For iOS, use a default safe area top margin
|
|
46
|
+
return 44; // Standard iOS notch/status bar height
|
|
47
|
+
};
|
|
39
48
|
|
|
40
49
|
// Separate toasts by position
|
|
41
50
|
const topToasts = toasts.filter(toast => toast?.options?.position === 'top');
|
|
42
51
|
const centerToasts = toasts.filter(toast => toast?.options?.position === 'center');
|
|
43
52
|
const bottomToasts = toasts.filter(toast => toast?.options?.position === 'bottom');
|
|
44
53
|
|
|
54
|
+
const topMargin = getTopMargin();
|
|
55
|
+
|
|
45
56
|
return (
|
|
46
57
|
<>
|
|
47
58
|
{/* Top positioned toasts */}
|
|
48
|
-
<
|
|
49
|
-
style={[
|
|
50
|
-
styles.topContainer,
|
|
51
|
-
{
|
|
52
|
-
top: Platform.OS === 'android' ? StatusBar.currentHeight || 0 : 0,
|
|
53
|
-
},
|
|
54
|
-
]}
|
|
59
|
+
<View
|
|
60
|
+
style={[styles.topContainer, { top: topMargin + hp(1) }]}
|
|
55
61
|
pointerEvents="box-none"
|
|
56
62
|
>
|
|
57
63
|
{topToasts.map((toast, index) => (
|
|
@@ -61,13 +67,13 @@ const ToastContainer = ({ theme: forcedTheme } = {}) => {
|
|
|
61
67
|
duration={toast?.options?.duration}
|
|
62
68
|
position="top"
|
|
63
69
|
theme={theme}
|
|
64
|
-
style={[toast?.options?.style || {}, { marginTop: index *
|
|
70
|
+
style={[toast?.options?.style || {}, { marginTop: index * (hp(7) + hp(1)) }]}
|
|
65
71
|
onHide={() => toastManagerInstance.remove(toast.id)}
|
|
66
72
|
>
|
|
67
73
|
{toast.content}
|
|
68
74
|
</Toast>
|
|
69
75
|
))}
|
|
70
|
-
</
|
|
76
|
+
</View>
|
|
71
77
|
|
|
72
78
|
{/* Center positioned toasts */}
|
|
73
79
|
<View style={styles.centerContainer} pointerEvents="box-none">
|
|
@@ -78,7 +84,7 @@ const ToastContainer = ({ theme: forcedTheme } = {}) => {
|
|
|
78
84
|
duration={toast?.options?.duration}
|
|
79
85
|
position="center"
|
|
80
86
|
theme={theme}
|
|
81
|
-
style={[toast?.options?.style || {}, { marginTop: index *
|
|
87
|
+
style={[toast?.options?.style || {}, { marginTop: index * (hp(7) + hp(1)) }]}
|
|
82
88
|
onHide={() => toastManagerInstance.remove(toast.id)}
|
|
83
89
|
>
|
|
84
90
|
{toast.content}
|
|
@@ -95,7 +101,7 @@ const ToastContainer = ({ theme: forcedTheme } = {}) => {
|
|
|
95
101
|
duration={toast?.options?.duration}
|
|
96
102
|
position="bottom"
|
|
97
103
|
theme={theme}
|
|
98
|
-
style={[toast?.options?.style || {}, { bottom: hp(2) + index *
|
|
104
|
+
style={[toast?.options?.style || {}, { bottom: hp(2) + index * (hp(7) + hp(1)) }]}
|
|
99
105
|
onHide={() => toastManagerInstance.remove(toast.id)}
|
|
100
106
|
>
|
|
101
107
|
{toast.content}
|
|
@@ -109,7 +115,6 @@ const ToastContainer = ({ theme: forcedTheme } = {}) => {
|
|
|
109
115
|
const styles = StyleSheet.create({
|
|
110
116
|
topContainer: {
|
|
111
117
|
position: 'absolute',
|
|
112
|
-
top: 0,
|
|
113
118
|
left: 0,
|
|
114
119
|
right: 0,
|
|
115
120
|
zIndex: 9999,
|
|
@@ -119,13 +124,12 @@ const styles = StyleSheet.create({
|
|
|
119
124
|
centerContainer: {
|
|
120
125
|
position: 'absolute',
|
|
121
126
|
top: '50%',
|
|
122
|
-
bottom: '50%',
|
|
123
127
|
left: 0,
|
|
124
128
|
right: 0,
|
|
125
129
|
zIndex: 9999,
|
|
126
130
|
pointerEvents: 'box-none',
|
|
127
131
|
alignItems: 'center',
|
|
128
|
-
transform: [{ translateY: -
|
|
132
|
+
transform: [{ translateY: -hp(3.5) }]
|
|
129
133
|
},
|
|
130
134
|
bottomContainer: {
|
|
131
135
|
position: 'absolute',
|
|
@@ -138,4 +142,4 @@ const styles = StyleSheet.create({
|
|
|
138
142
|
},
|
|
139
143
|
});
|
|
140
144
|
|
|
141
|
-
export default React.memo(ToastContainer);
|
|
145
|
+
export default React.memo(ToastContainer);
|