diff options
| author | Andrew <saintruler@gmail.com> | 2019-03-11 21:00:02 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2019-03-11 21:00:02 +0400 |
| commit | 7e7dd5244e8d26485ad7950a89c04c98c4fef83f (patch) | |
| tree | 810730c4650392080fb87a78d3b527201e89fe4b /frontend/app/screens/login/login2.js | |
Initial commit/
Diffstat (limited to 'frontend/app/screens/login/login2.js')
| -rw-r--r-- | frontend/app/screens/login/login2.js | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/frontend/app/screens/login/login2.js b/frontend/app/screens/login/login2.js new file mode 100644 index 0000000..c211190 --- /dev/null +++ b/frontend/app/screens/login/login2.js @@ -0,0 +1,127 @@ +import React from 'react'; +import { + View, + Image, + Keyboard, +} from 'react-native'; +import { + RkButton, + RkText, + RkTextInput, + RkAvoidKeyboard, + RkTheme, + RkStyleSheet, +} from 'react-native-ui-kitten'; +import { FontAwesome } from '../../assets/icons'; +import { GradientButton } from '../../components/gradientButton'; +import { scaleVertical } from '../../utils/scale'; +import NavigationType from '../../config/navigation/propTypes'; + +export class LoginV2 extends React.Component { + static propTypes = { + navigation: NavigationType.isRequired, + }; + static navigationOptions = { + header: null, + }; + + onLoginButtonPressed = () => { + this.props.navigation.goBack(); + }; + + onSignUpButtonPressed = () => { + this.props.navigation.navigate('SignUp'); + }; + + 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)} /> + ); + + render = () => ( + <RkAvoidKeyboard + style={styles.screen} + onStartShouldSetResponder={() => true} + onResponderRelease={() => Keyboard.dismiss()}> + <View style={styles.header}> + {this.renderImage()} + <RkText rkType='light h1'>React Native</RkText> + <RkText rkType='logo h0'>UI Kitten</RkText> + </View> + <View style={styles.content}> + <View> + <RkTextInput rkType='rounded' placeholder='Username' /> + <RkTextInput rkType='rounded' placeholder='Password' secureTextEntry /> + <GradientButton + style={styles.save} + rkType='large' + text='LOGIN' + onPress={this.onLoginButtonPressed} + /> + </View> + <View style={styles.buttons}> + <RkButton style={styles.button} rkType='social'> + <RkText rkType='awesome hero'>{FontAwesome.twitter}</RkText> + </RkButton> + <RkButton style={styles.button} rkType='social'> + <RkText rkType='awesome hero'>{FontAwesome.google}</RkText> + </RkButton> + <RkButton style={styles.button} rkType='social'> + <RkText rkType='awesome hero'>{FontAwesome.facebook}</RkText> + </RkButton> + </View> + <View style={styles.footer}> + <View style={styles.textRow}> + <RkText rkType='primary3'>Don’t have an account?</RkText> + <RkButton rkType='clear' onPress={this.onSignUpButtonPressed}> + <RkText rkType='header6'>Sign up now</RkText> + </RkButton> + </View> + </View> + </View> + </RkAvoidKeyboard> + ); +} + +const styles = RkStyleSheet.create(theme => ({ + screen: { + padding: scaleVertical(16), + flex: 1, + justifyContent: 'space-between', + backgroundColor: theme.colors.screen.base, + }, + image: { + height: scaleVertical(77), + resizeMode: 'contain', + }, + header: { + paddingBottom: scaleVertical(10), + alignItems: 'center', + justifyContent: 'center', + flex: 1, + }, + content: { + justifyContent: 'space-between', + }, + save: { + marginVertical: 20, + }, + buttons: { + flexDirection: 'row', + marginBottom: scaleVertical(24), + marginHorizontal: 24, + justifyContent: 'space-around', + }, + textRow: { + flexDirection: 'row', + justifyContent: 'center', + }, + button: { + borderColor: theme.colors.border.solid, + }, + footer: {}, +})); |