From 69299a8998c28a0c692aa32fa8da706fb80f1b8f Mon Sep 17 00:00:00 2001 From: Kim0426 <706shin1728@naver.com> Date: Wed, 29 Nov 2023 18:53:08 +0900 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=EC=83=9D=EC=84=B1=ED=95=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=EA=B4=80=EB=A6=AC-=EC=A0=95=EB=A0=AC-?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8A=94-=EC=97=90=EB=9F=AC-=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#94)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 최종 리뷰 결과 반영 안되는 문제 해결 * refactor: 수신자 전체에서 검색 안되는 문제 해결 * refactor: 작성자별 정렬 추가 --- .../AllResponseByReceiver/index.tsx | 7 +----- .../AllResponseByResponser/index.tsx | 23 ++++++++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/pages/CreatedReviewManagePage/components/AllResponseByReceiver/index.tsx b/src/pages/CreatedReviewManagePage/components/AllResponseByReceiver/index.tsx index 2b646c54..fd9b76f6 100644 --- a/src/pages/CreatedReviewManagePage/components/AllResponseByReceiver/index.tsx +++ b/src/pages/CreatedReviewManagePage/components/AllResponseByReceiver/index.tsx @@ -59,12 +59,7 @@ const AllResponseReviewByResponser = ({ /> { - return { - id: receiver.receiverId, - name: receiver.receiverName, - } - })} + users={findUserBySearchKeyword} onClickUser={({ id, name }) => setSelectedUser({ id, name })} responserCount={responseByReceiver?.map( (value) => value.responserCount, diff --git a/src/pages/CreatedReviewManagePage/components/AllResponseByResponser/index.tsx b/src/pages/CreatedReviewManagePage/components/AllResponseByResponser/index.tsx index ffd0f90b..30c1d20d 100644 --- a/src/pages/CreatedReviewManagePage/components/AllResponseByResponser/index.tsx +++ b/src/pages/CreatedReviewManagePage/components/AllResponseByResponser/index.tsx @@ -18,6 +18,7 @@ const AllResponseReviewByResponser = ({ const { data: responseByResponser } = useGetAllResponseByResponser({ reviewId, }).data || { data: [] } + const [sortState, setSortState] = useState(false) const [keyword, setKeyword] = useState('') const [filteredUsers, setFilteredUsers] = useState( responseByResponser.sort((a, b) => a.user.name.localeCompare(b.user.name)), @@ -36,12 +37,22 @@ const AllResponseReviewByResponser = ({ } const sortByName = () => { - setFilteredUsers( - () => - [...filteredUsers]?.sort((a, b) => - a.user.name.localeCompare(b.user.name), - ), - ) + if (sortState) { + setFilteredUsers( + () => + [...filteredUsers]?.sort((a, b) => + a.user.name.localeCompare(b.user.name), + ), + ) + } else { + setFilteredUsers( + () => + [...filteredUsers]?.sort((a, b) => + b.user.name.localeCompare(a.user.name), + ), + ) + } + setSortState((prevState) => !prevState) } const sortByResponse = () => { From fcdcaa2fb4ac09f7f57fc2aaeb9c37eae65f951d Mon Sep 17 00:00:00 2001 From: JUHA KIM <88622675+hayamaster@users.noreply.github.com> Date: Wed, 29 Nov 2023 19:07:33 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EB=8B=B5=EB=B3=80=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=88=98=EC=8B=A0=EC=9E=90=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EB=93=9C=EB=A1=AD=EB=8B=A4=EC=9A=B4=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Header/index.tsx | 2 +- src/components/Profile/index.tsx | 4 +- .../ReviewReplyStart/ReviewSelect.tsx | 83 ++++++++++--------- 3 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index e6c79cbe..307cb4da 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -67,7 +67,7 @@ const Header = memo(({ handleGoBack }: HeaderProps) => { onClick={toggle} > {darkMode ? ( - + ) : ( )} diff --git a/src/components/Profile/index.tsx b/src/components/Profile/index.tsx index 2765ed6b..2dbda922 100644 --- a/src/components/Profile/index.tsx +++ b/src/components/Profile/index.tsx @@ -7,7 +7,9 @@ interface ProfileProps { } const Profile = ({ - image = , + image = ( + + ), name, className, }: ProfileProps) => { diff --git a/src/pages/ReviewReplyPage/components/ReviewReplyStart/ReviewSelect.tsx b/src/pages/ReviewReplyPage/components/ReviewReplyStart/ReviewSelect.tsx index ccc9e3d2..127bbe2c 100644 --- a/src/pages/ReviewReplyPage/components/ReviewReplyStart/ReviewSelect.tsx +++ b/src/pages/ReviewReplyPage/components/ReviewReplyStart/ReviewSelect.tsx @@ -1,6 +1,6 @@ import { ChangeEvent, useState, Dispatch, SetStateAction } from 'react' import { SubmitHandler, useFieldArray, useFormContext } from 'react-hook-form' -import { Profile, SearchBar } from '@/components' +import { Profile, SearchBar, Dropdown } from '@/components' import { useUser } from '@/apis/hooks' import { CloseIcon } from '@/assets/icons' import { Question } from '@/types' @@ -12,7 +12,6 @@ interface ReceiverSelectProps { } const ReceiverSelect = ({ setReviewStep, questions }: ReceiverSelectProps) => { - const [focus, setFocus] = useState(false) const [name, setName] = useState('') const { data: user } = useUser() @@ -106,7 +105,6 @@ const ReceiverSelect = ({ setReviewStep, questions }: ReceiverSelectProps) => { 'nonReceiverList', nonReceivers.sort((a, b) => a.receiverId - b.receiverId), ) - setFocus(true) } const handleChangeName = (e: ChangeEvent) => { @@ -120,44 +118,47 @@ const ReceiverSelect = ({ setReviewStep, questions }: ReceiverSelectProps) => { return (
-
- - {focus && ( -
    - {nonReceivers.length > 0 ? ( - nonReceivers - .filter((nonReceiver) => nonReceiver.name.includes(name)) - .map((nonReceiver, index) => ( -
  • { - appendReceiver(nonReceiver) - removeNonReceiver(index) - clearErrors('receiverList') - setFocus(false) - }} - key={nonReceiver.id} - className={`${index !== 0 && 'border-t'} ${ - index != nonReceivers.length - 1 && 'border-b' - } cursor-pointer border-gray-400 px-2.5 py-2.5 hover:bg-main-ivory dark:border-gray-300 dark:hover:bg-gray-300`} - > - -
  • - )) - ) : ( -

    - 더 이상 선택할 수 있는 유저가 없습니다. -

    - )} -
- )} -
+ + + + + + {nonReceivers.length > 0 ? ( + nonReceivers + .filter((nonReceiver) => nonReceiver.name.includes(name)) + .map((nonReceiver, index) => ( + { + const nonReceiverIndex = nonReceivers.findIndex( + (target) => target === nonReceiver, + ) + appendReceiver(nonReceiver) + removeNonReceiver(nonReceiverIndex) + clearErrors('receiverList') + setName('') + }} + > + + + )) + ) : ( + + {'더 이상 선택할 수 있는 유저가 없습니다.'} + + )} + +
    From 9fad6887570a830127b3196ac04bfe04325aaa9e Mon Sep 17 00:00:00 2001 From: hyoribogo <97094709+hyoribogo@users.noreply.github.com> Date: Wed, 29 Nov 2023 19:23:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EA=B8=B4=EA=B8=89=20=EC=88=98=EC=A0=95=20(#96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * style: 아이콘 스타일 수정 * style: 수정, 이미지 아이콘 svg 수정 * feat: 프로필 클릭해도 이미지 변경 가능 처리 * style: 헤더 프로필 스타일 수정 * style: 버튼 커서 포인터 * style: 생성 리뷰 관리 페이지 스타일 수정 * style: 욥션 배경색 수정 * style: 읽지 않음 처리 * refactor: alert 아이콘 이름 변경 * feat: 리뷰 리스트 비어있을 때 처리 --- .../icons/{no_result_alert.svg => alert.svg} | 2 +- src/assets/icons/edit.svg | 4 +- src/assets/icons/image.svg | 4 +- src/assets/icons/index.ts | 2 +- src/components/Header/index.tsx | 6 +-- src/components/UserList/index.tsx | 8 ++-- .../AnswerGroup/RenderRefinedSubjective.tsx | 6 ++- .../components/AnswerGroup/index.tsx | 46 +++++++++++-------- .../components/NotFoundSearchUser/index.tsx | 4 +- .../ReceiverTabReviewDatail/index.tsx | 8 ++-- .../ResponserTabReviewDetail/index.tsx | 4 +- .../components/SortDropDown/index.tsx | 14 +++--- .../MainPage/components/EmptyReview/index.tsx | 12 +++++ .../components/InvitedReviewList/index.tsx | 35 ++++++++------ .../components/ReceivedReviewList/index.tsx | 35 ++++++++------ src/pages/MyPage/index.tsx | 17 ++++--- .../components/QuestionItem/index.tsx | 2 +- .../components/QuestionItem/index.tsx | 2 +- .../components/ReceiverItem/index.tsx | 2 +- .../ReplyCategory/ReplyChoice/index.tsx | 2 +- .../ReplyCategory/ReplyChoices/index.tsx | 2 +- .../ReplyCategory/ReplyDropdown/index.tsx | 2 +- .../ReplyRating/StarRatingList/index.tsx | 2 +- 23 files changed, 128 insertions(+), 93 deletions(-) rename src/assets/icons/{no_result_alert.svg => alert.svg} (74%) create mode 100644 src/pages/MainPage/components/EmptyReview/index.tsx diff --git a/src/assets/icons/no_result_alert.svg b/src/assets/icons/alert.svg similarity index 74% rename from src/assets/icons/no_result_alert.svg rename to src/assets/icons/alert.svg index 4b30753c..8dc2525b 100644 --- a/src/assets/icons/no_result_alert.svg +++ b/src/assets/icons/alert.svg @@ -1,3 +1,3 @@ - + diff --git a/src/assets/icons/edit.svg b/src/assets/icons/edit.svg index 3ae25e70..144450f5 100644 --- a/src/assets/icons/edit.svg +++ b/src/assets/icons/edit.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/assets/icons/image.svg b/src/assets/icons/image.svg index 2f4debce..696daa79 100644 --- a/src/assets/icons/image.svg +++ b/src/assets/icons/image.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/assets/icons/index.ts b/src/assets/icons/index.ts index f1221708..8463ac85 100644 --- a/src/assets/icons/index.ts +++ b/src/assets/icons/index.ts @@ -22,7 +22,7 @@ export { default as LogoShortIcon } from './logo-short.svg?react' export { default as ReviewAlignIcon } from './review-align.svg?react' export { default as EditIcon } from './edit.svg?react' export { default as LeftSignXIcon } from './left-sign-x.svg?react' -export { default as NoSearchResultIcon } from './no_result_alert.svg?react' +export { default as AlertIcon } from './alert.svg?react' export { default as MultipleCheckIcon } from './multiple-check.svg?react' export { default as DropdownIcon } from './dropdown.svg?react' export { default as HexagonIcon } from './hexagon.svg?react' diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index 307cb4da..093be99f 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -63,11 +63,11 @@ const Header = memo(({ handleGoBack }: HeaderProps) => {
{darkMode ? ( - + ) : ( )} @@ -77,7 +77,7 @@ const Header = memo(({ handleGoBack }: HeaderProps) => { {user?.path ? ( -
+
my
) : ( diff --git a/src/components/UserList/index.tsx b/src/components/UserList/index.tsx index dd8bb92e..b3b14ca0 100644 --- a/src/components/UserList/index.tsx +++ b/src/components/UserList/index.tsx @@ -59,17 +59,15 @@ const UserList = ({ >
handleClick(user.id, user.name)} - className="flex items-center justify-between px-3 py-2 text-sm md:text-lg" + className="flex items-center justify-between px-2 py-2 text-sm md:text-lg" >
{responserCount && responserCount[index] && questionType !== 'PROCEEDING' && ( )} diff --git a/src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderRefinedSubjective.tsx b/src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderRefinedSubjective.tsx index 2835cd38..fb0b5dd9 100644 --- a/src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderRefinedSubjective.tsx +++ b/src/pages/CreatedReviewManagePage/components/AnswerGroup/RenderRefinedSubjective.tsx @@ -12,20 +12,22 @@ const RenderRefinedSubjective = ({ text }: RenderRefinedSubjectiveProps) => { const { handleChangePrompt, handleRefine } = handlers return ( -
+
{isLoading && (
)} +

⭐ 전송될 취합 답변:

+ -
+
(

{value.userName}

-

+

-

+
) @@ -81,10 +81,10 @@ const renderResponseByQuestion = ( role?: 'responser' | 'receiver', ) => (
-
+
{(() => { switch (questionType) { case 'RATING': @@ -115,25 +115,33 @@ const QuestionAnswerRenderer = ({ const [inputId] = useState(nanoid()) return ( -
- +
+
) } diff --git a/src/pages/CreatedReviewManagePage/components/NotFoundSearchUser/index.tsx b/src/pages/CreatedReviewManagePage/components/NotFoundSearchUser/index.tsx index 379c13cb..bbddca76 100644 --- a/src/pages/CreatedReviewManagePage/components/NotFoundSearchUser/index.tsx +++ b/src/pages/CreatedReviewManagePage/components/NotFoundSearchUser/index.tsx @@ -1,9 +1,9 @@ -import { NoSearchResultIcon } from '@/assets/icons' +import { AlertIcon } from '@/assets/icons' const NotFoundUser = () => { return (
- +

검색 결과가 없다!

) diff --git a/src/pages/CreatedReviewManagePage/components/ReceiverTabReviewDatail/index.tsx b/src/pages/CreatedReviewManagePage/components/ReceiverTabReviewDatail/index.tsx index 321c106a..88b6fd60 100644 --- a/src/pages/CreatedReviewManagePage/components/ReceiverTabReviewDatail/index.tsx +++ b/src/pages/CreatedReviewManagePage/components/ReceiverTabReviewDatail/index.tsx @@ -128,8 +128,8 @@ const ReceiverReviewDetail = ({ return ( <> - -
+ +
-
+
+
+
{getReviewQuestion?.questions?.map((question) => ( - -
+ +