diff --git a/src/apis/index.ts b/src/apis/index.ts index 0034a15f..1a638e71 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -2,7 +2,7 @@ import axios from 'axios'; import qs from 'qs'; const getToken = () => - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidGVhbUlkIjoiNS05Iiwic2NvcGUiOiJhY2Nlc3MiLCJpYXQiOjE3MjE5ODMyMTksImV4cCI6MTcyMTk4NTAxOSwiaXNzIjoic3AtZXBpZ3JhbSJ9.57RemB9wCHGmVhLInNKWs6uKulDLDCv4dcJuGrBsG4s'; + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywidGVhbUlkIjoiNS05Iiwic2NvcGUiOiJhY2Nlc3MiLCJpYXQiOjE3MjE5ODUyNzUsImV4cCI6MTcyMTk4NzA3NSwiaXNzIjoic3AtZXBpZ3JhbSJ9.E6-Rr2AupbIj0WgdAgTCDuuz6v-AkMxmxn2kYsh2R2M'; const httpClient = axios.create({ baseURL: process.env.NEXT_PUBLIC_BASE_URL, diff --git a/src/components/epigram/Comment/CommentTextarea.tsx b/src/components/epigram/Comment/CommentTextarea.tsx index 7be5cf89..39106767 100644 --- a/src/components/epigram/Comment/CommentTextarea.tsx +++ b/src/components/epigram/Comment/CommentTextarea.tsx @@ -20,6 +20,7 @@ function CommentTextarea({ epigramId }: CommentTextareaProps) { const form = useForm({ resolver: zodResolver(CommentFormSchema), + //NOTE: 초기값 설정 defaultValues: { content: '', isPrivate: false, @@ -81,9 +82,11 @@ function CommentTextarea({ epigramId }: CommentTextareaProps) { render={({ field }) => ( + {/* NOTE: Switch를 눌렀을때 onCheckedChange실행되면서 반대의 값을 받음 */} + {/* NOTE: field.onChange는 react hook form에서 setValue와 연결되어있어서 자동으로 값을 담아줌 */} - diff --git a/src/pageLayout/Epigram/EpigramComment.tsx b/src/pageLayout/Epigram/EpigramComment.tsx index 5043c5ac..b7fe2dc3 100644 --- a/src/pageLayout/Epigram/EpigramComment.tsx +++ b/src/pageLayout/Epigram/EpigramComment.tsx @@ -4,7 +4,7 @@ import { paddingStyles } from '@/styles/CommentCardStyles'; import { EpigramCommentProps } from '@/types/epigram.types'; import Image from 'next/image'; -function EpigramComment({ epigramId, currentUserId }: EpigramCommentProps) { +function EpigramComment({ epigramId, currentUserId, userImage }: EpigramCommentProps) { return (
@@ -12,7 +12,11 @@ function EpigramComment({ epigramId, currentUserId }: EpigramCommentProps) {
- 프로필 사진 + {userImage ? ( + 사용자 프로필 사진 + ) : ( + 기본 프로필 사진 + )}
diff --git a/src/pages/epigram/[id].tsx b/src/pages/epigram/[id].tsx index c0608180..d679f29c 100644 --- a/src/pages/epigram/[id].tsx +++ b/src/pages/epigram/[id].tsx @@ -28,7 +28,7 @@ function DetailPage() { 공유 버튼 - +
); } diff --git a/src/types/epigram.types.ts b/src/types/epigram.types.ts index 76119ce5..f017f1cc 100644 --- a/src/types/epigram.types.ts +++ b/src/types/epigram.types.ts @@ -9,6 +9,7 @@ export interface EpigramFigureProps { export interface EpigramCommentProps { epigramId: number; currentUserId: GetUserResponseType['id'] | undefined; + userImage?: string | undefined; } export interface PostCommentRequest {