2021-04-12 17:24:57 +07:00
|
|
|
import * as React from 'react';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
import { Alert, Button, Image, StyleSheet, Dimensions, SafeAreaView, ScrollView, TouchableOpacity, ImageBackground, Modal, Pressable } from 'react-native';
|
|
|
|
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
|
|
|
import { Ionicons, FontAwesome } from '@expo/vector-icons';
|
|
|
|
|
import EditScreenInfo from '../components/EditScreenInfo';
|
|
|
|
|
import { Text, View } from '../components/Themed';
|
|
|
|
|
import { TextInput } from 'react-native-gesture-handler';
|
|
|
|
|
import { useNavigation } from '@react-navigation/native';
|
|
|
|
|
|
|
|
|
|
export default function Login() {
|
2021-04-13 17:17:14 +07:00
|
|
|
const navigation = useNavigation();
|
2021-04-12 17:24:57 +07:00
|
|
|
return (
|
|
|
|
|
<SafeAreaView style={styles.container}>
|
2021-05-17 17:03:05 +07:00
|
|
|
<View style={styles.boxLogin}>
|
|
|
|
|
<View style={styles.boxLoginTop}>
|
|
|
|
|
<TouchableOpacity style={styles.boxLoginLogo}>
|
|
|
|
|
<Image source={require('../assets/images/logo.png')} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
<View style={styles.boxLoginItemList}>
|
|
|
|
|
<View style={styles.boxLoginItem}>
|
|
|
|
|
<Ionicons style={styles.boxLoginItemIcon} name="person-outline" />
|
|
|
|
|
<TextInput style={styles.boxLoginItemInput} placeholder="Email đăng nhập*" />
|
2021-04-12 17:24:57 +07:00
|
|
|
</View>
|
2021-05-17 17:03:05 +07:00
|
|
|
<View style={styles.boxLoginItem}>
|
|
|
|
|
<Ionicons style={styles.boxLoginItemIcon} name="lock-closed-outline" />
|
|
|
|
|
<TextInput style={[styles.boxLoginItemInput, styles.boxLoginItemInputMk]} placeholder="Mật khẩu" />
|
|
|
|
|
<TouchableOpacity onPress={() => navigation.navigate('ForgotPassword')} style={styles.boxLoginItemForgitPas}>
|
|
|
|
|
<Text style={styles.boxLoginItemForgitPasText}>Quên?</Text>
|
2021-04-12 17:24:57 +07:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
2021-05-17 17:03:05 +07:00
|
|
|
<TouchableOpacity onPress={() => navigation.navigate('AccountHome')} style={styles.boxLoginButton}>
|
|
|
|
|
<Text style={styles.boxLoginButtonText}>Đăng nhập</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
<View style={styles.boxLoginButtonRegis}>
|
|
|
|
|
<Text style={styles.boxLoginButtonRegisText}>Khách hàng mới?</Text>
|
|
|
|
|
<TouchableOpacity onPress={() => navigation.navigate('Register')}>
|
|
|
|
|
<Text style={styles.boxLoginButtonRegisBt}>Đăng ký</Text>
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
<View style={styles.boxLoginLineChia}>
|
|
|
|
|
<View style={styles.boxLoginLine}></View>
|
|
|
|
|
<Text style={styles.boxLoginLineChiaText}>Hoặc</Text>
|
|
|
|
|
<View style={styles.boxLoginLine}></View>
|
|
|
|
|
</View>
|
|
|
|
|
<View style={styles.loginSocial}>
|
|
|
|
|
<TouchableOpacity style={[styles.loginSocialItem, styles.loginSocialItemFace]}>
|
|
|
|
|
<FontAwesome style={styles.loginSocialItemIcon} name="facebook" />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
<TouchableOpacity style={[styles.loginSocialItem, styles.loginSocialItemGoogle]}>
|
|
|
|
|
<FontAwesome style={styles.loginSocialItemIcon} name="google" />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
<TouchableOpacity style={[styles.loginSocialItem, styles.loginSocialItemZalo]}>
|
|
|
|
|
<Image style={styles.loginSocialItemImg} source={require('../assets/images/zalo-login.png')} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
</View>
|
2021-04-12 17:24:57 +07:00
|
|
|
</SafeAreaView>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const winWidth = Dimensions.get('window').width; //full width
|
|
|
|
|
const winHeight = Dimensions.get('window').height; //full height
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
container: {
|
|
|
|
|
flex: 1,
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
},
|
|
|
|
|
boxLogin: {
|
|
|
|
|
width: winWidth,
|
2021-05-17 17:03:05 +07:00
|
|
|
height: winHeight - 130,
|
2021-04-12 17:24:57 +07:00
|
|
|
padding: 10,
|
|
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginTop: {
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
justifyContent: 'center',
|
2021-04-12 17:24:57 +07:00
|
|
|
marginBottom: 20,
|
|
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginLogo: {},
|
|
|
|
|
boxLoginItemList: {},
|
|
|
|
|
boxLoginItem: {
|
2021-04-12 17:24:57 +07:00
|
|
|
marginBottom: 10,
|
|
|
|
|
flexDirection: 'row',
|
|
|
|
|
alignItems: 'center',
|
2021-05-17 17:03:05 +07:00
|
|
|
borderBottomColor: '#ABABAB',
|
|
|
|
|
borderBottomWidth: 1,
|
|
|
|
|
paddingBottom: 5,
|
|
|
|
|
position: 'relative',
|
|
|
|
|
},
|
|
|
|
|
boxLoginItemIcon: {
|
|
|
|
|
fontSize: 24,
|
|
|
|
|
width: 32,
|
|
|
|
|
},
|
|
|
|
|
boxLoginItemInput: {
|
|
|
|
|
width: winWidth - 52,
|
|
|
|
|
height: 30,
|
|
|
|
|
},
|
|
|
|
|
boxLoginItemInputMk: {
|
|
|
|
|
paddingRight: 50,
|
|
|
|
|
},
|
|
|
|
|
boxLoginItemForgitPas: {
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
right: 0,
|
|
|
|
|
borderLeftColor: '#e1e1e1',
|
|
|
|
|
borderLeftWidth: 1,
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 30,
|
|
|
|
|
flexDirection: 'row',
|
2021-04-12 17:24:57 +07:00
|
|
|
justifyContent: 'flex-end',
|
2021-05-17 17:03:05 +07:00
|
|
|
alignItems: 'center',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginItemForgitPasText: {
|
|
|
|
|
color: '#0070C7'
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginButton: {
|
2021-04-12 17:24:57 +07:00
|
|
|
width: '100%',
|
|
|
|
|
height: 40,
|
|
|
|
|
borderRadius: 5,
|
|
|
|
|
marginBottom: 10,
|
2021-05-17 17:03:05 +07:00
|
|
|
backgroundColor: '#D8262F',
|
2021-04-12 17:24:57 +07:00
|
|
|
flexDirection: 'row',
|
2021-05-17 17:03:05 +07:00
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginButtonText: {
|
|
|
|
|
fontWeight: '700',
|
|
|
|
|
color: '#fff',
|
|
|
|
|
textTransform: 'uppercase',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginButtonRegis: {
|
|
|
|
|
marginBottom: 20,
|
2021-04-12 17:24:57 +07:00
|
|
|
flexDirection: 'row',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginButtonRegisText: {
|
|
|
|
|
marginRight: 5,
|
|
|
|
|
},
|
|
|
|
|
boxLoginButtonRegisBt: {
|
|
|
|
|
color: '#0070C7',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginLineChia: {
|
2021-04-12 17:24:57 +07:00
|
|
|
marginBottom: 20,
|
|
|
|
|
flexDirection: 'row',
|
2021-05-17 17:03:05 +07:00
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center'
|
|
|
|
|
},
|
|
|
|
|
boxLoginLine: {
|
|
|
|
|
width: 80,
|
|
|
|
|
height: 1,
|
|
|
|
|
backgroundColor: '#e1e1e1',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
boxLoginLineChiaText: {
|
|
|
|
|
marginHorizontal: 5,
|
|
|
|
|
color: '#777',
|
|
|
|
|
fontWeight: '300',
|
|
|
|
|
},
|
|
|
|
|
loginSocial: {
|
2021-04-12 17:24:57 +07:00
|
|
|
flexDirection: 'row',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
loginSocialItem: {
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
borderRadius: 20,
|
|
|
|
|
backgroundColor: '#3B5998',
|
|
|
|
|
marginHorizontal: 8,
|
2021-04-12 17:24:57 +07:00
|
|
|
flexDirection: 'row',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
loginSocialItemIcon: {
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
color: '#fff'
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
loginSocialItemImg: {
|
|
|
|
|
width: 22,
|
|
|
|
|
height: 24,
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
loginSocialItemFace: {},
|
|
|
|
|
loginSocialItemGoogle: {
|
|
|
|
|
backgroundColor: '#DF4A32',
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
2021-05-17 17:03:05 +07:00
|
|
|
loginSocialItemZalo: {
|
|
|
|
|
backgroundColor: '#0F8EDD'
|
2021-04-12 17:24:57 +07:00
|
|
|
},
|
|
|
|
|
});
|