-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 스터디 후기 #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[Feat] 스터디 후기 #124
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
4ba2f17
refactor: 스터디 신청 버튼 디자인 수정
aken-you f1941c1
feat: 피드백 버튼 추가
aken-you 7777017
refactor: 피드백 아이콘 가로길이 수정
aken-you 7662040
feat: background 컬러 토큰 추가
aken-you 3a9b7d9
feat: 스터디원 후기 작성 모달에서 보여줄 아이콘 추가
aken-you 82c1a5d
feat: success background 컬러 토큰 추가
aken-you cfd197f
feat: checkbox 아이콘 파일 추가
aken-you 3a0ff14
feat: 스터디 후기 모달에 보여줄 데이터 요청 커스텀훅 생성
aken-you e62a608
fix: Button 컴포넌트에서 cn 오타 수정
aken-you 913982c
feat: 스터디 리뷰 후기 모달 생성
aken-you 4a97b4d
feat: 스터디 리뷰 제출 api 커스텀 훅 생성
aken-you 5cb4e66
feat: textarea onChange 핸들러 추가
aken-you 0edb94b
feat: checkbox onToggle 핸들러 추가
aken-you 24cb4da
refactor: checkbox border 굵기 수정
aken-you ecc5e08
refactor: 폼로직을 StudyReviewForm으로 분리
aken-you 557993d
refactor: 등록하기 disabled 설정
aken-you 3e63ea0
feat: 스터디 후기 추가되면, 안내 메세지 제공
aken-you d3f0f09
refactor: useSuspenseQuery로 변경하여 파트너 스터디 후기 쿼리 개선
aken-you da67164
refactor: 등록하기 disabled 수정
aken-you b5e426a
feat: 스터디 리뷰 페이지 view 완성
aken-you b1be385
refactor: user profile modal에서 사용자 정보를 입력하지 않았을 경우, 빈 문자열로 표시
aken-you b63525f
style: 계정 설정 주석 처리
aken-you ed2e15a
feat: 긍정적 평가 키워드 api 요청 커스텀 훅 생성
aken-you fb2d5db
feat: 부정적 평가 키워드 api 요청 커스텀 훅 생성
aken-you 64b7788
refactor: 긍정적 키워드 목록의 queryKey 네이밍 수정
aken-you e778671
refactor: 키워드 response 타입 수정
aken-you f37d4e4
feat: 스터디 후기 조회 api 커스텀 훅 생성
aken-you 3ae3a8b
refactor: 리뷰 border와 image 스타일 수정
aken-you b0eedf6
refactor: 한국 시간 포맷팅 함수 추가 및 사용 수정
aken-you addf349
refactor: ProfileInfoCard 레이어 widgets -> entities로 변경
aken-you 1bd76b5
feat: 총 리뷰 받은 수 표시
aken-you 59cecbe
refactor: KeywordReview 컴포넌트 entities 레이어로 이동
aken-you 1ac1a71
refactor: UserProfileModal에 받은 평가 표시
aken-you 6ebad6e
refactor: ProfileInfoCard와 ProfileInfoCard 도메인 변경
aken-you 65b47c0
Merge branch 'develop' into feat/study-review
aken-you c4abb40
style: formatKoreaRelativeTime에서 1분 미만이면 "방금 전" 반환
aken-you 747784b
refactor: features에 있는 UserProfileModal 삭제
aken-you File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,212 @@ | ||
| 'use client'; | ||
|
|
||
| import Image from 'next/image'; | ||
| import { useState } from 'react'; | ||
| import KeywordReview from '@/entities/user/ui/keyword-review'; | ||
| import { MyReviewItem } from '@/features/study/api/types'; | ||
| import { | ||
| useMyNegativeKeywordsQuery, | ||
| useMyReviewsInfinityQuery, | ||
| useUserPositiveKeywordsQuery, | ||
| } from '@/features/study/model/use-review-query'; | ||
| import { formatKoreaRelativeTime } from '@/shared/lib/time'; | ||
|
|
||
| export default function MyStudyReview() { | ||
| const { data: positiveKeywordsData } = useUserPositiveKeywordsQuery({ | ||
| pageSize: 5, | ||
| }); | ||
| const { data: negativeKeywordsData } = useMyNegativeKeywordsQuery({ | ||
| pageSize: 5, | ||
| }); | ||
| const { | ||
| data: myReviewsData, | ||
| fetchNextPage, | ||
| hasNextPage, | ||
| } = useMyReviewsInfinityQuery(); | ||
|
|
||
| const positiveKeywords = positiveKeywordsData?.keywords || []; | ||
| const negativeKeywords = negativeKeywordsData?.keywords || []; | ||
|
|
||
| const positiveKeywordsCount = positiveKeywordsData?.totalCount || 0; | ||
| const negativeKeywordsCount = negativeKeywordsData?.totalCount || 0; | ||
|
|
||
| const totalKeywordsCount = positiveKeywordsCount + negativeKeywordsCount; | ||
|
|
||
| const myReviews = myReviewsData?.reviews || []; | ||
|
|
||
| return ( | ||
| <> | ||
| <section> | ||
| <div className="mb-200"> | ||
| <div className="flex items-center gap-100"> | ||
| <div className="font-designer-20b text-text-default">받은 평가</div> | ||
| <div className="font-designer-20b text-text-default"> | ||
| {totalKeywordsCount} | ||
| </div> | ||
| </div> | ||
|
|
||
| <span className="font-designer-14r text-text-subtle"> | ||
| 개선이 필요한 점은 나에게만 보여요 | ||
| </span> | ||
| </div> | ||
|
|
||
| <div className="mb-400 grid grid-cols-2 gap-300"> | ||
| <div className="rounded-100 border-border-subtle min-h-[280px] border p-200"> | ||
| <div className="mb-200 flex justify-between"> | ||
| <h3 className="font-designer-16b text-text-default">좋았던 점</h3> | ||
|
|
||
| {positiveKeywords.length > 5 && ( | ||
| <button className="font-designer-12m text-text-subtlest cursor-pointer"> | ||
| 더보기 | ||
| </button> | ||
| )} | ||
| </div> | ||
|
|
||
| <ul className="flex flex-col gap-50"> | ||
| {positiveKeywords.length > 0 ? ( | ||
| positiveKeywords.map((keyword) => ( | ||
| <KeywordReview | ||
| key={keyword.id} | ||
| content={keyword.content} | ||
| count={keyword.count} | ||
| /> | ||
| )) | ||
| ) : ( | ||
| <span className="text-text-subtle font-designer-14r text-center"> | ||
| 아직 받은 평가가 없습니다. | ||
| </span> | ||
| )} | ||
| </ul> | ||
| </div> | ||
|
|
||
| <div className="rounded-100 border-border-subtle min-h-[280px] border p-200"> | ||
| <div className="mb-200 flex justify-between"> | ||
| <h3 className="font-designer-16b text-text-default"> | ||
| 개선이 필요한 점 | ||
| </h3> | ||
|
|
||
| {negativeKeywords.length > 5 && ( | ||
| <button className="font-designer-12m text-text-subtlest cursor-pointer"> | ||
| 더보기 | ||
| </button> | ||
| )} | ||
| </div> | ||
|
|
||
| <ul className="flex flex-col gap-50"> | ||
| {negativeKeywords.length > 0 ? ( | ||
| negativeKeywords.map((keyword) => ( | ||
| <KeywordReview | ||
| key={keyword.id} | ||
| content={keyword.content} | ||
| count={keyword.count} | ||
| /> | ||
| )) | ||
| ) : ( | ||
| <span className="text-text-subtle font-designer-14r text-center"> | ||
| 아직 받은 평가가 없습니다. | ||
| </span> | ||
| )} | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section> | ||
| <div className="flex items-center gap-100"> | ||
| <div className="font-designer-20b text-text-default">후기</div> | ||
| <div className="font-designer-20b text-text-default"> | ||
| {myReviewsData?.totalCount || 0} | ||
| </div> | ||
| </div> | ||
|
|
||
| <span className="font-designer-14r text-text-subtle"> | ||
| 모든 후기는 나에게만 보여요 | ||
| </span> | ||
|
|
||
| <ul> | ||
| {myReviews.length > 0 ? ( | ||
| myReviews.map((review) => <Review key={review.id} data={review} />) | ||
| ) : ( | ||
| <div className="text-text-subtle font-designer-14r flex h-[200px] items-center justify-center text-center"> | ||
| 아직까지 받은 후기가 없습니다. | ||
| </div> | ||
| )} | ||
|
|
||
| {hasNextPage && ( | ||
| <button | ||
| className="font-designer-14m text-text-subtle hover:bg-background-accent-gray-default rounded-50 flex w-full cursor-pointer items-center justify-center py-200" | ||
| onClick={() => fetchNextPage()} | ||
| > | ||
| <span>더보기</span> | ||
|
|
||
| <Image | ||
| src="/icons/arrow-down.svg" | ||
| width={20} | ||
| height={20} | ||
| alt="후기 더보기" | ||
| /> | ||
| </button> | ||
| )} | ||
| </ul> | ||
| </section> | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| function Review({ data }: { data: MyReviewItem }) { | ||
| const [expanded, setExpanded] = useState(false); | ||
|
|
||
| return ( | ||
| <li className="border-b-border-subtle flex flex-col gap-150 border-b py-250"> | ||
| <div className="flex items-center gap-150"> | ||
| <Image | ||
| src={data.writer.profileImageUrl || '/profile-default.svg'} | ||
| width={32} | ||
| height={32} | ||
| alt={`${data.writer.memberName} 프로필 이미지`} | ||
| className="rounded-full" | ||
| /> | ||
|
|
||
| <div> | ||
| <span className="font-designer-14b text-text-default mr-50"> | ||
| {data.writer.memberName} | ||
| </span> | ||
| <span className="font-designer-14r text-text-subtle mr-50">·</span> | ||
| <span className="font-designer-14r text-text-subtle"> | ||
| {formatKoreaRelativeTime(data.reviewedAt)} | ||
| </span> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div> | ||
| <p | ||
| className={`text-text-default font-designer-15r ${expanded ? 'line-clamp-none' : 'line-clamp-3'}`} | ||
| > | ||
| {data.content} | ||
| </p> | ||
| <button | ||
| className="font-designer-14r text-text-subtlest cursor-pointer" | ||
| onClick={() => setExpanded(!expanded)} | ||
| > | ||
| {expanded ? '접기' : '더보기'} | ||
| </button> | ||
| </div> | ||
|
|
||
| <div> | ||
| <div className="text-text-subtle"> | ||
| <span className="font-designer-14b mr-100">스터디 기간</span> | ||
| <span className="font-designer-13r"> | ||
| {data.startDate.replace(/-/g, '.')} ~{' '} | ||
| {data.endDate.replace(/-/g, '.')} | ||
| </span> | ||
| </div> | ||
| <div className="text-text-subtle"> | ||
| <span className="font-designer-14b mr-100">스터디 주제</span> | ||
| <span className="font-designer-13r"> | ||
| {data.studySubjects.join(', ')} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </li> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export default function KeywordReview({ | ||
| content, | ||
| count, | ||
| }: { | ||
| content: string; | ||
| count: number; | ||
| }) { | ||
| return ( | ||
| <li className="bg-background-accent-gray-default text-text-default rounded-50 flex justify-between px-200 py-100"> | ||
| <span className="font-designer-14r">{content}</span> | ||
| <span className="font-designer-14b">{count}</span> | ||
| </li> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것들은 혹시 새로 디자인 시스템에 추가된 건가요??
만약 이번에 추가된 게 아니라 원래 있던 건데 등록되어 있지 않았던거라면, 디자인 시스템도 나중에 한 번 쭉 수정해야 하긴 해야겠네요....😥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원래 디자인에는 있었는데, 이 파일에 없어서 추가했습니다!