Skip to content

Commit 84a6c49

Browse files
committed
2 parents 196d29d + 17f4b81 commit 84a6c49

File tree

8 files changed

+96
-129
lines changed

8 files changed

+96
-129
lines changed

public/kakao_login_medium_wide.png

-271 Bytes
Loading

src/App.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
--destructive: hsl(0 84.2% 60.2%);
3636
--destructive-foreground: hsl(0 0% 98%);
3737
--border: hsl(0 0% 89.8%);
38-
--input: hsl(0 0% 89.8%);
38+
--input: #c8c8c8;
3939
--ring: hsl(0 0% 3.9%);
4040
--chart-1: hsl(12 76% 61%);
4141
--chart-2: hsl(173 58% 39%);
@@ -78,7 +78,7 @@
7878
--destructive: hsl(0 62.8% 30.6%);
7979
--destructive-foreground: hsl(0 0% 98%);
8080
--border: hsl(0 0% 14.9%);
81-
--input: hsl(0 0% 14.9%);
81+
--input: #c8c8c8;
8282
--ring: hsl(0 0% 83.1%);
8383
--chart-1: hsl(220 70% 50%);
8484
--chart-2: hsl(160 60% 45%);

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ function App() {
3434
<Routes>
3535
{/* 공통 */}
3636
<Route index element={<Home />} />
37-
<Route path='/signIn' element={<SignIn />} />
3837
<Route path='/signUp' element={<SignUp />} />
3938
<Route path='/oauth/kakao/callback' element={<KakaoCallback />} />
4039

4140
{/* 레이아웃 */}
4241
<Route path='/' element={<Layout />}>
42+
<Route path='/signin' element={<SignIn />} />
4343
{/* <Route index element={<Home />} /> */}
4444

4545
{/* Center */}

src/components/Auth/Authform.jsx

Lines changed: 56 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
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

69
const 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

108106
AuthForm.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-
150112
export default AuthForm;

src/components/ui/custom/Navbar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ export default function Navbar() {
4949
className='text-lg px-6 py-3'
5050
onClick={() => {
5151
clearProfile();
52-
navigate('/signIn');
52+
navigate('/');
5353
}}
5454
>
5555
로그아웃
5656
</Button>
5757
) : (
58-
<Button className='text-lg px-10 py-3' onClick={() => navigate('/signIn')}>
58+
<Button className='text-lg px-10 py-3' onClick={() => navigate('/signin')}>
5959
로그인
6060
</Button>
6161
)}

src/pages/Home.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export default function Home() {
273273
</div>
274274

275275
<div className='text-center mt-12'>
276-
<Button className='text-xl px-12 py-6' onClick={() => navigate('/signIn')}>
276+
<Button className='text-xl px-12 py-6' onClick={() => navigate('/signin')}>
277277
지금 시작하기
278278
<ChevronRight className='ml-2 w-6 h-6' />
279279
</Button>

src/pages/SignIn.jsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import { useState } from "react";
2-
import { useNavigate } from "react-router-dom";
3-
import AuthForm from "@/components/Auth/Authform";
4-
import axios from "axios";
5-
import useProfileStore from "@/store/useProfileStore";
1+
import { useState } from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import AuthForm from '@/components/Auth/Authform';
4+
import axios from 'axios';
5+
import useProfileStore from '@/store/useProfileStore';
66

77
export default function SignIn() {
88
const navigate = useNavigate();
9-
const [loginType, setLoginType] = useState("helper");
9+
const [loginType, setLoginType] = useState('helper');
1010
const { updateAuth } = useProfileStore();
1111

1212
const handleSubmit = async ({ email, password }) => {
1313
try {
1414
console.log(email, password);
1515

1616
const response = await axios.post(
17-
"http://localhost:8080/api/sign/in",
17+
'http://localhost:8080/api/sign/in',
1818
{
1919
userId: email,
2020
userPw: password,
2121
},
2222
{
2323
withCredentials: true,
24-
}
24+
},
2525
);
2626

2727
if (response.status === 200) {
28-
console.log("로그인 성공 ", response);
28+
console.log('로그인 성공 ', response);
2929
//parse
3030
const { chatSenderId, email, userAuth } = response.data;
3131
//Zustand에 저장
@@ -35,29 +35,21 @@ export default function SignIn() {
3535
userAuth,
3636
});
3737
//zustand 프로필 내용도 저장 (세션에)
38-
navigate("/");
38+
navigate('/');
3939
}
4040
} catch (error) {
41-
console.error("로그인 실패:", error);
42-
alert("이메일 또는 비밀번호가 올바르지 않습니다.");
41+
console.error('로그인 실패:', error);
42+
alert('이메일 또는 비밀번호가 올바르지 않습니다.');
4343
}
4444
};
4545

