diff --git a/src/components/notification/NoticeCommunityLayout.tsx b/src/components/notification/NoticeCommunityLayout.tsx
new file mode 100644
index 0000000..5c83673
--- /dev/null
+++ b/src/components/notification/NoticeCommunityLayout.tsx
@@ -0,0 +1,26 @@
+import { NotificationType } from '@/api/types/notification';
+import CalculateTime from '@/utils/calculateTime';
+import Link from 'next/link';
+
+export const NotificationCommunityLayout = ({ notice }: { notice: NotificationType }) => {
+ return (
+
+
+
+
+
+
+ {notice?.content}
+
+
+
+ {CalculateTime(notice?.date)}
+
+
+
+ );
+};
diff --git a/src/components/notification/NotificationLayout.tsx b/src/components/notification/NotificationLayout.tsx
new file mode 100644
index 0000000..4794bdc
--- /dev/null
+++ b/src/components/notification/NotificationLayout.tsx
@@ -0,0 +1,28 @@
+import { NotificationType } from '@/api/types/notification';
+import CalculateTime from '@/utils/calculateTime';
+import Link from 'next/link';
+
+export const NotificationLayout = ({ notice }: { notice: NotificationType }) => {
+ return (
+
+
+
+
+
+
{notice?.title}
+
+ {notice?.content}
+
+
+
+ {CalculateTime(notice?.date)}
+
+
+
+ );
+};
diff --git a/src/hook/useUpdateMember.ts b/src/hook/useUpdateMember.ts
new file mode 100644
index 0000000..549204c
--- /dev/null
+++ b/src/hook/useUpdateMember.ts
@@ -0,0 +1,17 @@
+import { userinfo } from '@/api/auth/auth.get.api';
+import { useSetMember } from '@/store/user';
+import { useQuery } from '@tanstack/react-query';
+import { useEffect } from 'react';
+
+const useUpdateMember = () => {
+ const setmember = useSetMember();
+
+ const { data: memberData } = useQuery({ queryKey: ['userinfo'], queryFn: userinfo });
+
+ useEffect(() => {
+ setmember(memberData?.data);
+ }, [memberData, setmember]);
+ return true;
+};
+
+export default useUpdateMember;
diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts
index 86931d7..2cdf67b 100644
--- a/src/mocks/handlers.ts
+++ b/src/mocks/handlers.ts
@@ -1,3 +1,5 @@
import { authHandlers } from './authHandler';
+import { questionHandlers } from './questionHandler';
+import { notificationHandler } from './notificationHandler';
-export const handlers = [...authHandlers];
+export const handlers = [...authHandlers, ...questionHandlers, ...notificationHandler];
diff --git a/src/mocks/notificationHandler/index.ts b/src/mocks/notificationHandler/index.ts
new file mode 100644
index 0000000..631dab7
--- /dev/null
+++ b/src/mocks/notificationHandler/index.ts
@@ -0,0 +1,18 @@
+import { http, HttpResponse } from 'msw';
+
+import {
+ MOCK_COMMUNITY_NOTIFICATION_DATA,
+ MOCK_RESERVATION_NOTIFICATION_DATA
+} from './mocks';
+
+export const notificationHandler = [
+ /* ----- 예약 알림 전송 api ----- */
+ http.get(`/notification/reservation`, () => {
+ return HttpResponse.json(MOCK_RESERVATION_NOTIFICATION_DATA);
+ }),
+
+ /* ----- 커뮤니티 알림 내역 api ----- */
+ http.get(`/notification/community`, () => {
+ return HttpResponse.json(MOCK_COMMUNITY_NOTIFICATION_DATA);
+ })
+];
diff --git a/src/mocks/notificationHandler/mocks.ts b/src/mocks/notificationHandler/mocks.ts
new file mode 100644
index 0000000..f4154ec
--- /dev/null
+++ b/src/mocks/notificationHandler/mocks.ts
@@ -0,0 +1,59 @@
+/* ----- 1:1알림 MOCK DATA ----- */
+export const MOCK_RESERVATION_NOTIFICATION_DATA = {
+ status: 200,
+ code: 'BMC002',
+ message: '예약 알림 데이터 조회 성공',
+ value: {
+ data: [
+ {
+ id: 7251,
+ title: '예약 안내',
+ content: '12:00에 강남1호점 미니3에서 미팅이 있습니다.',
+ time: '2024-06-03-12:00:00',
+ type: 'warning'
+ },
+ {
+ id: 7252,
+ title: '이용 시작 30분 전',
+ content: '다음 사용자를 위해 이용 시간을 준수해주세요.',
+ time: '2024-06-03-12:00:00',
+ type: 'check'
+ },
+ {
+ id: 7253,
+ title: '예약 안내',
+ content: '12:00에 강남1호점 미니3에서 미팅이 있습니다.',
+ time: '2024-06-03-12:00:00',
+ type: 'warning'
+ }
+ ]
+ }
+};
+
+/* ----- 커뮤니티 알림 MOCK DATA ----- */
+export const MOCK_COMMUNITY_NOTIFICATION_DATA = {
+ status: 200,
+ code: 'BMC002',
+ message: '커뮤니티 알림 데이터 조회 성공',
+ value: {
+ data: [
+ {
+ id: 7251,
+ nickname: '닉네임_123',
+ time: '2024-02-19-12:00:00'
+ },
+ {
+ id: 7252,
+
+ nickname: '닉네임_323',
+ time: '2024-02-19-12:00:00'
+ },
+ {
+ id: 7253,
+
+ nickname: '닉네임_43',
+ time: '2024-02-19-12:00:00'
+ }
+ ]
+ }
+};
diff --git a/src/mocks/questionHandler/index.ts b/src/mocks/questionHandler/index.ts
new file mode 100644
index 0000000..495740d
--- /dev/null
+++ b/src/mocks/questionHandler/index.ts
@@ -0,0 +1,15 @@
+import { http, HttpResponse } from 'msw';
+
+import { MOCK_QUESTION_DATA } from './mocks';
+
+export const questionHandlers = [
+ /* ----- 1대1문의 전송 api ----- */
+ http.post(`/question`, () => {
+ return HttpResponse.json('문의 전송 성공!!');
+ }),
+
+ /* ----- 1대1 문의 내역 api ----- */
+ http.get(`/question`, () => {
+ return HttpResponse.json(MOCK_QUESTION_DATA);
+ })
+];
diff --git a/src/mocks/questionHandler/mocks.ts b/src/mocks/questionHandler/mocks.ts
new file mode 100644
index 0000000..cbe3ed0
--- /dev/null
+++ b/src/mocks/questionHandler/mocks.ts
@@ -0,0 +1,25 @@
+/* ----- 1:1문의 MOCK DATA ----- */
+export const MOCK_QUESTION_DATA = {
+ status: 200,
+ code: 'BMC002',
+ message: '문의데이터 조회 성공',
+ value: {
+ data: [
+ {
+ id: 7251,
+ title: '문의 제목1',
+ content: '문의 내용1'
+ },
+ {
+ id: 7252,
+ title: '문의 제목2',
+ content: '문의 내용2'
+ },
+ {
+ id: 7253,
+ title: '문의 제목3',
+ content: '문의 내용3'
+ }
+ ]
+ }
+};
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index 3898b95..508f0d0 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -5,6 +5,7 @@ export default function Document() {
+
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 38042ac..879b28e 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -8,14 +8,13 @@ import React, { useEffect } from 'react';
import { useQuery } from 'react-query';
const Index = () => {
+ /* eslint-disable */
const member = useMember();
const { data: memberData } = useQuery({ queryKey: ['userinfo'], queryFn: userinfo });
const setmember = useSetMember();
useEffect(() => {
- console.log(memberData);
setmember(memberData?.data);
}, [memberData, setmember]);
- console.log(member);
return (
diff --git a/src/pages/mypage/(question)/index.tsx b/src/pages/mypage/(question)/index.tsx
deleted file mode 100644
index 22fb823..0000000
--- a/src/pages/mypage/(question)/index.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-// import React, { useState } from 'react';
-
-// const InquiryForm = ({ onSubmit }) => {
-// const [title, setTitle] = useState('');
-// const [content, setContent] = useState('');
-
-// const isButtonActive = title && content;
-
-// const handleSubmit = () => {
-// if (isButtonActive) {
-// onSubmit({ title, content });
-// setTitle('');
-// setContent('');
-// }
-// };
-
-// return (
-//
-//
-//
-//
강남1호점
-//
-//
-//
제목
-//
setTitle(e.target.value)}
-// />
-//
-//
-//
-//
-//
-//
-// );
-// };
-
-// const InquiryHistory = ({ inquiries }) => {
-// const [openInquiry, setOpenInquiry] = useState(null);
-
-// const toggleInquiry = (index) => {
-// setOpenInquiry(openInquiry === index ? null : index);
-// };
-
-// return (
-//
-// {inquiries.length === 0 && (
-//
-//
-//
-// 문의 내역이 없습니다.
-//
-//
-// )}
-// {inquiries.map((inquiry, index) => (
-//
toggleInquiry(index)}>
-//
-//
-// {inquiry.title}
-//
-//
-//
-//
2024.05.16
-// {openInquiry === index && (
-//
-// {inquiry.content}
-//
-// )}
-//
-// ))}
-//
-// );
-// };
-
-// const InquiryPage = () => {
-// const [view, setView] = useState('inquiry');
-// const [inquiries, setInquiries] = useState([]);
-
-// const handleInquirySubmit = (inquiry) => {
-// setInquiries([...inquiries, inquiry]);
-// };
-
-// return (
-//
-//
-//
-//
-//
-
-//
-// {view === 'inquiry' ? (
-//
-// ) : (
-//
-// )}
-//
-//
-// );
-// };
-
-const InquiryPage = () => {
- return <>>;
-};
-export default InquiryPage;
diff --git a/src/pages/mypage/changepassword/index.tsx b/src/pages/mypage/changepassword/index.tsx
index 6b51357..df1edeb 100644
--- a/src/pages/mypage/changepassword/index.tsx
+++ b/src/pages/mypage/changepassword/index.tsx
@@ -66,7 +66,7 @@ export default function PasswordChange() {
/>
*/}
-
+
새로 사용할
비밀번호를 설정해주세요.
diff --git a/src/pages/mypage/changeprofile/index.tsx b/src/pages/mypage/changeprofile/index.tsx
index 224737a..b184fc0 100644
--- a/src/pages/mypage/changeprofile/index.tsx
+++ b/src/pages/mypage/changeprofile/index.tsx
@@ -4,6 +4,7 @@ import { useMember } from '@/store/user';
import { getTitleFromDescription, jobPosition } from '@/constant/jobPosition';
import { BackArrow } from '@/components/backarrow/BackArrow';
import { memberimage } from '@/api/auth/auth.patch.api';
+import useUpdateMember from '@/hook/useUpdateMember';
// import { useQuery } from 'react-query'; // Uncomment when useQuery is available
export default function Profile() {
@@ -11,7 +12,6 @@ export default function Profile() {
//api나오면 zustand 로직으로 수정
const [fileUrl, setFileUrl] = useState(null);
- // const [contact] = useState('010-1234-5678');
const member = useMember();
const job = getTitleFromDescription(jobPosition, member.memberJob);
@@ -29,12 +29,12 @@ export default function Profile() {
// console.log(formData);
// };
- console.log(member.imageUrl);
+ console.log(fileUrl);
const handleFileChange = (event: React.ChangeEvent) => {
if (event.target.files && event.target.files.length > 0) {
const file = event.target.files[0];
const formData = new FormData();
- formData.append('images', file);
+ formData.append('image', file);
console.log(formData);
memberimage(formData);
@@ -57,27 +57,16 @@ export default function Profile() {
}
console.log(formData);
};
+ useUpdateMember();
return (
-
+