diff --git a/fonts/montserrat/Montserrat-Regular.woff2 b/fonts/montserrat/Montserrat-Regular.woff2 new file mode 100644 index 00000000..e69de29b diff --git a/public/icon/menu-icon.svg b/public/icon/menu-icon.svg new file mode 100644 index 00000000..0453091a --- /dev/null +++ b/public/icon/menu-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/icon/privateIcon.png b/public/icon/privateIcon.png new file mode 100644 index 00000000..3f6c8a22 Binary files /dev/null and b/public/icon/privateIcon.png differ diff --git a/public/icon/publicIcon.png b/public/icon/publicIcon.png new file mode 100644 index 00000000..05e342c3 Binary files /dev/null and b/public/icon/publicIcon.png differ diff --git a/public/icon/user-icon.svg b/public/icon/user-icon.svg new file mode 100644 index 00000000..5aadd60f --- /dev/null +++ b/public/icon/user-icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/icon/x-icon.svg b/public/icon/x-icon.svg new file mode 100644 index 00000000..08439b1b --- /dev/null +++ b/public/icon/x-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/noComment.svg b/public/noComment.svg new file mode 100644 index 00000000..ebf2cf2c --- /dev/null +++ b/public/noComment.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/unlikeIcon.svg b/public/unlikeIcon.svg new file mode 100644 index 00000000..9b841d94 --- /dev/null +++ b/public/unlikeIcon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/apis/epigramComment.ts b/src/apis/epigramComment.ts index 4368fb9a..22de9af7 100644 --- a/src/apis/epigramComment.ts +++ b/src/apis/epigramComment.ts @@ -30,6 +30,14 @@ export const getEpigramComments = async (params: CommentRequestType): Promise => { + const { id, ...restParams } = params; + const response = await httpClient.get(`/users/${id}/comments`, { + params: restParams, + }); + return response.data; +}; + export const postComment = async (commentData: PostCommentRequest) => { const response = await httpClient.post('/comments', commentData); return response.data; diff --git a/src/apis/queries.ts b/src/apis/queries.ts index ede08705..817fe12b 100644 --- a/src/apis/queries.ts +++ b/src/apis/queries.ts @@ -4,9 +4,9 @@ import { EpigramRequestType } from '@/schema/epigram'; import { CommentRequestType } from '@/schema/comment'; import { GetMonthlyEmotionLogsRequestType } from '@/schema/emotion'; import { GetEpigramsParamsType } from '@/schema/epigrams'; -import { getMe, getUser } from './user'; -import { getEpigram } from './epigram'; -import { getEpigramComments } from './epigramComment'; +import { getMe, getUser, getMyContentCount } from './user'; +import { getEpigram, toggleEpigramLike } from './epigram'; +import { getEpigramComments, getMyEpigramComments } from './epigramComment'; import getMonthlyEmotionLogs from './emotion'; import getEpigrams from './getEpigrams'; @@ -20,6 +20,10 @@ const queries = createQueryKeyStore({ queryKey: [request], queryFn: () => getUser(request), }), + getMyContentCount: (request: GetUserRequestType) => ({ + queryKey: ['getMyContentCount', request], + queryFn: () => getMyContentCount(request), + }), }, // NOTE: Epigram 관련 query함수 epigram: { @@ -33,12 +37,24 @@ const queries = createQueryKeyStore({ }, enabled: request.id !== undefined, }), + toggleLike: (request: EpigramRequestType) => ({ + queryKey: ['toggleEpigramLike', request.id], + mutationFn: (variables: EpigramRequestType) => toggleEpigramLike(variables), + }), }, epigramComment: { getComments: (request: CommentRequestType) => ({ queryKey: ['epigramComments', request], queryFn: () => getEpigramComments(request), }), + getCommentList: (request: CommentRequestType) => ({ + queryKey: ['epigramComments', request] as const, + queryFn: ({ pageParam }: { pageParam: number | undefined }) => getEpigramComments({ ...request, cursor: pageParam }), + }), + getMyComments: (request: CommentRequestType) => ({ + queryKey: ['myEpigramComments', request], + queryFn: () => getMyEpigramComments(request), + }), }, emotion: { getMonthlyEmotionLogs: (request: GetMonthlyEmotionLogsRequestType) => ({ diff --git a/src/apis/user.ts b/src/apis/user.ts index 5f924dea..17b8ce80 100644 --- a/src/apis/user.ts +++ b/src/apis/user.ts @@ -1,4 +1,4 @@ -import type { GetUserResponseType, GetUserRequestType, PatchMeRequestType, PostPresignedUrlRequestType, PostPresignedUrlResponseType } from '@/schema/user'; +import type { GetUserResponseType, GetUserRequestType, PatchMeRequestType, PostPresignedUrlRequestType, PostPresignedUrlResponseType, GetMyContentCountType } from '@/schema/user'; import httpClient from '.'; export const getMe = async (): Promise => { @@ -23,3 +23,17 @@ export const createPresignedUrl = async (request: PostPresignedUrlRequestType): const response = await httpClient.post('/images/upload', formData); return response.data; }; + +export const getMyContentCount = async (request: GetUserRequestType): Promise => { + const { id } = request; + + // 에피그램 카운트 + const epigram = await httpClient.get(`/epigrams`, { params: { limit: 1, cursor: 0, writerId: id } }); + + // 댓글 카운트 + const comment = await httpClient.get(`/users/${id}/comments`, { params: { limit: 1, cursor: 0 } }); + + const response = { epigramCount: epigram.data.totalCount, commentCount: comment.data.totalCount }; + + return response; +}; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 14df0b93..9f4776d9 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -68,7 +68,7 @@ function Header({ isLogo, icon, insteadOfLogo, isButton, isProfileIcon, isShareI return (