1- import React , { type FormEvent , useCallback , useState } from "react" ;
1+ import React , { useCallback , useState } from "react" ;
22import { Navigate } from "react-router-dom" ;
33import styled from "@emotion/styled" ;
44import { motion } from "framer-motion" ;
@@ -8,10 +8,10 @@ import LandingImg from "@biseo/web/assets/landing.png";
88import GoogleLogo from "@biseo/web/assets/google.png" ;
99import { useAuth } from "@biseo/web/services/auth" ;
1010
11- import { useInput } from "@biseo/web/common/hooks" ;
11+ // import { useInput } from "@biseo/web/common/hooks";
1212import { theme } from "@biseo/web/theme" ;
1313import { Box , Text } from "@biseo/web/components/atoms" ;
14- import { text } from "@biseo/web/styles" ;
14+ // import { text } from "@biseo/web/styles";
1515import { useGoogleLogin } from "@react-oauth/google" ;
1616
1717const Page = styled . div `
@@ -36,32 +36,32 @@ const LoginTitle = styled(motion.div)`
3636 color: ${ theme . colors . black } ;
3737` ;
3838
39- const InputContainer = styled . input `
40- width: 320px;
41- height: 45px;
39+ // const InputContainer = styled.input`
40+ // width: 320px;
41+ // height: 45px;
4242
43- box-sizing: border-box;
44- padding: 9px 14px;
43+ // box-sizing: border-box;
44+ // padding: 9px 14px;
4545
46- border: 1px solid ${ theme . colors . gray300 } ;
47- border-radius: 5px;
48- outline: none;
46+ // border: 1px solid ${theme.colors.gray300};
47+ // border-radius: 5px;
48+ // outline: none;
4949
50- ${ text . subtitle }
50+ // ${text.subtitle}
5151
52- &:hover {
53- border: 1px solid ${ theme . colors . gray400 } ;
54- }
52+ // &:hover {
53+ // border: 1px solid ${theme.colors.gray400};
54+ // }
5555
56- &:focus {
57- border: 1px solid ${ theme . colors . blue300 } ;
58- box-shadow: 0px 0px 0px 3px ${ theme . colors . blue200 } ;
59- }
60- &::placeholder {
61- font-size: 13px;
62- color: ${ theme . colors . gray300 } ;
63- }
64- ` ;
56+ // &:focus {
57+ // border: 1px solid ${theme.colors.blue300};
58+ // box-shadow: 0px 0px 0px 3px ${theme.colors.blue200};
59+ // }
60+ // &::placeholder {
61+ // font-size: 13px;
62+ // color: ${theme.colors.gray300};
63+ // }
64+ // `;
6565
6666const LoginButton = styled . button `
6767 width: 320px;
@@ -103,15 +103,15 @@ const LoginBackground = styled.img`
103103` ;
104104
105105export const LoginPage : React . FC = ( ) => {
106- const { login , glogin, isLoggedIn } = useAuth ( state => ( {
107- login : state . login ,
106+ const { glogin, isLoggedIn } = useAuth ( state => ( {
107+ // login: state.login,
108108 glogin : state . glogin ,
109109 isLoggedIn : ! ! state . userInfo ,
110110 } ) ) ;
111111 const [ error , setError ] = useState < boolean > ( false ) ;
112112
113- const { input : username } = useInput ( ) ;
114- const { input : password } = useInput ( ) ;
113+ // const { input: username } = useInput();
114+ // const { input: password } = useInput();
115115
116116 const easeMotion = {
117117 initial : { opacity : 0 , scale : 0.5 } ,
@@ -123,16 +123,16 @@ export const LoginPage: React.FC = () => {
123123 } ,
124124 } ;
125125
126- const handleLogin = useCallback (
127- ( e : FormEvent < HTMLFormElement > ) => {
128- e . preventDefault ( ) ;
126+ // const handleLogin = useCallback(
127+ // (e: FormEvent<HTMLFormElement>) => {
128+ // e.preventDefault();
129129
130- login ( username . value , password . value )
131- . then ( ( ) => console . log ( "Login success!" ) )
132- . catch ( ( ) => setError ( true ) ) ;
133- } ,
134- [ username . value , password . value ] ,
135- ) ;
130+ // login(username.value, password.value)
131+ // .then(() => console.log("Login success!"))
132+ // .catch(() => setError(true));
133+ // },
134+ // [username.value, password.value],
135+ // );
136136 const handleGLogin = useCallback ( ( code : string ) => {
137137 glogin ( code )
138138 . then ( ( ) => console . log ( "Login success!" ) )
@@ -163,7 +163,7 @@ export const LoginPage: React.FC = () => {
163163 쉽고 빠른 의사결정은, Biseo
164164 </ LoginTitle >
165165 </ Box >
166- < form onSubmit = { handleLogin } >
166+ { /* <form onSubmit={handleLogin}>
167167 <Box dir="column" gap={12} align="center">
168168 <InputContainer
169169 type="text"
@@ -191,13 +191,20 @@ export const LoginPage: React.FC = () => {
191191 </LoginButton>
192192 </Box>
193193 </Box>
194- </ form >
195- < LoginButton onClick = { googleLogin } >
196- < img alt = "google-logo" style = { { width : "20px" } } src = { GoogleLogo } />
197- < Text variant = "boldtitle2" color = "blue600" >
198- 구글 로그인
199- </ Text >
200- </ LoginButton >
194+ </form> */ }
195+ < Box dir = "column" gap = { 8 } align = "flex-start" >
196+ < LoginButton onClick = { googleLogin } >
197+ < img alt = "google-logo" style = { { width : "20px" } } src = { GoogleLogo } />
198+ < Text variant = "boldtitle2" color = "blue600" >
199+ 구글 로그인
200+ </ Text >
201+ </ LoginButton >
202+ { error && (
203+ < Text variant = "subtitle" color = "blue600" >
204+ 아이디 또는 비밀번호가 올바르지 않습니다.
205+ </ Text >
206+ ) }
207+ </ Box >
201208 < LoginBackground src = { LandingImg } />
202209 </ Page >
203210 ) ;
0 commit comments