-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-product.js
85 lines (81 loc) · 2.21 KB
/
create-product.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { Button, Icon, Input, Text } from '@ui-kitten/components';
import { TouchableWithoutFeedback } from '@ui-kitten/components/devsupport';
import React from 'react';
import { View } from 'react-native';
import { ImageOverlay } from './extra/image-overlay.component';
import { KeyboardAvoidingView } from './extra/keyboard-avoiding-view.component';
import { styles } from './form-styles';
export const CreateProductScreen = ({ navigation }) => {
const [names, setNames] = React.useState("");
const [price, setPrice] = React.useState("");
const [manufactureDate, setManufactureDate] = React.useState("");
const [expiryDate, setExpiryDate] = React.useState("");
const [description, setDescription] = React.useState("");
const onSignInButtonPress = () => {
navigation && navigation.goBack();
};
const onSignUpButtonPress = () => {
navigation && navigation.navigate('SignUp1');
};
return (
<KeyboardAvoidingView>
<ImageOverlay
style={styles.container}
source={require('./assets/image-background.jpg')}>
<View style={styles.signInContainer}>
<Text
style={styles.signInLabel}
status='control'
category='h4'>
CREATE PRODUCT
</Text>
</View>
<View style={styles.formContainer}>
<Input
label='NAME'
placeholder='Name'
status='control'
value={names}
onChangeText={setNames}
/>
<Input
label='MANUFACTURE DATE'
placeholder='Manufacture Date'
status='control'
value={manufactureDate}
onChangeText={setManufactureDate}
/>
<Input
label='EXPIRY DATE'
placeholder='Expiry Date'
status='control'
value={expiryDate}
onChangeText={setExpiryDate}
/>
<Input
label='DESCRIPTION'
placeholder='Description'
status='control'
value={description}
onChangeText={setDescription}
multiline={true}
numberOfLines={4}
/>
<Input
label='PRICE'
placeholder='Price'
status='control'
value={price}
onChangeText={setPrice}
/>
</View>
<Button
status='control'
size='large'
onPress={onSignInButtonPress}>
CREATE PRODUCT
</Button>
</ImageOverlay>
</KeyboardAvoidingView>
);
};