Skip to content

Commit 0d5ce43

Browse files
authored
Merge pull request #201 from imaginer-dev/19-옵션-기능-구현
19 옵션 기능 구현
2 parents 28c8d85 + e695bcf commit 0d5ce43

File tree

10 files changed

+173
-11
lines changed

10 files changed

+173
-11
lines changed

pnpm-lock.yaml

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Join/TermsCheckInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useJoinState } from '@/stores/joinStore';
22
import { useEffect, useRef, useState } from 'react';
33
import Dialog from '../common/Dialog';
4-
import { PersonalInfoPage, UseConditionPage } from '@/pages/Policy';
4+
import PersonalInfoPage from '@/pages/Policy/PersonalInfoPage';
5+
import UseConditionPage from '@/pages/Policy/UseConditionPage';
56

67
const TermsCheckInput = () => {
78
interface DialogElement {

src/components/common/SideBar/SideBarProfile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SideBarProfile: FC<Props> = ({ userName, imageUrl }) => {
2323
<Link to="/" className="cursor-pointer rounded-lg bg-base-100 px-3 py-1 font-black hover:opacity-50">
2424
내 캘린더 보기
2525
</Link>
26-
<Link to="/profile" className="cursor-pointer hover:opacity-50">
26+
<Link to="/setting" className="cursor-pointer hover:opacity-50">
2727
<SettingIcon />
2828
</Link>
2929
</div>

src/layouts/PolicyShowLayout.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { FC, ReactNode } from 'react';
2+
import HistoryBackButton from '@/components/common/HistoryBackButton';
3+
4+
interface Props {
5+
children: ReactNode;
6+
title: string;
7+
}
8+
9+
const PolicyShowLayout: FC<Props> = ({ children, title }) => {
10+
return (
11+
<main className={'relative m-auto h-screen w-fit p-8'}>
12+
<HistoryBackButton />
13+
<h2 className="my-5 text-xl font-semibold">{title}</h2>
14+
{/* <div className="card h-5/6 max-w-5xl bg-white">{children}</div> */}
15+
<div className="card h-3/4 max-w-5xl bg-white">{children}</div>
16+
</main>
17+
);
18+
};
19+
20+
export default PolicyShowLayout;

src/layouts/UseTermsShowLayout.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { FC, ReactNode } from 'react';
2+
import HistoryBackButton from '@/components/common/HistoryBackButton';
3+
4+
interface Props {
5+
children: ReactNode;
6+
title: string;
7+
}
8+
9+
const UseTermsShowLayout: FC<Props> = ({ children, title }) => {
10+
return (
11+
<main className={'relative m-auto h-screen w-fit p-8'}>
12+
<HistoryBackButton />
13+
<h2 className="my-5 text-xl font-semibold">{title}</h2>
14+
{/* <div className="card h-5/6 max-w-5xl bg-white">{children}</div> */}
15+
<div className="card h-3/4 max-w-5xl bg-white">{children}</div>
16+
</main>
17+
);
18+
};
19+
20+
export default UseTermsShowLayout;

src/main.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import EditGroupSchedule from './pages/EditGroupPage.tsx';
99
import AddGroupSchedulePage from './pages/AddGroupPage.tsx';
1010
import GroupCalendarPage from './pages/GroupCalendarPage.tsx';
1111
import ProfilePage from './pages/ProfilePage.tsx';
12+
import SettingPage from './pages/SettingPage.tsx';
1213
import App from '@/App.tsx';
1314

1415
const router = createBrowserRouter([
@@ -58,17 +59,20 @@ const router = createBrowserRouter([
5859
path: '*',
5960
element: <NotFound />,
6061
},
61-
62+
{
63+
path: '/setting',
64+
element: <SettingPage />,
65+
},
6266
{
6367
path: '/policy',
6468
children: [
6569
{
6670
path: 'personalInfo',
67-
element: <Policy.PersonalInfoPage />,
71+
element: <Policy.PersonalInfoShowPage />,
6872
},
6973
{
7074
path: 'usecondition',
71-
element: <Policy.UseConditionPage />,
75+
element: <Policy.UseConditionShowPage />,
7276
},
7377
],
7478
},
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { FC } from 'react';
2+
import PolicyShowLayout from '@/layouts/PolicyShowLayout';
3+
import PolicyPersonalInfo from '../../components/Policy/PolicyPersonalInfo';
4+
5+
const PersonalInfoShowPage: FC = () => {
6+
return (
7+
<PolicyShowLayout title="개인정보 처리방침">
8+
<PolicyPersonalInfo />
9+
</PolicyShowLayout>
10+
);
11+
};
12+
13+
export default PersonalInfoShowPage;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { FC } from 'react';
2+
import PolicyUseCondition from '../../components/Policy/PolicyUseCondition';
3+
import UseTermsShowLayout from '@/layouts/UseTermsShowLayout';
4+
5+
const UseConditionShowPage: FC = () => {
6+
return (
7+
<UseTermsShowLayout title="전자상거래 표준약관">
8+
<PolicyUseCondition />
9+
</UseTermsShowLayout>
10+
);
11+
};
12+
13+
export default UseConditionShowPage;

src/pages/Policy/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PersonalInfoPage from './PersonalInfoPage';
2-
import UseConditionPage from './UseConditionPage';
1+
import PersonalInfoShowPage from './PersonalInfoShowPage';
2+
import UseConditionShowPage from './UseConditionShowPage';
33

4-
export { PersonalInfoPage, UseConditionPage };
4+
export { PersonalInfoShowPage, UseConditionShowPage };

src/pages/SettingPage.tsx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import AppBar from '@/components/common/AppBar';
2+
import HamburgerButton from '@/components/common/SideBar/HamburgerButton';
3+
import { useGetProfile } from '@/react-queries/userGetProfile';
4+
import { Link } from 'react-router-dom';
5+
6+
const SettingPage = () => {
7+
const { data: user, error, isLoading, isError } = useGetProfile();
8+
console.log(user);
9+
10+
if (isError) {
11+
// TODO: 추후 에러 처리
12+
console.error(error);
13+
}
14+
15+
return (
16+
<div className="lg:ml-80">
17+
<AppBar backButton={false} IconButton={<HamburgerButton />} />
18+
<main className="z-1 relative flex-grow">
19+
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
20+
<div>
21+
<div className="relative flex h-full w-full">
22+
{isLoading && <span className="loading" />}
23+
<div className=" absolute top-[70px] inline-flex h-40 flex-col items-start justify-start gap-2.5 border-b border-yellow-500 px-8 py-5">
24+
<div className=" w-44 font-['Inter'] text-base font-semibold leading-normal text-black">정보</div>
25+
<div className=" flex flex-col items-start justify-start gap-2.5">
26+
<div className=" inline-flex w-80 items-start justify-between">
27+
<div className="text-center font-['Inter'] text-base font-normal leading-normal text-black">
28+
버전 정보
29+
</div>
30+
<div className=" text-center font-['Inter'] text-base font-normal leading-normal text-black">
31+
0.0.1v
32+
</div>
33+
</div>
34+
<Link to={'/policy/usecondition'}>
35+
<div className=" inline-flex w-80 items-center justify-between">
36+
<div className=" text-center font-['Inter'] text-base font-normal leading-normal text-black hover:underline">
37+
이용약관 보기
38+
</div>
39+
<div className=" relative h-5 w-5" />
40+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="13" height="15">
41+
<path
42+
d="M 2 2 L 18 10 L 2 18"
43+
fill="none"
44+
stroke="green"
45+
stroke-width="3"
46+
stroke-linecap="round"
47+
stroke-linejoin="round"
48+
/>
49+
</svg>
50+
</div>
51+
</Link>
52+
<Link to={'/policy/personalInfo'}>
53+
<div className=" inline-flex w-80 items-center justify-between">
54+
<div className=" text-center font-['Inter'] text-base font-normal leading-normal text-black hover:underline">
55+
개인정보 처리방침 보기
56+
</div>
57+
<div className=" relative h-5 w-5" />
58+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" width="13" height="15">
59+
<path
60+
d="M 2 2 L 18 10 L 2 18"
61+
fill="none"
62+
stroke="green"
63+
stroke-width="3"
64+
stroke-linecap="round"
65+
stroke-linejoin="round"
66+
/>
67+
</svg>
68+
</div>
69+
</Link>
70+
</div>
71+
<div className=" absolute top-[200px] font-['Inter'] text-base font-normal leading-normal text-black">
72+
회원 탈퇴
73+
</div>
74+
</div>
75+
</div>
76+
</div>
77+
</div>
78+
</main>
79+
</div>
80+
);
81+
};
82+
83+
export default SettingPage;

0 commit comments

Comments
 (0)