From 55a5fe75cff7a9879ea956667146fb62d1392c85 Mon Sep 17 00:00:00 2001 From: songjihyun323 <88391843+songjihyun-dev@users.noreply.github.com> Date: Tue, 10 Jan 2023 16:46:44 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20css=20=EC=B6=94=EA=B0=80=20#1=20#?= =?UTF-8?q?4=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20css=20=EC=B6=94=EA=B0=80=ED=96=88=EC=8A=B5=EB=8B=88?= =?UTF-8?q?=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/screen/SignupPage.jsx | 202 +++++++++++++++++++++++++++++--------- 1 file changed, 153 insertions(+), 49 deletions(-) diff --git a/src/screen/SignupPage.jsx b/src/screen/SignupPage.jsx index 7579d2a..0fc18d2 100644 --- a/src/screen/SignupPage.jsx +++ b/src/screen/SignupPage.jsx @@ -1,12 +1,9 @@ +import styled from '@emotion/native'; import { useState } from 'react'; -import { - SafeAreaView, - StyleSheet, - Text, - TextInput, - TouchableOpacity, -} from 'react-native'; +import { Platform, SafeAreaView } from 'react-native'; import { useSignup } from '../Hooks/useAuth'; +import { FontAwesome } from '@expo/vector-icons'; +import { COLORS } from '../shared/color'; const regex = { email: new RegExp(/[a-z0-9]+@[a-z]+\.[a-z]{2,3}/), @@ -15,12 +12,12 @@ const regex = { ), // 6자 이상, 14자 이하의 영어 대,소문자, 1개 이상의 숫자, 특수문자 조합 }; -const SignupPage = () => { +const SignupPage = ({ navigation: { navigate } }) => { const [email, setEmail] = useState(''); // 이메일 값 저장 const [password, setPassword] = useState(''); // 비밀번호 값 저장 const [correctEmail, setCorrectEmail] = useState(true); // 이메일 유효성 검사 const [correctPassword, setCorrectPassword] = useState(true); // 비밀번호 유효성 검사 - const [visablePassword, setVisablePassword] = useState(false); // 비밀번호 보이게 + const [visablePassword, setVisablePassword] = useState(true); // 비밀번호 보이게 const vaildEmail = (event) => { // 유효성 검사 후 false가 나오면 문구 띄우기 @@ -62,49 +59,156 @@ const SignupPage = () => { return ( - 아이디 - vaildEmail(text)} - /> - {correctEmail || ( - - {email === '' - ? '필수 입력값입니다.' - : '올바른 형식의 이메일을 작성해주세요'} - - )} - 비밀번호 - vaildPassword(text)} - secureTextEntry={visablePassword} - /> - {correctPassword || ( - - {password === '' - ? '필수 입력값입니다.' - : '비밀번호는 6자리 이상, 14자리 이하의 영어 대, 소문자, 1개 이상의 숫자와 특수문자(!@#$%^&*) 조합이어야 합니다.'} - - )} - setVisablePassword(!visablePassword)}> - 👁 - - onClickSignUpButton(email, password)}> - 회원가입 - + + navigate('로그인')}> + + + + 아이디 + vaildEmail(text)} + style={Platform.select({ + ios: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + }, + android: { + backgroundColor: 'white', + elevation: 5, + }, + })} + /> + + {correctEmail || ( + + {email === '' + ? '필수 입력값입니다.' + : '올바른 형식의 이메일을 작성해주세요'} + + )} + + + + 비밀번호 + vaildPassword(text)} + secureTextEntry={visablePassword} + style={Platform.select({ + ios: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 3.84, + }, + android: { + backgroundColor: 'white', + elevation: 5, + }, + })} + /> + setVisablePassword(!visablePassword)} + > + + + + {correctPassword || ( + + {password === '' + ? '필수 입력값입니다.' + : '비밀번호는 6자리 이상, 14자리 이하의 영어 대, 소문자, 1개 이상의 숫자와 특수문자(!@#$%^&*) 조합이어야 합니다.'} + + )} + onClickSignUpButton(email, password)}> + 회원가입 + + ); }; -const styles = StyleSheet.create({}); +const FormContainer = styled.View` + padding: 10px; + height: 100%; + background-color: white; +`; + +const BackToLoginPageButton = styled.TouchableOpacity` + margin-bottom: 50px; +`; + +const InputContainer = styled.View` + position: relative; +`; + +const LabelText = styled.Text` + font-size: 28px; + font-weight: 400; + margin: 16px 0 10px 0; +`; + +const ErrorText = styled.Text` + color: ${COLORS.DANGER}; + padding: 10px 0; +`; + +const PasswordShowButton = styled.Text` + position: absolute; + top: 65%; + right: 5%; +`; + +// 이후 교체 예정 +const CustomButtonText = styled.Text` + font-weight: 400; + font-size: 28px; + line-height: 40px; + text-align: center; + width: 100%; +`; + +const CustomInput = styled.TextInput` + padding: 12px 16px; + border-radius: 16px; + background-color: white; +`; + +const CustomButton = styled.TouchableOpacity` + box-sizing: border-box; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 12px 16px; + gap: 147px; + margin-top: 47px; + width: 100%; + height: 80px; + background: #0feec6; + border-radius: 16px; +`; +// export default SignupPage;