@janiscommerce/ui-native 1.8.0 → 1.8.1

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.
@@ -5,6 +5,7 @@ import { moderateScale, scaledForDevice } from '../../scale';
5
5
  import { defaultIcon } from './utils';
6
6
  import { base, black } from '../../theme/palette';
7
7
  import BaseToast from '../BaseToast';
8
+ import ToastAction from 'react-native-toast-message';
8
9
  import Text from '../Text';
9
10
  import Icon from '../Icon';
10
11
  const Toast = ({ type, text1, text2, style, props }) => {
@@ -19,6 +20,11 @@ const Toast = ({ type, text1, text2, style, props }) => {
19
20
  const defaultIconName = defaultIcon[type] || defaultIcon.notice;
20
21
  const selectedIconName = customIcon || defaultIconName;
21
22
  const horizontalAlign = validTitle ? 'flex-start' : 'center';
23
+ const handleActionCb = () => actionCb();
24
+ const handleCloseCb = () => {
25
+ ToastAction.hide();
26
+ onCloseCb();
27
+ };
22
28
  const styles = StyleSheet.create({
23
29
  container: {
24
30
  display: 'flex',
@@ -74,10 +80,10 @@ const Toast = ({ type, text1, text2, style, props }) => {
74
80
  </View>
75
81
 
76
82
  <View style={styles.feedbackWrapper}>
77
- {actionTitle && (<TouchableOpacity onPress={actionCb} activeOpacity={0.6}>
83
+ {actionTitle && (<TouchableOpacity onPress={handleActionCb} activeOpacity={0.6}>
78
84
  <Text style={styles.actionTitle}>{actionTitle}</Text>
79
85
  </TouchableOpacity>)}
80
- {showCloseIcon && (<TouchableOpacity onPress={onCloseCb} activeOpacity={0.6}>
86
+ {showCloseIcon && (<TouchableOpacity onPress={handleCloseCb} activeOpacity={0.6}>
81
87
  <Icon name="cross_light" color={validColor} size={24} style={styles.closeIcon}/>
82
88
  </TouchableOpacity>)}
83
89
  </View>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janiscommerce/ui-native",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "components library for Janis app",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",