Skip to content

Commit 88c833f

Browse files
Merge pull request #9 from rafi-zimraan/main
Deploy Image picker
2 parents daa27e4 + f43ec59 commit 88c833f

File tree

22 files changed

+1182
-475
lines changed

22 files changed

+1182
-475
lines changed

android/app/src/main/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
package="com.rnboilerplate">
33

44
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.CAMERA" />
5+
<!-- <uses-permission android:name="android.permission.CAMERA" />
66
<uses-feature android:name="android.hardware.camera" />
77
<uses-feature android:name="android.hardware.camera.autofocus" />
8-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
8+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> -->
109

10+
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
1111

1212
<application
1313
android:name=".MainApplication"

package-lock.json

+27-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@react-navigation/native-stack": "^6.7.0",
1919
"react": "17.0.2",
2020
"react-native": "0.68.2",
21-
"react-native-image-picker": "^3.0.1",
21+
"react-native-image-picker": "4.8.4",
2222
"react-native-image-slider-box": "^2.0.7",
2323
"react-native-linear-gradient": "^2.8.1",
2424
"react-native-pager-view": "^6.2.0",

src/assets/icons/telephone.png

15.3 KB
Loading

src/assets/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const icons = {
4646
goggleMap: require('../assets/icons/goggleMap.png'),
4747
show: require('../assets/icons/show.png'),
4848
hide: require('../assets/icons/hide.png'),
49+
telephone: require('../assets/icons/telephone.png'),
4950
};
5051

5152
// ! Export all assets files

src/components/Button.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import {TouchableOpacity, Text} from 'react-native';
3+
import {colors} from '../utils';
4+
const Button = ({title, onPress = () => {}}) => {
5+
return (
6+
<TouchableOpacity
7+
onPress={onPress}
8+
activeOpacity={0.7}
9+
style={{
10+
height: 55,
11+
width: '100%',
12+
backgroundColor: colors.blue,
13+
marginVertical: 20,
14+
justifyContent: 'center',
15+
alignItems: 'center',
16+
}}>
17+
<Text style={{color: colors.white, fontWeight: 'bold', fontSize: 18}}>
18+
{title}
19+
</Text>
20+
</TouchableOpacity>
21+
);
22+
};
23+
24+
export default Button;

src/components/Input.js

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React from 'react';
2+
import {View, Text, TextInput, StyleSheet} from 'react-native';
3+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
4+
import {colors} from '../utils';
5+
const Input = ({
6+
label,
7+
iconName,
8+
error,
9+
password,
10+
onFocus = () => {},
11+
...props
12+
}) => {
13+
const [hidePassword, setHidePassword] = React.useState(password);
14+
const [isFocused, setIsFocused] = React.useState(false);
15+
return (
16+
<View style={{marginBottom: 20}}>
17+
<Text style={style.label}>{label}</Text>
18+
<View
19+
style={[
20+
style.inputContainer,
21+
{
22+
borderColor: error
23+
? colors.red
24+
: isFocused
25+
? colors.secondary
26+
: colors.black,
27+
alignItems: 'center',
28+
backgroundColor: '#fff', // Updated background color
29+
},
30+
]}>
31+
<Icon
32+
name={iconName}
33+
style={{color: colors.grey, fontSize: 22, marginRight: 10}}
34+
/>
35+
<TextInput
36+
autoCorrect={false}
37+
onFocus={() => {
38+
onFocus();
39+
setIsFocused(true);
40+
}}
41+
onBlur={() => setIsFocused(false)}
42+
secureTextEntry={hidePassword}
43+
style={{color: colors.black, flex: 1}}
44+
{...props}
45+
/>
46+
{password && (
47+
<Icon
48+
onPress={() => setHidePassword(!hidePassword)}
49+
name={hidePassword ? 'eye-outline' : 'eye-off-outline'}
50+
style={{color: colors.grey, fontSize: 22}}
51+
/>
52+
)}
53+
</View>
54+
{error && (
55+
<Text style={{marginTop: 7, color: colors.red, fontSize: 12}}>
56+
{error}
57+
</Text>
58+
)}
59+
</View>
60+
);
61+
};
62+
63+
const style = StyleSheet.create({
64+
label: {
65+
marginVertical: 5,
66+
fontSize: 14,
67+
color: colors.black,
68+
},
69+
inputContainer: {
70+
height: 55,
71+
flexDirection: 'row',
72+
paddingHorizontal: 15,
73+
borderWidth: 0.9,
74+
borderRadius: 10,
75+
},
76+
});
77+
78+
export default Input;

src/components/Loader.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react';
2+
import {
3+
useWindowDimensions,
4+
View,
5+
Text,
6+
ActivityIndicator,
7+
StyleSheet,
8+
} from 'react-native';
9+
import {colors} from '../utils';
10+
11+
const Loader = ({visible = false}) => {
12+
const {width, height} = useWindowDimensions();
13+
return (
14+
visible && (
15+
<View style={[style.container, {height, width}]}>
16+
<View style={style.loader}>
17+
<ActivityIndicator size="large" color={colors.blue} />
18+
<Text style={{marginLeft: 10, fontSize: 16}}>Loading...</Text>
19+
</View>
20+
</View>
21+
)
22+
);
23+
};
24+
25+
const style = StyleSheet.create({
26+
loader: {
27+
height: 70,
28+
backgroundColor: colors.white,
29+
marginHorizontal: 50,
30+
borderRadius: 5,
31+
flexDirection: 'row',
32+
alignItems: 'center',
33+
paddingHorizontal: 20,
34+
},
35+
container: {
36+
position: 'absolute',
37+
zIndex: 10,
38+
backgroundColor: 'rgba(0,0,0,0.5)',
39+
justifyContent: 'center',
40+
},
41+
});
42+
43+
export default Loader;

src/components/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
import ButtonCustom from './ButtonCustom';
2+
import Loader from './Loader';
3+
import Input from './Input';
4+
import Button from './Button';
25

3-
export { ButtonCustom };
6+
export {ButtonCustom, Loader, Input, Button};

0 commit comments

Comments
 (0)