diff --git a/app/(my)/my-study-review/page.tsx b/app/(my)/my-study-review/page.tsx index b653e736..21cffeda 100644 --- a/app/(my)/my-study-review/page.tsx +++ b/app/(my)/my-study-review/page.tsx @@ -1,7 +1,7 @@ 'use client'; import Image from 'next/image'; -import { useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import KeywordReview from '@/entities/user/ui/keyword-review'; import MoreKeywordReviewModal from '@/entities/user/ui/more-keyword-review-modal'; import { MyReviewItem } from '@/features/study/api/types'; @@ -11,6 +11,7 @@ import { useUserPositiveKeywordsQuery, } from '@/features/study/model/use-review-query'; import { formatKoreaRelativeTime } from '@/shared/lib/time'; +import UserAvatar from '@/shared/ui/avatar'; export default function MyStudyReview() { const { data: positiveKeywordsData } = useUserPositiveKeywordsQuery({ @@ -172,16 +173,27 @@ function MoreNegativeKeywordsModal() { function Review({ data }: { data: MyReviewItem }) { const [expanded, setExpanded] = useState(false); + const [showButton, setShowButton] = useState(false); + const contentRef = useRef(null); + + useEffect(() => { + if (contentRef.current) { + const lineHeight = parseInt( + window.getComputedStyle(contentRef.current).lineHeight, + 10, + ); + const maxHeight = lineHeight * 3; // 3줄 기준 + setShowButton(contentRef.current.scrollHeight > maxHeight); + } + }, [data.content]); return (
  • - {`${data.writer.memberName}
    @@ -197,18 +209,23 @@ function Review({ data }: { data: MyReviewItem }) {

    {data.content}

    - -
    + {showButton && ( + + )} +
    스터디 기간 diff --git a/src/features/study/api/types.ts b/src/features/study/api/types.ts index 92ab0371..a77cbd89 100644 --- a/src/features/study/api/types.ts +++ b/src/features/study/api/types.ts @@ -124,7 +124,7 @@ export interface AddStudyReviewRequest { targetMemberId: number; satisfactionId: 10 | 20 | 30; keywordIds: number[]; - content: string; + content?: string; } interface Keyword { diff --git a/src/features/study/ui/study-review-modal.tsx b/src/features/study/ui/study-review-modal.tsx index dd959979..e39d325b 100644 --- a/src/features/study/ui/study-review-modal.tsx +++ b/src/features/study/ui/study-review-modal.tsx @@ -74,18 +74,19 @@ function StudyReviewForm({ onClose }: { onClose: () => void }) { if (!data) return null; const handleSubmit = () => { - if ( - form.keywordIds.length === 0 || - form.satisfactionId === null || - form.content === '' - ) - return; - - addStudyReview(form, { - onSuccess: () => { - onClose(); + if (form.keywordIds.length === 0 || form.satisfactionId === null) return; + + addStudyReview( + { + ...form, + content: form.content || undefined, + }, + { + onSuccess: () => { + onClose(); + }, }, - }); + ); }; return (