@jescon-technologies/react-native-ui-kit 0.0.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.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ JESCON TECHNOLOGIES PVT LTD License
2
+
3
+ Copyright (c) 2024 PRAFULDAS M M
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@jescon-technologies/react-native-ui-kit",
3
+ "version": "0.0.1",
4
+ "description": "A React Native module for Jescon Technologies that provides react-native-ui-kit",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "react-native",
11
+ "react-native-ui-kit"
12
+ ],
13
+ "author": "PRAFULDAS M M",
14
+ "license": "JESCON TECHNOLOGIES PVT LTD",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/dpraful/react-native-ui-kit.git"
18
+ },
19
+ "homepage": "https://github.com/dpraful/react-native-ui-kit#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/dpraful/react-native-ui-kit/issues"
22
+ },
23
+ "peerDependencies": {
24
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
25
+ "react-native": ">=0.60.0",
26
+ "react-native-vector-icons": "^9.0.0",
27
+ "react-native-geolocation-service": "^5.0.0",
28
+ "react-native-image-resizer": "^1.0.0",
29
+ "@react-navigation/native": "^6.0.0",
30
+ "prop-types": "^15.8.0",
31
+ "react-native-fs": "^2.20.0"
32
+ },
33
+ "devDependencies": {
34
+ "react": "^18.0.0",
35
+ "react-native": "^0.69.0"
36
+ }
37
+ }
@@ -0,0 +1,137 @@
1
+ import React, { useState, memo, useEffect } from 'react';
2
+ import { View, Dimensions, Text, TouchableOpacity, StyleSheet, TextInput, Platform, Image } from 'react-native';
3
+ import { Global } from '../Common/Global';
4
+ import Icons from '../Common/Icons';
5
+ import { ValueCheck } from '../CommonStyle/ComponentFunctions';
6
+ import { normalize } from '../CommonStyle/componentStyle';
7
+ import CModalOverlay from '../CustomComponents/CModalOverlay';
8
+
9
+ export default function AAlert(props) {
10
+ const [overlay, setOverlay] = useState(true)
11
+ const [data] = useState({
12
+ ...props.data,
13
+ "bgcolor": getBgColor(props.data.datavalue),
14
+ "durartion": getDurarion(props.data.datavalue)
15
+ });
16
+
17
+ useEffect(() => {
18
+ setTimeout(() => {
19
+ props.close(false)
20
+ setOverlay(false)
21
+ }, data.durartion)
22
+ }, []);
23
+
24
+ function getBgColor(key) {
25
+ switch (key) {
26
+ case 1: return "#0ca004"
27
+ case 2: return "#f44e4e"
28
+ case 3: return "#bfbf18"
29
+ case 4: return "#d88304"
30
+ default: return Global.AppTheme.primary_color
31
+ }
32
+ }
33
+
34
+ function getTransparentColor(key) {
35
+ switch (key) {
36
+ case 1: return "rgba(0, 90, 0, 0.2)"
37
+ case 2: return "rgba(90, 0, 0, 0.2)"
38
+ case 3: return "rgba(249, 242, 172, 0.2)"
39
+ case 4: return "rgba(249, 212, 167, 0.2)"
40
+ default: return "rgba(0, 0, 0, 0.2)"
41
+ }
42
+ }
43
+
44
+ function getDurarion(key) {
45
+ switch (key) {
46
+ case 1: return 2000
47
+ case 2: return 2000
48
+ case 3: return 2000
49
+ case 4: return 2000
50
+ default: return 2000
51
+ }
52
+ }
53
+
54
+ function getPopupContainerStyleIOS() {
55
+ return {
56
+ ...styles.overlaystyle,
57
+ backgroundColor: ValueCheck(data.bgcolor) ? data.bgcolor : '#fff',
58
+ bottom: normalize(100),
59
+ };
60
+ }
61
+
62
+ return (
63
+ <CModalOverlay
64
+ visible={overlay}
65
+ onClose={() => setOverlay(false)}
66
+ animationType="fadeInUp"
67
+ // containerStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.00)' }}
68
+ animationDuration={500}
69
+ closeOnTouchOutside={false}
70
+ containerStyle={{ width: '100%', backgroundColor: getTransparentColor(data.datavalue) }}
71
+ childrenWrapperStyle={getPopupContainerStyleIOS()}>
72
+
73
+ <TouchableOpacity
74
+ style={{ position: 'absolute', right: normalize(15), zIndex: 1, top: normalize(5) }}
75
+ onPress={() => setOverlay(false, props.close(false))}>
76
+ <Icons.AntDesign name={"closecircleo"} size={normalize(15)} color={"#fff"} />
77
+ </TouchableOpacity>
78
+ <View style={{ flexDirection: 'row', width: '100%', borderWidth: 0 }}>
79
+ <View style={{ flexDirection: 'row', alignItems: 'center', borderWidth: 0, justifyContent: 'center' }}>
80
+ <Image
81
+ style={{
82
+ borderWidth: 0,
83
+ height: normalize(30),
84
+ width: normalize(30),
85
+ borderRadius: normalize(50),
86
+ }}
87
+ resizeMode={'stretch'}
88
+ source={require('../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
89
+ />
90
+ <Icons.Entypo
91
+ color={"#fff"}
92
+ name={'info'}
93
+ size={normalize(15)}
94
+ style={{
95
+ borderWidth: 0
96
+ }}
97
+ />
98
+ </View>
99
+
100
+
101
+
102
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', flex: 1 }}>
103
+
104
+ <Text
105
+ adjustsFontSizeToFit
106
+ style={{
107
+ color: "#fff",
108
+ fontWeight: 'bold',
109
+ fontSize: normalize(16),
110
+ paddingLeft: normalize(7),
111
+ }}>
112
+ {ValueCheck(data.displaytext) ? data.displaytext : ''}
113
+ </Text>
114
+ </View>
115
+ </View>
116
+ </CModalOverlay>
117
+ );
118
+
119
+
120
+ function getClose() {
121
+ setOverlay(false)
122
+ props.close != undefined ? props.close(false) : null
123
+ }
124
+ }
125
+
126
+
127
+ const styles = StyleSheet.create({
128
+ overlaystyle: {
129
+ position: 'absolute',
130
+ width: Dimensions.get('window').width,
131
+ borderRadius: normalize(30),
132
+ borderWidth: 2,
133
+ borderColor: '#e0e0e0',
134
+ },
135
+ });
136
+
137
+
@@ -0,0 +1,97 @@
1
+ import React, { useState, memo, useEffect } from 'react';
2
+ import { View, Dimensions, Text, TouchableOpacity, StyleSheet, TextInput, Platform, Image } from 'react-native';
3
+ import { Global } from '../Common/Global';
4
+ import Icons from '../Common/Icons';
5
+ import { ValueCheck } from '../CommonStyle/ComponentFunctions';
6
+ import { normalize } from '../CommonStyle/componentStyle';
7
+
8
+ export default function AAlertIOS(props) {
9
+ const [overlay, setOverlay] = useState(true)
10
+ const [data] = useState({
11
+ ...props.data,
12
+ "bgcolor": getBgColor(props.data.datavalue),
13
+ "durartion": getDurarion(props.data.datavalue)
14
+ });
15
+
16
+ useEffect(() => {
17
+ setTimeout(() => {
18
+ props.close(false)
19
+ setOverlay(false)
20
+ }, data.durartion)
21
+ }, []);
22
+
23
+ function getBgColor(key) {
24
+ switch (key) {
25
+ case 1: return "#0ca004"
26
+ case 2: return "#f44e4e"
27
+ case 3: return "#bfbf18"
28
+ case 4: return "#d88304"
29
+ default: return Global.AppTheme.primary_color
30
+ }
31
+ }
32
+
33
+ function getDurarion(key) {
34
+ switch (key) {
35
+ case 1: return 2500
36
+ case 2: return 2500
37
+ case 3: return 2500
38
+ case 4: return 2500
39
+ default: return 2500
40
+ }
41
+ }
42
+
43
+ return (
44
+ <View style={{ position: 'absolute', bottom: normalize(80), zIndex: 1 }}>
45
+ <View style={{
46
+ flexDirection: 'row', backgroundColor: data.bgcolor,
47
+ width: Dimensions.get('screen').width, paddingHorizontal: normalize(10),
48
+ paddingVertical: normalize(10), borderRadius: normalize(10),
49
+ borderWidth: normalize(2), borderColor: '#fff'
50
+ }}>
51
+ <Image
52
+ style={{
53
+ height: normalize(30),
54
+ width: normalize(30),
55
+ borderRadius: normalize(50),
56
+ alignSelf: 'flex-start'
57
+ }}
58
+ resizeMode={'stretch'}
59
+ source={require('../../android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png')}
60
+ />
61
+
62
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingLeft: normalize(15) }}>
63
+ <Icons.Entypo
64
+ color={"#fff"}
65
+ name={'info'}
66
+ size={normalize(15)}
67
+ />
68
+ <Text
69
+ adjustsFontSizeToFit
70
+ style={{
71
+ color: "#fff",
72
+ fontWeight: 'bold',
73
+ fontSize: normalize(16),
74
+ paddingLeft: normalize(7),
75
+ paddingRight: normalize(30),
76
+ }}>
77
+ {ValueCheck(data.displaytext) ? data.displaytext : ''}
78
+ </Text>
79
+ </View>
80
+ </View>
81
+ </View>
82
+ );
83
+
84
+ }
85
+
86
+
87
+ const styles = StyleSheet.create({
88
+ overlaystyle: {
89
+ position: 'absolute',
90
+ width: Dimensions.get('window').width,
91
+ borderRadius: normalize(15),
92
+ borderWidth: 2,
93
+ borderColor: '#e0e0e0',
94
+ },
95
+ });
96
+
97
+
@@ -0,0 +1,40 @@
1
+ import React, { Component } from 'react'
2
+ import { Animated, View } from 'react-native'
3
+
4
+ export default class ABlink extends Component {
5
+
6
+ constructor(props) {
7
+ super(props);
8
+ this.fadeAnimation = new Animated.Value(0);
9
+ }
10
+
11
+ componentDidMount() {
12
+ Animated.loop(
13
+ Animated.sequence([
14
+ Animated.timing(this.fadeAnimation, {
15
+ toValue: 0,
16
+ duration: this.props.duration,
17
+ useNativeDriver: true,
18
+ }),
19
+ Animated.timing(this.fadeAnimation, {
20
+ toValue: 1,
21
+ duration: this.props.duration,
22
+ useNativeDriver: true,
23
+ })
24
+ ]),
25
+ {
26
+ iterations: this.props.repeat_count
27
+ }
28
+ ).start();
29
+ }
30
+
31
+ render() {
32
+ return (
33
+ <View style={{ ...this.props.style }}>
34
+ <Animated.View style={{ opacity: this.fadeAnimation }}>
35
+ {this.props.children}
36
+ </Animated.View>
37
+ </View>
38
+ )
39
+ }
40
+ }
@@ -0,0 +1,73 @@
1
+ import React, { ErrorInfo, ReactNode } from 'react';
2
+ import { Button, StyleSheet, Text, View, Image } from 'react-native';
3
+ import { notifyMessage } from '../CommonStyle/ComponentFunctions';
4
+ import { normalize } from '../CommonStyle/componentStyle';
5
+
6
+ interface Props {
7
+ children: ReactNode;
8
+ }
9
+
10
+ interface State {
11
+ hasError: boolean;
12
+ }
13
+
14
+ class ErrorBoundary extends React.Component<Props, State> {
15
+ constructor(props: Props) {
16
+ super(props);
17
+ this.state = { hasError: false };
18
+ }
19
+
20
+ static getDerivedStateFromError(_: Error): State {
21
+ // Update state so the next render will show the fallback UI.
22
+ return { hasError: true };
23
+ }
24
+
25
+ componentDidCatch(error: Error, errorInfo: ErrorInfo) {
26
+ // You can also log the error to an error reporting service
27
+ // console.log('componentDidCatch ', error, ' ', errorInfo);
28
+ notifyMessage("ERROR : " + error + ' ' + errorInfo, 2)
29
+ }
30
+
31
+ render() {
32
+ if (this.state.hasError) {
33
+ // You can render any custom fallback UI
34
+ return (
35
+ <View style={styles.container}>
36
+ <View style={{ width: '100%', }}>
37
+ <Image
38
+ source={{ uri: "https://t4.ftcdn.net/jpg/05/24/04/51/360_F_524045110_UXnCx4GEDapddDi5tdlY96s4g0MxHRvt.jpg" }}
39
+ resizeMode="cover" style={{ height: normalize(200) }} />
40
+ </View>
41
+ <Text style={styles.message}>
42
+ Something went wrong.{'\n'} Our team has taken a note of this issue.
43
+ </Text>
44
+ {/* <Button
45
+ title="Try Again"
46
+ onPress={() => CodePush.restartApp()}
47
+ /> */}
48
+
49
+ </View>
50
+ );
51
+ }
52
+
53
+ return this.props.children;
54
+ }
55
+ }
56
+
57
+ export default ErrorBoundary;
58
+
59
+ const styles = StyleSheet.create({
60
+ container: {
61
+ flex: 1,
62
+ justifyContent: 'center',
63
+ alignItems: 'center',
64
+ backgroundColor: '#fff'
65
+ },
66
+ message: {
67
+ fontSize: normalize(16),
68
+ color: 'black',
69
+ marginBottom: 20,
70
+ textAlign: 'center',
71
+ paddingHorizontal: 10,
72
+ },
73
+ });
@@ -0,0 +1,49 @@
1
+ import MaterialCommunityIconsI from 'react-native-vector-icons/MaterialCommunityIcons'
2
+ import SimpleLineIconsI from 'react-native-vector-icons/SimpleLineIcons'
3
+ import MaterialIconsI from 'react-native-vector-icons/MaterialIcons'
4
+ import FontAwesomeI from 'react-native-vector-icons/FontAwesome'
5
+ import FoundationI from 'react-native-vector-icons/Foundation'
6
+ import EvilIconsI from 'react-native-vector-icons/EvilIcons'
7
+ import OcticonsI from 'react-native-vector-icons/Octicons'
8
+ import IoniconsI from 'react-native-vector-icons/Ionicons'
9
+ import FeatherI from 'react-native-vector-icons/Feather'
10
+ import EntypoI from 'react-native-vector-icons/Entypo'
11
+ import ZocialI from 'react-native-vector-icons/Zocial'
12
+ import FontAwesomeFive from 'react-native-vector-icons/FontAwesome5';
13
+ import AntDesignI from 'react-native-vector-icons/AntDesign';
14
+ import React from 'react'
15
+
16
+ export const MaterialCommunityIcons = props => (
17
+ <MaterialCommunityIconsI {...props} />
18
+ )
19
+ const SimpleLineIcons = props => <SimpleLineIconsI {...props} />
20
+ const MaterialIcons = props => <MaterialIconsI {...props} />
21
+ const FontAwesome = props => <FontAwesomeI {...props} />
22
+ const Foundation = props => <FoundationI {...props} />
23
+ const EvilIcons = props => <EvilIconsI {...props} />
24
+ const Ionicons = props => <IoniconsI {...props} />
25
+ const Octicons = props => <OcticonsI {...props} />
26
+ const Feather = props => <FeatherI {...props} />
27
+ const Entypo = props => <EntypoI {...props} />
28
+ const Zocial = props => <ZocialI {...props} />
29
+ const FontAwesome5 = props => <FontAwesomeFive {...props} />
30
+ const AntDesign = props => <AntDesignI {...props} />
31
+
32
+
33
+
34
+ export default {
35
+ MaterialCommunityIcons,
36
+ SimpleLineIcons,
37
+ SimpleLineIcons,
38
+ MaterialIcons,
39
+ FontAwesome,
40
+ Foundation,
41
+ EvilIcons,
42
+ Ionicons,
43
+ Octicons,
44
+ Feather,
45
+ Entypo,
46
+ Zocial,
47
+ FontAwesome5,
48
+ AntDesign
49
+ }