1- import { Button } from "@/components/ui/button" ;
2- import { Input } from "@/components/ui/input" ;
3- import { useNavigate } from "react-router-dom" ;
4- import PropTypes from "prop-types" ;
1+ import { useNavigate } from 'react-router-dom' ;
2+ import { Button } from '@/components/ui/custom/Button' ;
3+ import { Input } from '@/components/ui/custom/Input' ;
4+ import { User , LockKeyholeOpen } from 'lucide-react' ;
5+ import Kakao from '/kakao_login_medium_wide.png' ;
6+ import Logo from '/blaybus_logo_icon_text.svg' ;
7+ import PropTypes from 'prop-types' ;
58
69const AuthForm = ( { type, onSubmit, setLoginType } ) => {
710 const navigate = useNavigate ( ) ;
@@ -14,137 +17,96 @@ const AuthForm = ({ type, onSubmit, setLoginType }) => {
1417 } ) ;
1518 } ;
1619
20+ const REST_API_KEY = import . meta. env . VITE_KAKAO_REST_API_KEY ;
21+ const REDIRECT_URI = import . meta. env . VITE_KAKAO_REDIRECT_URI ;
22+ const KAKAO_AUTH_URL = `https://kauth.kakao.com/oauth/authorize?client_id=${ REST_API_KEY } &redirect_uri=${ REDIRECT_URI } &response_type=code` ;
23+
24+ const handleKakaoLogin = ( ) => {
25+ window . location . href = KAKAO_AUTH_URL ;
26+ } ;
27+
1728 return (
18- < div className = "w-full max-w-md bg-white rounded-lg p-8" >
19- < h2 className = "text-2xl font-bold text-center mb-6" > 돌봄 워크 Logo </ h2 >
29+ < div className = ' bg-white rounded-lg' >
30+ < img src = { Logo } alt = 'logo' className = 'w-1/2 mx-auto py-8' / >
2031
2132 { /* 로그인 타입 선택 */ }
22- < div className = " grid grid-cols-2 mb-6 gap-4" >
33+ < div className = ' grid grid-cols-2 mb-8 gap-4' >
2334 < Button
24- onClick = { ( ) => setLoginType ( " company" ) }
25- className = { `font-medium ${
26- type === " company"
27- ? " text-white bg-[#522E9A] hover:bg-[#522E9A]/90 "
28- : " bg-[#F6F6F6 ] text-[#6C6C6C] hover:bg-[#F6F6F6]/90 "
35+ onClick = { ( ) => setLoginType ( ' company' ) }
36+ className = { `w-full h-[3.44rem] font-medium text-lg rounded-[0.31rem] border-none ${
37+ type === ' company'
38+ ? ' bg-[var(--main)] text-white'
39+ : ' bg-[var(--button-inactive) ] text-[var(--placeholder-gray)]'
2940 } `}
3041 >
3142 관리자용
3243 </ Button >
3344 < Button
34- onClick = { ( ) => setLoginType ( " helper" ) }
35- className = { `font-medium ${
36- type === " helper"
37- ? " text-white bg-[#275280] hover:bg-[#275280]/90 "
38- : " bg-[#F6F6F6 ] text-[#6C6C6C] hover:bg-[#F6F6F6]/90 "
45+ onClick = { ( ) => setLoginType ( ' helper' ) }
46+ className = { `w-full h-[3.44rem] font-medium text-lg rounded-[0.31rem] border-none ${
47+ type === ' helper'
48+ ? ' bg-[var(--main)] text-white'
49+ : ' bg-[var(--button-inactive) ] text-[var(--placeholder-gray)]'
3950 } `}
4051 >
4152 요양보호사용
4253 </ Button >
4354 </ div >
4455
45- < form onSubmit = { handleSubmit } className = "space-y-4" >
46- < div className = "relative" >
47- < div className = "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" >
48- < NavigationIcon className = "h-4 w-4" />
49- </ div >
56+ < form onSubmit = { handleSubmit } className = 'space-y-4' >
57+ < div className = 'relative text-[var(--placeholder-gray)]' >
58+ < User className = 'absolute left-5 top-1/2 -translate-y-1/2 h-5 w-5 text-[var(--placeholder-gray)] z-1' />
5059 < Input
51- id = " email"
52- type = " email"
53- placeholder = " 아이디를 입력해주세요. "
54- className = " w-full rounded-lg bg-background pl-8"
60+ id = ' email'
61+ type = ' email'
62+ placeholder = ' 아이디를 입력해주세요.'
63+ className = ' w-full h-12 pl-12 placeholder:text-[var(--placeholder-gray)]'
5564 />
5665 </ div >
5766
58- < div className = "relative" >
59- < div className = "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" >
60- < HomeControlsIcon className = "h-4 w-4" />
61- </ div >
67+ < div className = 'relative text-[var(--placeholder-gray)]' >
68+ < LockKeyholeOpen className = 'absolute left-5 top-1/2 -translate-y-1/2 h-5 w-5 text-[var(--placeholder-gray)] z-1' />
6269 < Input
63- id = " password"
64- type = " password"
65- placeholder = " 비밀번호를 입력해주세요. "
66- className = " w-full rounded-lg bg-background pl-8"
70+ id = ' password'
71+ type = ' password'
72+ placeholder = ' 비밀번호를 입력해주세요. '
73+ className = ' w-full h-12 pl-12 placeholder:text-[var(--placeholder-gray)]'
6774 />
6875 </ div >
6976
70- < div >
71- { /* 아이디 - 비밀번호 찾기 추가 필요. */ }
72- < div className = "block text-[#6C6C6C] text-right cursor-pointer hover:underline" >
77+ < div className = 'flex justify-end mb-8' >
78+ { /* TODO: 아이디 - 비밀번호 찾기 추가 필요. */ }
79+ < button className = ' text-[1.06rem] font-medium text-[var(--placeholder-gray)] border-b border-[var(--outline)]' >
7380 아이디 비밀번호 찾기
74- </ div >
81+ </ button >
7582 </ div >
76- < Button
77- type = "submit"
78- className = { `w-full ${
79- type === "helper"
80- ? "bg-[#275280] hover:bg-[#275280]/90"
81- : "bg-[#522E9A] hover:bg-[#522E9A]/90"
82- } text-white`}
83- >
83+
84+ < Button className = 'w-full h-[3.4rem] rounded-[0.31rem] text-lg font-medium' type = 'submit' >
8485 로그인
8586 </ Button >
8687 </ form >
8788
8889 < Button
89- onClick = { ( ) => navigate ( "/helpler/signUp" ) }
90- className = { `mt-2 w-full bg-white hover:bg-white/90 rounded-xs border-1 border-[#522E9A]
91- } text-[#522E9A]` }
90+ variant = 'white'
91+ onClick = { ( ) => navigate ( '/helpler/signUp' ) }
92+ className = 'mt-2 w-full h-[3.4rem] rounded-[0.31rem] text-lg font-medium'
9293 >
9394 돌봄워크 회원가입
9495 </ Button >
95-
9696 { /* 아이콘 추가 Label로 수정 필요. */ }
97- < Button
98- type = "submit"
99- className = { `mt-2 w-full bg-[#FEE500] hover:bg-[#FEE500]/90 rounded-xs
100- } text-black` }
101- >
102- 카카오 로그인
103- </ Button >
97+
98+ { /* TODO: 카카오 로그인 psd 파일 편집 불가인 관계로 */ }
99+ < button className = { `w-full h-[3.4rem] mt-2` } onClick = { handleKakaoLogin } type = 'button' >
100+ < img src = { Kakao } alt = 'kakao' className = 'w-full h-full object-fit' />
101+ </ button >
104102 </ div >
105103 ) ;
106104} ;
107105
108106AuthForm . propTypes = {
109- type : PropTypes . oneOf ( [ " helper" , " company" ] ) . isRequired ,
107+ type : PropTypes . oneOf ( [ ' helper' , ' company' ] ) . isRequired ,
110108 onSubmit : PropTypes . func . isRequired ,
111109 setLoginType : PropTypes . func . isRequired ,
112110} ;
113111
114- function NavigationIcon ( prop ) {
115- return (
116- < svg
117- { ...prop }
118- width = "24"
119- height = "24"
120- viewBox = "0 0 24 24"
121- fill = "none"
122- xmlns = "http://www.w3.org/2000/svg"
123- >
124- < path
125- d = "M12 12C10.9 12 9.95833 11.6083 9.175 10.825C8.39167 10.0417 8 9.1 8 8C8 6.9 8.39167 5.95833 9.175 5.175C9.95833 4.39167 10.9 4 12 4C13.1 4 14.0417 4.39167 14.825 5.175C15.6083 5.95833 16 6.9 16 8C16 9.1 15.6083 10.0417 14.825 10.825C14.0417 11.6083 13.1 12 12 12ZM4 20V17.2C4 16.6333 4.14167 16.1167 4.425 15.65C4.725 15.1667 5.11667 14.8 5.6 14.55C6.63333 14.0333 7.68333 13.65 8.75 13.4C9.81667 13.1333 10.9 13 12 13C13.1 13 14.1833 13.1333 15.25 13.4C16.3167 13.65 17.3667 14.0333 18.4 14.55C18.8833 14.8 19.2667 15.1667 19.55 15.65C19.85 16.1167 20 16.6333 20 17.2V20H4ZM6 18H18V17.2C18 17.0167 17.95 16.85 17.85 16.7C17.7667 16.55 17.65 16.4333 17.5 16.35C16.6 15.9 15.6917 15.5667 14.775 15.35C13.8583 15.1167 12.9333 15 12 15C11.0667 15 10.1417 15.1167 9.225 15.35C8.30833 15.5667 7.4 15.9 6.5 16.35C6.35 16.4333 6.225 16.55 6.125 16.7C6.04167 16.85 6 17.0167 6 17.2V18ZM12 10C12.55 10 13.0167 9.80833 13.4 9.425C13.8 9.025 14 8.55 14 8C14 7.45 13.8 6.98333 13.4 6.6C13.0167 6.2 12.55 6 12 6C11.45 6 10.975 6.2 10.575 6.6C10.1917 6.98333 10 7.45 10 8C10 8.55 10.1917 9.025 10.575 9.425C10.975 9.80833 11.45 10 12 10Z"
126- fill = "#4D4447"
127- />
128- </ svg >
129- ) ;
130- }
131-
132- function HomeControlsIcon ( prop ) {
133- return (
134- < svg
135- { ...prop }
136- width = "24"
137- height = "24"
138- viewBox = "0 0 24 24"
139- fill = "none"
140- xmlns = "http://www.w3.org/2000/svg"
141- >
142- < path
143- d = "M6 8H15V6C15 5.16667 14.7083 4.45833 14.125 3.875C13.5417 3.29167 12.8333 3 12 3C11.1667 3 10.4583 3.29167 9.875 3.875C9.29167 4.45833 9 5.16667 9 6H7C7 4.61667 7.48333 3.44167 8.45 2.475C9.43333 1.49167 10.6167 1 12 1C13.3833 1 14.5583 1.49167 15.525 2.475C16.5083 3.44167 17 4.61667 17 6V8H18C18.55 8 19.0167 8.2 19.4 8.6C19.8 8.98333 20 9.45 20 10V20C20 20.55 19.8 21.025 19.4 21.425C19.0167 21.8083 18.55 22 18 22H6C5.45 22 4.975 21.8083 4.575 21.425C4.19167 21.025 4 20.55 4 20V10C4 9.45 4.19167 8.98333 4.575 8.6C4.975 8.2 5.45 8 6 8ZM6 20H18V10H6V20ZM12 17C12.55 17 13.0167 16.8083 13.4 16.425C13.8 16.025 14 15.55 14 15C14 14.45 13.8 13.9833 13.4 13.6C13.0167 13.2 12.55 13 12 13C11.45 13 10.975 13.2 10.575 13.6C10.1917 13.9833 10 14.45 10 15C10 15.55 10.1917 16.025 10.575 16.425C10.975 16.8083 11.45 17 12 17ZM6 20V10V20Z"
144- fill = "#3F4946"
145- />
146- </ svg >
147- ) ;
148- }
149-
150112export default AuthForm ;
0 commit comments