Skip to content

Commit 1238355

Browse files
committed
Merge branch 'dev' into Feat/FeedPage
2 parents ae9a652 + 88ca5a6 commit 1238355

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1159
-305
lines changed

app/(main)/community/error.tsx

-19
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,12 @@ export default function Error({
1010
error: Error & { digest?: string };
1111
reset: () => void;
1212
}) {
13-
const login = async () => {
14-
const response = await fetch(`/api/auth`, {
15-
method: 'POST',
16-
body: JSON.stringify({
17-
18-
password: '1234',
19-
}),
20-
mode: 'cors',
21-
cache: 'no-cache',
22-
credentials: 'include',
23-
headers: {
24-
'Content-Type': 'application/json',
25-
},
26-
});
27-
console.log(response);
28-
};
2913
useEffect(() => {
3014
console.error(error);
3115
}, [error]);
3216

3317
return (
3418
<div className="flex flex-col items-center justify-center w-full h-screen gap-10">
35-
<button type="button" onClick={login}>
36-
awd
37-
</button>
3819
<h2 className="header1">예기치 못한 오류가 발생하였습니다.🙉</h2>
3920
<div className="flex gap-2 w-80">
4021
<Button fullWidth>메인으로</Button>

app/(main)/community/page.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const metadata: Metadata = {
1212
export default function CommunityPage() {
1313
return (
1414
<main className="flex flex-col flex-1 w-full h-full gap-10 p-8 overflow-x-hidden tablet:mt-0">
15-
<h1 className="header2">참여중인 채팅방</h1>
1615
<EnteredChatList />
1716
<RecommendChatList />
1817
<TrendingChatList />

app/(main)/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function Home() {
66
return (
77
<main className="flex items-start flex-1 w-full h-full gap-10 p-8 mt-0 overflow-y-scroll">
88
<Feed />
9-
<aside className="sticky top-0 flex-col justify-between hidden w-3/6 h-screen py-4 tablet:flex">
9+
<aside className="sticky top-0 flex-col justify-between hidden w-3/6 h-full tablet:flex">
1010
<SimpleChatCardList />
1111
<RecommendPlace />
1212
</aside>

app/auth/email-login/page.tsx

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import EmailLogin from '@/components/pages/auth/EmailLogin';
22
import { Metadata } from 'next';
3+
import Link from 'next/link';
34
import React from 'react';
45

56
export const metadata: Metadata = {
@@ -8,5 +9,25 @@ export const metadata: Metadata = {
89
};
910

1011
export default function EmailLoginPage() {
11-
return <EmailLogin title="이메일로 로그인" />;
12+
return (
13+
<div className="w-full flex flex-col">
14+
<EmailLogin title="이메일로 로그인" />
15+
<div className="flex justify-between items-center mt-6">
16+
<Link href="/auth/policy">
17+
<span className="text-xs 2xs:body1 text-grey-400">회원가입</span>
18+
</Link>
19+
<div className="flex gap-3 items-center">
20+
<Link href="/auth/find-change?mode=findId">
21+
<span className="text-xs 2xs:body1 text-grey-400">아이디 찾기</span>
22+
</Link>
23+
<div className="w-[1px] h-[18px] sm:h-6 bg-grey-200" />
24+
<Link href="/auth/find-change?mode=changePwd">
25+
<span className="text-xs 2xs:body1 text-grey-400">
26+
비밀번호 변경
27+
</span>
28+
</Link>
29+
</div>
30+
</div>
31+
</div>
32+
);
1233
}

app/auth/find-change/page.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import FindChange from '@/components/pages/auth/FindChange';
2+
import { Metadata } from 'next';
3+
import React from 'react';
4+
5+
export const metadata: Metadata = {
6+
title: '아이디 찾기/비밀번호 변경',
7+
robots: 'noindex',
8+
};
9+
10+
export default function FindChangePage() {
11+
return (
12+
<div className="w-full flex flex-col">
13+
<h1 className="header1 text-center w-full gap-[40px] pb-8">
14+
아이디 찾기/비밀번호 변경
15+
</h1>
16+
<FindChange />
17+
</div>
18+
);
19+
}

app/auth/login/page.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ export default function LoginPage() {
3737
isFullWidth
3838
>
3939
<div className="flex justify-between gap-[24px]">
40-
<Link href="/" className="text-grey-400 text-xs 2xs:body1">
40+
<Link
41+
href="/auth/find-change?mode=findId"
42+
className="text-grey-400 text-xs 2xs:body1"
43+
>
4144
아이디(이메일)찾기
4245
</Link>
4346
<div className="w-[1px] h-[24px] bg-grey-200" />
44-
<Link href="/" className="text-grey-400 text-xs 2xs:body1">
45-
비밀번호 찾기
47+
<Link
48+
href="/auth/find-change?mode=changePwd"
49+
className="text-grey-400 text-xs 2xs:body1"
50+
>
51+
비밀번호 변경
4652
</Link>
4753
</div>
4854
</BottomButton>

app/auth/pwchange/page.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import PwdChangeForm from '@/components/pages/auth/PwdChange';
2+
import React from 'react';
3+
4+
export default function PwdChangePage() {
5+
return (
6+
<div className="w-full flex flex-col">
7+
<h1 className="header1 text-center w-full gap-[40px] pb-8">
8+
비밀번호 변경
9+
</h1>
10+
<PwdChangeForm />
11+
</div>
12+
);
13+
}

app/layout.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default function RootLayout({
1616
}) {
1717
return (
1818
<html lang="ko" className={myFont.className}>
19+
<head>
20+
<link rel="icon" href="/image.png" />
21+
</head>
1922
<ReactQueryProvider>
2023
<body>
2124
<ToastContainer />

app/not-found.tsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Button from '@/components/ui/Button';
2+
3+
export default function NotFound() {
4+
return (
5+
<div className="flex flex-col items-center justify-center h-full max-w-xs gap-3 m-auto">
6+
<h2 className="mb-5 header1">앗! 잠시만요.</h2>
7+
<p className="mb-5 text-center whitespace-pre-wrap body2">
8+
원하시는 페이지를 찾을 수 없어요. <br />
9+
찾으시려는 페이지의 주소가 잘못 입력되었거나,
10+
<br />
11+
페이지 주소가 변경 또는 삭제되어 더는 사용하실 수 없습니다. 입력하신
12+
페이지의 주소가 정확한지 다시 한번 확인해주세요.
13+
</p>
14+
<Button fullWidth to="/">
15+
홈으로 이동
16+
</Button>
17+
</div>
18+
);
19+
}

components/pages/auth/BottomButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface Props {
55
variant?: 'primary' | 'secondary' | 'ghost' | 'light';
66
isFullWidth?: boolean;
77
to?: string;
8-
text: string;
8+
text: React.ReactNode;
99
children?: React.ReactNode;
1010
isDisabled?: boolean;
1111
type?: 'button' | 'submit' | 'reset';

components/pages/auth/Complete/index.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import React from 'react';
44
import Congratulation from '@/public/Auth/congratulation.svg';
55
import { useGeneralRegisterStore } from '@/hooks/stores/useGeneralRegisterStore';
6-
import { useRouter } from 'next/navigation';
76
import BottomButton from '@/components/pages/auth/BottomButton';
87

98
export default function Complete() {
109
const nickName = useGeneralRegisterStore((state) => state.nickname);
11-
const router = useRouter();
1210
return (
1311
<>
1412
<div className="flex flex-col justify-center items-center gap-[24px] mb-[184px]">
@@ -26,7 +24,7 @@ export default function Complete() {
2624
variant="primary"
2725
isFullWidth
2826
handleClick={() => {
29-
router.push('/');
27+
window.location.href = '/';
3028
}}
3129
/>
3230
</>

components/pages/auth/ConfirmIdentity/ConfirmForm.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Button from '@/components/ui/Button';
22
import { useIdentityStore } from '@/hooks/stores/useIdentityStore';
33
import { checkVerification, requestVerification } from '@/service/auth';
4+
import Toast from '@/utils/notification';
45
import React, { useEffect, useRef, useState } from 'react';
56
import { shallow } from 'zustand/shallow';
67

@@ -41,7 +42,9 @@ export default function ConfirmForm({ setIsActive }: Props) {
4142
setIsLoading(true);
4243
setTimer(180);
4344
} catch (e) {
44-
console.error('인증 요청 실패', e);
45+
if (e instanceof Error) {
46+
Toast.error(e.message);
47+
}
4548
}
4649
};
4750

@@ -58,7 +61,9 @@ export default function ConfirmForm({ setIsActive }: Props) {
5861
setIsDuplicatedRequest(false);
5962
inputRef.current?.focus();
6063
} catch (e) {
61-
console.error('재인증 요청 실패', e);
64+
if (e instanceof Error) {
65+
Toast.error(e.message);
66+
}
6267
}
6368
return;
6469
}
@@ -72,11 +77,13 @@ export default function ConfirmForm({ setIsActive }: Props) {
7277
setPhoneNum(phoneNumber);
7378
setTimer(0); // 타이머 값 리셋
7479
} else {
75-
alert('인증번호가 일치하지 않습니다.');
80+
Toast.error('인증번호가 일치하지 않습니다.');
7681
setIsDuplicatedRequest(true);
7782
}
7883
} catch (e) {
79-
console.error('인증 요청 실패', e);
84+
if (e instanceof Error) {
85+
Toast.error(e.message);
86+
}
8087
}
8188
};
8289

components/pages/auth/EmailLogin/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use client';
22

33
import React, { useState } from 'react';
4-
import { useRouter } from 'next/navigation';
54
import { loginWithEmailAndPassword } from '@/service/auth';
5+
import Toast from '@/utils/notification';
66
import BottomButton from '../BottomButton';
77

88
interface Props {
@@ -13,17 +13,17 @@ export default function EmailLogin({ title }: Props) {
1313
const [email, setEmail] = useState('');
1414
const [password, setPassword] = useState('');
1515
const [error, setError] = useState('');
16-
const router = useRouter();
1716

1817
const handleLogin = async (event: React.FormEvent<HTMLFormElement>) => {
1918
event.preventDefault();
2019
try {
2120
await loginWithEmailAndPassword({ email, password });
22-
console.log('Success logging in');
23-
router.push('/');
21+
window.location.href = '/';
2422
} catch (e) {
2523
setError('"아이디 또는 비밀번호가 일치하지 않습니다. 다시 입력해주세요"');
26-
console.error('Error logging in:', e);
24+
if (e instanceof Error) {
25+
Toast.error(e.message);
26+
}
2727
}
2828
};
2929

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// TabButton.js
2+
import { cn } from '@/utils/common';
3+
import React from 'react';
4+
import { TabType } from '.';
5+
6+
interface Props {
7+
activeTab: string;
8+
tabName: TabType;
9+
handleClick: () => void;
10+
text: string;
11+
}
12+
13+
function TabButton({ activeTab, tabName, handleClick, text }: Props) {
14+
return (
15+
<button
16+
type="button"
17+
className="w-1/2 flex flex-col justify-center items-center gap-2"
18+
onClick={handleClick}
19+
>
20+
<p
21+
className={`${
22+
activeTab === tabName ? 'header4' : 'body1'
23+
} text-grey-600`}
24+
>
25+
{text}
26+
</p>
27+
<div
28+
className={cn(
29+
'w-full h-1 bg-grey-200',
30+
activeTab === tabName ? 'bg-grey-600' : null,
31+
)}
32+
/>
33+
</button>
34+
);
35+
}
36+
37+
export default TabButton;

0 commit comments

Comments
 (0)