summaryrefslogtreecommitdiff
path: root/frontend/app/screens/login/login1.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/screens/login/login1.js')
-rw-r--r--frontend/app/screens/login/login1.js129
1 files changed, 129 insertions, 0 deletions
diff --git a/frontend/app/screens/login/login1.js b/frontend/app/screens/login/login1.js
new file mode 100644
index 0000000..73e97d5
--- /dev/null
+++ b/frontend/app/screens/login/login1.js
@@ -0,0 +1,129 @@
+import React from 'react';
+import {
+ View,
+ Image,
+ Dimensions,
+ Keyboard,
+} from 'react-native';
+import {
+ RkButton,
+ RkText,
+ RkTextInput,
+ RkAvoidKeyboard,
+ RkStyleSheet,
+ RkTheme,
+} from 'react-native-ui-kitten';
+import { FontAwesome } from '../../assets/icons';
+import { GradientButton } from '../../components/gradientButton';
+import { scaleModerate, scaleVertical } from '../../utils/scale';
+import NavigationType from '../../config/navigation/propTypes';
+
+export class LoginV1 extends React.Component {
+ static propTypes = {
+ navigation: NavigationType.isRequired,
+ };
+ static navigationOptions = {
+ header: null,
+ };
+
+ getThemeImageSource = (theme) => (
+ theme.name === 'light' ?
+ require('../../assets/images/backgroundLoginV1.png') : require('../../assets/images/backgroundLoginV1DarkTheme.png')
+ );
+
+ renderImage = () => {
+ const screenSize = Dimensions.get('window');
+ const imageSize = {
+ width: screenSize.width,
+ height: screenSize.height - scaleModerate(375, 1),
+ };
+ return (
+ <Image
+ style={[styles.image, imageSize]}
+ source={this.getThemeImageSource(RkTheme.current)}
+ />
+ );
+ };
+
+ onLoginButtonPressed = () => {
+ this.props.navigation.goBack();
+ };
+
+ onSignUpButtonPressed = () => {
+ this.props.navigation.navigate('SignUp');
+ };
+
+ render = () => (
+ <RkAvoidKeyboard
+ onStartShouldSetResponder={() => true}
+ onResponderRelease={() => Keyboard.dismiss()}
+ style={styles.screen}>
+ {this.renderImage()}
+ <View style={styles.container}>
+ <View style={styles.buttons}>
+ <RkButton style={styles.button} rkType='social'>
+ <RkText rkType='awesome hero accentColor'>{FontAwesome.twitter}</RkText>
+ </RkButton>
+ <RkButton style={styles.button} rkType='social'>
+ <RkText rkType='awesome hero accentColor'>{FontAwesome.google}</RkText>
+ </RkButton>
+ <RkButton style={styles.button} rkType='social'>
+ <RkText rkType='awesome hero accentColor'>{FontAwesome.facebook}</RkText>
+ </RkButton>
+ </View>
+ <RkTextInput rkType='rounded' placeholder='Username' />
+ <RkTextInput rkType='rounded' placeholder='Password' secureTextEntry />
+ <GradientButton
+ style={styles.save}
+ rkType='large'
+ onPress={this.onLoginButtonPressed}
+ text='LOGIN'
+ />
+ <View style={styles.footer}>
+ <View style={styles.textRow}>
+ <RkText rkType='primary3'>Don’t have an account?</RkText>
+ <RkButton rkType='clear'>
+ <RkText rkType='header6' onPress={this.onSignUpButtonPressed}>Sign up now</RkText>
+ </RkButton>
+ </View>
+ </View>
+ </View>
+ </RkAvoidKeyboard>
+ )
+}
+
+const styles = RkStyleSheet.create(theme => ({
+ screen: {
+ flex: 1,
+ alignItems: 'center',
+ backgroundColor: theme.colors.screen.base,
+ },
+ image: {
+ resizeMode: 'cover',
+ marginBottom: scaleVertical(10),
+ },
+ container: {
+ paddingHorizontal: 17,
+ paddingBottom: scaleVertical(22),
+ alignItems: 'center',
+ flex: -1,
+ },
+ footer: {
+ justifyContent: 'flex-end',
+ flex: 1,
+ },
+ buttons: {
+ flexDirection: 'row',
+ marginBottom: scaleVertical(24),
+ },
+ button: {
+ marginHorizontal: 14,
+ },
+ save: {
+ marginVertical: 9,
+ },
+ textRow: {
+ justifyContent: 'center',
+ flexDirection: 'row',
+ },
+}));