
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import React, {useContext, useState} from 'react';
import Button from '../component/Button';
import Input from '../component/Input';
import {View, StyleSheet, ScrollView, Text} from 'react-native';
import {
container,
pageTitleBox,
pageTitle,
} from './../resoureces/styles/GlobalStyles';
import {AuthContext} from './../context/AuthContext';
export default function Login({navigation}) {
const {onClickLogin} = useContext(AuthContext);
const [inputId, setInputId] = useState();
const [inputPw, setInputPw] = useState();
return (
<View style={{flex: 1}}>
<View style={pageTitleBox}>
<Text style={pageTitle}>로그인</Text>
</View>
<View style={container}>
<ScrollView>
<View>
<Input
onChangeText={inputId => {
setInputId(inputId);
}}
placeholder="아이디"
/>
<Input
onChangeText={inputPw => {
setInputPw(inputPw);
}}
secureTextEntry={true}
placeholder="비밀번호"
/>
<Button
title={'로그인'}
backgroundColor={'#000000'}
padding={10}
borderRadius={50}
marginBottom={10}
color={'#ffffff'}
textAlign={'center'}
onPress={() => {
onClickLogin(inputId, inputPw);
}}
/>
</View>
<View style={styles.buttonContainer}>
<Button
title={'회원가입'}
onPress={() => {
navigation.navigate('Agreement');
}}
color={'#333333'}
padding={10}
/>
<Button
title={'아이디찾기'}
onPress={() => {
navigation.navigate('FindID');
}}
color={'#333333'}
padding={10}
/>
<Button
title={'비밀번호찾기'}
onPress={() => {
navigation.navigate('FindPassword');
}}
color={'#333333'}
padding={10}
/>
</View>
</ScrollView>
</View>
</View>
);
}
const styles = StyleSheet.create({
buttonContainer: {
flexDirection: 'row',
justifyContent: 'center',
},
pageTitleBox: {
paddingVertical: 20,
borderBottomWidth: 1,
borderBottomColor: '#cccccc',
backgroundColor: '#ffffff',
},
pageTitle: {
fontSize: 18,
fontWeight: 'bold',
textAlign: 'center',
},
});