@jescon-technologies/react-native-ui-kit 0.0.9 → 0.0.10

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 CHANGED
@@ -1,3 +1,3 @@
1
1
  export { default as ErrorBoundary } from './src/Common/ErrorBoundary';
2
- export { default as AAlertIOS } from './Alerts/AAlertIOS';
3
- export { default as AAlert } from './Alerts/AAlert';
2
+ export { default as AAlertIOS } from './src/Alerts/AAlertIOS';
3
+ export { default as AAlert } from './src/Alerts/AAlert';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jescon-technologies/react-native-ui-kit",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "A React Native module for Jescon Technologies that provides react-native-ui-kit",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -144,7 +144,7 @@ const AAlert: React.FC<Props> = (props) => {
144
144
  borderRadius: normalize(50),
145
145
  }}
146
146
  resizeMode="stretch"
147
- source={require('../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
147
+ source={require('../../../../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
148
148
  />
149
149
 
150
150
  <Icons.Entypo
@@ -95,7 +95,7 @@ const AAlertIOS: React.FC<Props> = (props) => {
95
95
  alignSelf: 'flex-start',
96
96
  }}
97
97
  resizeMode="stretch"
98
- source={require('../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
98
+ source={require('../../../../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
99
99
  />
100
100
 
101
101
  {/* Text content */}
@@ -13,7 +13,6 @@ import {
13
13
  View,
14
14
  Image,
15
15
  } from 'react-native';
16
- import Sound from 'react-native-sound';
17
16
  import NetInfo from '@react-native-community/netinfo';
18
17
  import { Global } from '../../../../../src/Common/Global';
19
18
  import { APIURL } from '../../../../../src/Common/apiConstants';
@@ -26,18 +25,6 @@ const {
26
25
 
27
26
  const scale = SCREEN_WIDTH / 320;
28
27
 
29
- export function getSound(code) {
30
- Sound.setCategory('Playback');
31
- const track = new Sound(code, Sound.MAIN_BUNDLE, (e) => {
32
- if (e) {
33
- console.log('error loading track:', e);
34
- } else {
35
- console.log('Playings');
36
- track.play();
37
- }
38
- });
39
- }
40
-
41
28
  export function CButtonShadow() {
42
29
 
43
30
  const isAndroidBelow9 = Platform.OS === 'android' && Platform.Version < 28;
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import {
3
+ View,
4
+ Modal,
5
+ TouchableWithoutFeedback,
6
+ StyleSheet,
7
+ ScrollView,
8
+ SafeAreaView,
9
+ Dimensions,
10
+ ViewStyle,
11
+ StyleProp,
12
+ } from 'react-native';
13
+
14
+ const { height: SCREEN_HEIGHT } = Dimensions.get('window');
15
+
16
+ interface CModalOverlayProps {
17
+ visible: boolean;
18
+ onClose?: () => void;
19
+ children: React.ReactNode;
20
+
21
+ closeOnTouchOutside?: boolean;
22
+
23
+ containerStyle?: StyleProp<ViewStyle>;
24
+ childrenWrapperStyle?: StyleProp<ViewStyle>;
25
+ contentStyle?: StyleProp<ViewStyle>;
26
+ footerStyle?: StyleProp<ViewStyle>;
27
+
28
+ footer?: React.ReactNode;
29
+ }
30
+
31
+ const CModalOverlay: React.FC<CModalOverlayProps> = ({
32
+ visible,
33
+ onClose,
34
+ children,
35
+ closeOnTouchOutside = true,
36
+ containerStyle,
37
+ childrenWrapperStyle,
38
+ contentStyle,
39
+ footer,
40
+ footerStyle,
41
+ }) => {
42
+ if (!visible) return null;
43
+
44
+ return (
45
+ <Modal visible={visible} transparent statusBarTranslucent>
46
+ <SafeAreaView style={styles.safeArea}>
47
+ <View style={[styles.container, containerStyle]}>
48
+ {/* Background */}
49
+ <TouchableWithoutFeedback
50
+ disabled={!closeOnTouchOutside}
51
+ onPress={onClose}
52
+ >
53
+ <View style={styles.overlayBackground} />
54
+ </TouchableWithoutFeedback>
55
+
56
+ {/* Modal Content */}
57
+ <View style={[styles.childrenWrapper, childrenWrapperStyle]}>
58
+ <ScrollView
59
+ bounces={false}
60
+ showsVerticalScrollIndicator={false}
61
+ contentContainerStyle={[styles.content, contentStyle]}
62
+ >
63
+ {children}
64
+ </ScrollView>
65
+
66
+ {footer && <View style={footerStyle}>{footer}</View>}
67
+ </View>
68
+ </View>
69
+ </SafeAreaView>
70
+ </Modal>
71
+ );
72
+ };
73
+
74
+ const styles = StyleSheet.create({
75
+ overlayBackground: {
76
+ ...StyleSheet.absoluteFillObject,
77
+ },
78
+
79
+ safeArea: {
80
+ flex: 1,
81
+ },
82
+
83
+ container: {
84
+ flex: 1,
85
+ justifyContent: 'center',
86
+ alignItems: 'center',
87
+ },
88
+
89
+ childrenWrapper: {
90
+ backgroundColor: '#fff',
91
+ borderRadius: 0,
92
+ },
93
+
94
+ content: {
95
+ flexGrow: 1,
96
+ maxHeight: SCREEN_HEIGHT,
97
+ },
98
+ });
99
+
100
+ export default CModalOverlay;