4646
return (
47-
<>
48-
<div className="min-h-screen flex flex-col">
49-
<main className="flex-grow ">
50-
<div className="container mx-auto px-4 ">
51-
<div className="h-[800px] flex items-center justify-center">
52-
<AuthForm
53-
type={loginType}
54-
onSubmit={handleSubmit}
55-
setLoginType={setLoginType}
56-
/>
57-
</div>
58-
</div>
59-
</main>
47+
<main className='flex h-screen items-center'>
48+
<div className='container mx-auto'>
49+
<div className='flex'>
50+
<AuthForm type={loginType} onSubmit={handleSubmit} setLoginType={setLoginType} />
51+
</div>
6052
</div>
61-
</>
53+
</main>
6254
);
6355
}

src/pages/center/MyPage.jsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import Header from '@/components/ui/temp/Header';
1+
import { useEffect } from 'react';
22
import Profile from '@/assets/images/elder-basic-profile.png';
33
import { useManagerProfile } from '@/hooks/center/service/useManagerProfile';
44
import { useManagerProfileStore } from '@/store/center/useManagerProfileStore';
5+
import { useHeaderPropsStore } from '@/store/useHeaderPropsStore';
56
import { useNavigate } from 'react-router-dom';
67
import ManagerInfoDisplay from '@/components/Center/MyPage/ManagerInfoDisplay';
78
import ManagerInfoEdit from '@/components/Center/MyPage/ManagerInfoEdit';
@@ -10,13 +11,26 @@ import { Button } from '@/components/ui/custom/Button';
1011
export default function MyPage() {
1112
const { data: managerProfile, isLoading, saveManagerProfile } = useManagerProfile();
1213
const { isEditMode, toggleEditMode, setFormData, formData } = useManagerProfileStore();
14+
const setHeaderProps = useHeaderPropsStore((state) => state.setHeaderProps);
15+
const clearHeaderProps = useHeaderPropsStore((state) => state.clearHeaderProps);
1316
const navigate = useNavigate();
1417

18+
useEffect(() => {
19+
setHeaderProps({
20+
type: 'logo',
21+
hasBorder: false,
22+
});
23+
24+
return () => {
25+
clearHeaderProps();
26+
};
27+
}, [clearHeaderProps, setHeaderProps]);
28+
1529
// TODO: 로딩 컴포넌트 필요
1630
if (isLoading) return <div>Loading...</div>;
1731
if (!managerProfile) {
1832
alert('관리자 정보를 불러오지 못했습니다.');
19-
navigate('/signin');
33+
navigate('/signIn');
2034
}
2135

2236
// save formData when edit mode is true
@@ -46,7 +60,6 @@ export default function MyPage() {
4660

4761
return (
4862
<div className='h-screen max-w-2xl mx-auto'>
49-
<Header variant='logo' hasBorder={false} />
5063
{/* 헤더 밑 공간 */}
5164
<div className='pt-[1.88rem] bg-[#f5f5f5]'>
5265
{/* 마이페이지 전체 컨테이너 */}

0 commit comments

Comments
 (0)