Skip to content

Commit f7037cc

Browse files
authored
Merge pull request #64 from blaybus-hackathon/dev
Dev
2 parents 46e9200 + f1a8389 commit f7037cc

File tree

12 files changed

+634
-115
lines changed

12 files changed

+634
-115
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/public/favicon.ico" />
5+
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>돌봄워크: 더 쉬운 돌봄 서비스</title>
88
</head>

public/blaybus_logo_icon.svg

Lines changed: 12 additions & 0 deletions
Loading

public/blaybus_logo_icon_text.svg

Lines changed: 13 additions & 0 deletions
Loading

public/favicon.ico

7.57 KB
Binary file not shown.

src/App.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
@import "tailwindcss";
1+
@import 'tailwindcss';
22

33
@plugin 'tailwindcss-animate';
44

55
@custom-variant dark (&:is(.dark *));
66

77
#root {
8-
max-width: 1280px;
98
margin: 0 auto;
109
text-align: center;
1110
}
@@ -134,7 +133,8 @@
134133

135134
@layer base {
136135
html {
137-
font-family: "Pretendard Variable", sans-serif;
136+
font-family: 'Pretendard Variable', sans-serif;
137+
scroll-behavior: smooth;
138138
}
139139

140140
* {

src/App.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ import MatchingInfo from './pages/center/MatchingInfo';
2525
import ElderAddress from './pages/center/ElderAddress';
2626
import ChatRoomsPage from './pages/center/ChatRoomsPage';
2727
import PrivateChatRoom from './pages/center/PrivateChatRoom';
28+
import KakaoCallback from './components/Auth/KakaoCallback';
2829

2930
function App() {
3031
return (
3132
<Router>
3233
<Routes>
3334
{/* 공통 */}
35+
<Route index element={<Home />} />
3436
<Route path='/signIn' element={<SignIn />} />
37+
<Route path='/signUp' element={<SignUp />} />
38+
<Route path='/oauth/kakao/callback' element={<KakaoCallback />} />
3539

40+
{/* 레이아웃 */}
3641
<Route path='/' element={<Layout />}>
37-
<Route index element={<Home />} />
42+
{/* <Route index element={<Home />} /> */}
3843

3944
{/* Center */}
4045
<Route path='center/register' element={<ElderRegister />} />
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { useSearchParams, useNavigate } from 'react-router-dom';
2+
import { useEffect } from 'react';
3+
import { request } from '../../api';
4+
5+
const KakaoCallback = () => {
6+
const [params] = useSearchParams();
7+
const code = params.get('code');
8+
const navigate = useNavigate();
9+
10+
useEffect(() => {
11+
if (!code) {
12+
console.warn('카카오 로그인 실패: 코드가 없습니다.');
13+
return;
14+
}
15+
16+
const fetchToken = async () => {
17+
try {
18+
const response = await request('POST', '/oauth/kakao-signup', { code });
19+
console.log(response);
20+
console.log('카카오 로그인 응답: ', response.data);
21+
} catch (error) {
22+
console.error('Kakao 토큰 발급 실패:', error);
23+
navigate('/');
24+
}
25+
};
26+
27+
fetchToken();
28+
}, [code]);
29+
30+
return <p>로그인 중...</p>;
31+
};
32+
33+
export default KakaoCallback;

0 commit comments

Comments
 (0)