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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
import React from 'react';
import {
View,
Image,
Keyboard,
} from 'react-native';
import {
RkButton,
RkText,
RkTextInput,
RkStyleSheet,
RkTheme,
RkAvoidKeyboard,
} from 'react-native-ui-kitten';
import { GradientButton } from '../../components/';
import { scaleVertical } from '../../utils/scale';
import NavigationType from '../../config/navigation/propTypes';
export class SignUp extends React.Component {
static navigationOptions = {
header: null,
};
static propTypes = {
navigation: NavigationType.isRequired,
};
getThemeImageSource = (theme) => (
theme.name === 'light' ?
require('../../assets/images/logo.png') : require('../../assets/images/logoDark.png')
);
renderImage = () => (
<Image style={styles.image} source={this.getThemeImageSource(RkTheme.current)} />
);
onSignUpButtonPressed = () => {
this.props.navigation.goBack();
};
onSignInButtonPressed = () => {
this.props.navigation.navigate('Login1');
};
render = () => (
<RkAvoidKeyboard
style={styles.screen}
onStartShouldSetResponder={() => true}
onResponderRelease={() => Keyboard.dismiss()}>
<View style={{ alignItems: 'center' }}>
{this.renderImage()}
<RkText rkType='h1'>Registration</RkText>
</View>
<View style={styles.content}>
<View>
<RkTextInput rkType='rounded' placeholder='Name' />
<RkTextInput rkType='rounded' placeholder='Email' />
<RkTextInput rkType='rounded' placeholder='Password' secureTextEntry />
<RkTextInput rkType='rounded' placeholder='Confirm Password' secureTextEntry />
<GradientButton
style={styles.save}
rkType='large'
text='SIGN UP'
onPress={this.onSignUpButtonPressed}
/>
</View>
<View style={styles.footer}>
<View style={styles.textRow}>
<RkText rkType='primary3'>Already have an account?</RkText>
<RkButton rkType='clear' onPress={this.onSignInButtonPressed}>
<RkText rkType='header6'>Sign in now</RkText>
</RkButton>
</View>
</View>
</View>
</RkAvoidKeyboard>
)
}
const styles = RkStyleSheet.create(theme => ({
screen: {
padding: 16,
flex: 1,
justifyContent: 'space-around',
backgroundColor: theme.colors.screen.base,
},
image: {
marginBottom: 10,
height: scaleVertical(77),
resizeMode: 'contain',
},
content: {
justifyContent: 'space-between',
},
save: {
marginVertical: 20,
},
buttons: {
flexDirection: 'row',
marginBottom: 24,
marginHorizontal: 24,
justifyContent: 'space-around',
},
footer: {
justifyContent: 'flex-end',
},
textRow: {
flexDirection: 'row',
justifyContent: 'center',
},
}));
|