diff --git a/src/assets/icons/icon-heart2.svg b/src/assets/icons/icon-heart2.svg index 8784c591..09cf0660 100644 --- a/src/assets/icons/icon-heart2.svg +++ b/src/assets/icons/icon-heart2.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/assets/icons/icon-heart4.svg b/src/assets/icons/icon-heart4.svg new file mode 100644 index 00000000..31da7e33 --- /dev/null +++ b/src/assets/icons/icon-heart4.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/icons/icon-save4.svg b/src/assets/icons/icon-save4.svg new file mode 100644 index 00000000..3b135a42 --- /dev/null +++ b/src/assets/icons/icon-save4.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/icons/icon-save5.svg b/src/assets/icons/icon-save5.svg new file mode 100644 index 00000000..144f9355 --- /dev/null +++ b/src/assets/icons/icon-save5.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/icons/icon_save2.svg b/src/assets/icons/icon_save2.svg new file mode 100644 index 00000000..f8f2651c --- /dev/null +++ b/src/assets/icons/icon_save2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/icons/icon_save3.svg b/src/assets/icons/icon_save3.svg new file mode 100644 index 00000000..204436c5 --- /dev/null +++ b/src/assets/icons/icon_save3.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/Buyer/BuyerConsult/BuyerOpenConsultSection.tsx b/src/components/Buyer/BuyerConsult/BuyerOpenConsultSection.tsx index 4cf16d3a..47741d3e 100644 --- a/src/components/Buyer/BuyerConsult/BuyerOpenConsultSection.tsx +++ b/src/components/Buyer/BuyerConsult/BuyerOpenConsultSection.tsx @@ -7,7 +7,9 @@ import { LoadingSpinner } from 'utils/LoadingSpinner'; import { isBuyPopupOpenState } from 'utils/atom'; import { ReactComponent as LockIcon } from 'assets/icons/icon-lock.svg'; import { ReactComponent as HeartIcon } from 'assets/icons/icon-heart2.svg'; -import { ReactComponent as SaveIcon } from 'assets/icons/icon-save2.svg'; +import { ReactComponent as HeartEmptyIcon } from 'assets/icons/icon-heart4.svg'; +import { ReactComponent as SaveIcon } from 'assets/icons/icon-save4.svg'; +import { ReactComponent as SaveEmptyIcon } from 'assets/icons/icon-save5.svg'; import { ReactComponent as CommentIcon } from 'assets/icons/icon-comment.svg'; import { Space } from 'components/Common/Space'; import { BackDrop } from 'components/Common/BackDrop'; @@ -147,11 +149,17 @@ function BuyerOpenConsultSection({ isChecked }: BuyerOpenConsultSectionProps) {
{item?.content}
- + {item?.isLiked ? ( + + ) : ( + + )} + {item?.totalLike} - + {item?.isScrapped ? : } + {item?.totalScrap} diff --git a/src/components/Buyer/BuyerLetterWrite/LetterPostModal.tsx b/src/components/Buyer/BuyerLetterWrite/LetterPostModal.tsx index 0798de8b..ed5052a6 100644 --- a/src/components/Buyer/BuyerLetterWrite/LetterPostModal.tsx +++ b/src/components/Buyer/BuyerLetterWrite/LetterPostModal.tsx @@ -43,6 +43,7 @@ export const LetterPostModal = ({ if (categoryType === 0) { alert('상담 카테고리를 정해주세요.'); setIsActive(false); + return; } else { //첫번째 질문 임시저장 X 메세지 임시저장 수정 try { diff --git a/src/components/Buyer/BuyerOpenConsult/OpenConsultList.tsx b/src/components/Buyer/BuyerOpenConsult/OpenConsultList.tsx index a1d51a1d..7ba8c48f 100644 --- a/src/components/Buyer/BuyerOpenConsult/OpenConsultList.tsx +++ b/src/components/Buyer/BuyerOpenConsult/OpenConsultList.tsx @@ -3,7 +3,9 @@ import styled from 'styled-components'; import { Grey1, Grey2, Grey6 } from 'styles/color'; import { Body1, Caption1 } from 'styles/font'; import { ReactComponent as HeartIcon } from 'assets/icons/icon-heart2.svg'; -import { ReactComponent as SaveIcon } from 'assets/icons/icon-save2.svg'; +import { ReactComponent as HeartEmptyIcon } from 'assets/icons/icon-heart4.svg'; +import { ReactComponent as SaveIcon } from 'assets/icons/icon-save4.svg'; +import { ReactComponent as SaveEmptyIcon } from 'assets/icons/icon-save5.svg'; import { ReactComponent as CommentIcon } from 'assets/icons/icon-comment.svg'; import { Space } from 'components/Common/Space'; import { openConsultApiObject } from 'pages/Buyer/BuyerConsult'; @@ -96,15 +98,16 @@ function OpenConsultList() {
{item.title}
- +
{item.content}
- + {item.isLiked ? : } {item.totalLike} + - + {item.isScrapped ? : } {item.totalScrap} @@ -169,6 +172,8 @@ const BuyerOpenConsultCard = styled.div` line-height: 155%; } .row3 { + position: absolute; + bottom: 1.6rem; display: flex; gap: 1.2rem; } @@ -179,7 +184,7 @@ const IconItem = styled.div` gap: 0.5rem; `; -const HeartResizeIcon = styled(HeartIcon)` +const SaveResizeIcon = styled(SaveIcon)` width: 2rem; height: 2rem; `; diff --git a/src/components/Buyer/BuyerOpenConsultDetail/CommentCard.tsx b/src/components/Buyer/BuyerOpenConsultDetail/CommentCard.tsx index 47ff7eae..ceddfb20 100644 --- a/src/components/Buyer/BuyerOpenConsultDetail/CommentCard.tsx +++ b/src/components/Buyer/BuyerOpenConsultDetail/CommentCard.tsx @@ -13,6 +13,7 @@ import { deleteCommentLikes } from 'api/delete'; import { postLikeComment } from 'api/post'; import { consultStyleToCharNum } from 'utils/convertStringToCharNum'; import { formattedMessage } from 'utils/formattedMessage'; +import { useNavigate } from 'react-router-dom'; interface CommentCardProps { item: commentApiObject; isMyPost: boolean; @@ -31,6 +32,7 @@ function CommentCard({ // 보내기 중복 방지 const [isSending, setIsSending] = useState(false); const [isFirstRendering, setIsFirstRendering] = useState(true); + const navigate = useNavigate(); const handleClickLikeButton = useCallback(async () => { if (isSending) { return; @@ -64,12 +66,25 @@ function CommentCard({ return (
- - {item.nickName} +
{ + navigate(`/profile/${item.counselorId}`); + }} + style={{ + display: 'flex', + alignItems: 'center', + gap: '0.8rem', + cursor: 'pointer', + }} + > + + {item.nickName} +
{item.updatedAt} diff --git a/src/components/Buyer/BuyerOpenConsultDetail/CommentListSection.tsx b/src/components/Buyer/BuyerOpenConsultDetail/CommentListSection.tsx index 3c23c615..91d7e853 100644 --- a/src/components/Buyer/BuyerOpenConsultDetail/CommentListSection.tsx +++ b/src/components/Buyer/BuyerOpenConsultDetail/CommentListSection.tsx @@ -33,7 +33,7 @@ function CommentListSection() { } } const res2: any = await getCustomerIsWriter(id); - if (res2.status === 200) setIsMyPost(res.data); + if (res2.status === 200) setIsMyPost(res2.data); else if (res2?.response.status === 404) { alert('존재하지 않는 게시물입니다.'); navigate('/open-consult'); diff --git a/src/components/Buyer/BuyerWriteOpenConsult/FianlWritePopup.tsx b/src/components/Buyer/BuyerWriteOpenConsult/FianlWritePopup.tsx index ff109a35..27eef8c8 100644 --- a/src/components/Buyer/BuyerWriteOpenConsult/FianlWritePopup.tsx +++ b/src/components/Buyer/BuyerWriteOpenConsult/FianlWritePopup.tsx @@ -36,8 +36,14 @@ function FinalWritePopup({ title, content, category }: FianlWritePopupProps) { alert('작성권한이 없습니다.'); navigate('/consult?type=open-consult'); } else if (res?.response.status === 404) { - alert('존재하지 않는 일대다상담입니다.'); - navigate('/consult?type=open-consult'); + if (res?.response.data.errorName === 'CONSULT_CATEGORY_NOT_FOUND') { + alert('상담 카테고리를 선택해주세요.'); + setIsPostPopupOpen(false); + return; + } else if (res?.data.errorName === 'CONSULT_TYPE_NOT_FOUND') { + alert('존재하지 않는 일대다상담입니다.'); + navigate('/consult?type=open-consult'); + } } } catch (err) { alert(err); diff --git a/src/components/Seller/Common/OngoingCounsultBox.tsx b/src/components/Seller/Common/OngoingCounsultBox.tsx index 96ab4a65..3adf930a 100644 --- a/src/components/Seller/Common/OngoingCounsultBox.tsx +++ b/src/components/Seller/Common/OngoingCounsultBox.tsx @@ -19,10 +19,10 @@ import { useNavigate } from 'react-router-dom'; import { CartegoryState, ConsultState } from 'utils/type'; interface OngoingCounsultBoxProps { categoryStatus?: string; - consultStatus: string; + consultStatus?: string; counselorName: string | undefined; - beforeMinutes: string | null; - content: string | null; + beforeMinutes: string | undefined | null; + content: string | null | undefined; newMessageCounts: number | null; counselorprofileStatus: number | undefined; onClick?: () => void; @@ -43,7 +43,10 @@ function OngoingCounsultBox({ }: OngoingCounsultBoxProps) { const navigate = useNavigate(); return ( - +
{categoryStatus && (
@@ -107,7 +110,9 @@ function OngoingCounsultBox({ ); } -const OngoingCounsultBoxWrapper = styled.div` +const OngoingCounsultBoxWrapper = styled.div<{ + $categoryStatus: string | undefined; +}>` width: calc(100% - 4rem); box-sizing: border-box; padding: 1.6rem; @@ -122,9 +127,8 @@ const OngoingCounsultBoxWrapper = styled.div` background-color: ${Grey6}; margin: 0 2rem; .button { - display: flex; - width: 6rem; - justify-content: center; + width: fit-content; + min-width: 5.6rem; } .flex-1 { display: flex; @@ -138,7 +142,8 @@ const OngoingCounsultBoxWrapper = styled.div` } .flex-2 { display: flex; - gap: 1.2rem; + gap: ${(props) => + props.$categoryStatus === '썸/연애시작' ? '2.4rem' : '1.2rem'}; } `; diff --git a/src/components/Seller/SellerLetterWrite/LetterIsSaveModal.tsx b/src/components/Seller/SellerLetterWrite/LetterIsSaveModal.tsx index 2a0ba608..f6953d2c 100644 --- a/src/components/Seller/SellerLetterWrite/LetterIsSaveModal.tsx +++ b/src/components/Seller/SellerLetterWrite/LetterIsSaveModal.tsx @@ -6,12 +6,16 @@ interface SaveModalProps { setReplyText: React.Dispatch>; lastModifyDate: string | undefined; saveText: string; + setIsActiveSaveButton: React.Dispatch>; + setIsActivePostButton: React.Dispatch>; } // 임시저장할지 여부 모달 export const LetterIsSaveModal = ({ setIsActive, setReplyText, lastModifyDate, + setIsActivePostButton, + setIsActiveSaveButton, saveText, }: SaveModalProps) => { return ( @@ -31,6 +35,8 @@ export const LetterIsSaveModal = ({ onClick={() => { setIsActive(false); setReplyText(saveText); + setIsActiveSaveButton(true); + setIsActivePostButton(true); }} > 불러오기 diff --git a/src/components/Seller/SellerLetterWrite/LetterSavePostModal.tsx b/src/components/Seller/SellerLetterWrite/LetterSavePostModal.tsx index 1b6d5eac..c6648b3a 100644 --- a/src/components/Seller/SellerLetterWrite/LetterSavePostModal.tsx +++ b/src/components/Seller/SellerLetterWrite/LetterSavePostModal.tsx @@ -10,6 +10,7 @@ interface LetterWriteSavePostModal { isSave: boolean; messageType: string; saveId: string; + } // 임시저장 할까요? 모달 export const LetterSavePostModal = ({ diff --git a/src/components/Seller/SellerLetterWrite/LetterWriteMainSection.tsx b/src/components/Seller/SellerLetterWrite/LetterWriteMainSection.tsx index 6d715bfd..7b1f7eeb 100644 --- a/src/components/Seller/SellerLetterWrite/LetterWriteMainSection.tsx +++ b/src/components/Seller/SellerLetterWrite/LetterWriteMainSection.tsx @@ -14,6 +14,7 @@ import { } from 'api/get'; import { LoadingSpinner } from 'utils/LoadingSpinner'; import { Space } from 'components/Common/Space'; +import { CartegoryState } from 'utils/type'; interface LetterConsultInform { categoryStatus?: CartegoryState; counselorName: string | undefined; @@ -130,7 +131,7 @@ export const LetterWriteMainSection = ({ setConsultInform({ categoryStatus: customerInfoResponse?.data?.category, counselorName: customerInfoResponse?.data?.nickname, - beforeMinutes: '5분 전', // 포매팅 필요 + beforeMinutes: letterResponse?.data?.updatedAt2, counselorprofileStatus: 1, // 포매팅 필요 newMessageCounts: 0, content: letterResponse?.data?.content, @@ -159,6 +160,8 @@ export const LetterWriteMainSection = ({ setReplyText={setReplyText} setIsActive={setIsActiveSaveModal} lastModifyDate={saveDate} + setIsActivePostButton={setIsActivePostButton} + setIsActiveSaveButton={setIsActiveSaveButton} /> )} {isActiveSavePostModal && ( @@ -226,7 +229,7 @@ export const LetterWriteMainSection = ({ onClick={() => { setIsActivePostModal(true); }} - isActive={isActiveSaveButton} + isActive={isActivePostButton} disabled={isActivePostButton ? false : true} > 보내기 diff --git a/src/components/Seller/SellerMyPageViewProfile/ViewProfileMainSection.tsx b/src/components/Seller/SellerMyPageViewProfile/ViewProfileMainSection.tsx index 96b218ab..f1fd6781 100644 --- a/src/components/Seller/SellerMyPageViewProfile/ViewProfileMainSection.tsx +++ b/src/components/Seller/SellerMyPageViewProfile/ViewProfileMainSection.tsx @@ -90,7 +90,7 @@ ViewProfileMainSectionProps) => { {daysOfWeek?.map( (day: string) => chatTime?.[day]?.length > 0 && ( - + {dayEngtoKor[day] + (chatTime?.[day]?.length === 1 ? ' ' + convertTimeRange(chatTime?.[day][0]) @@ -139,6 +139,7 @@ ViewProfileMainSectionProps) => {
+ {/* 나중에 사용할 수 도 있는 코드 */} {/* 수익 계좌
@@ -226,7 +227,7 @@ const WhiteBox = styled.div` flex-direction: column; } `; - +// 나중에 사용할 수도 있는 코드 // const AccountWhiteBox = styled(WhiteBox)` // gap: 0.6rem; // & > div { @@ -251,6 +252,7 @@ const IntroduceWhiteBox = styled(WhiteBox)` } `; +// 나중에 사용할 수도 있는 코드 // const AccountTag = styled(Body1)` // width: 10rem; // margin-bottom: 0.4rem; diff --git a/src/components/Seller/SellerOpenConsult/CommentListSection.tsx b/src/components/Seller/SellerOpenConsult/CommentListSection.tsx index 00392e06..a063598b 100644 --- a/src/components/Seller/SellerOpenConsult/CommentListSection.tsx +++ b/src/components/Seller/SellerOpenConsult/CommentListSection.tsx @@ -29,6 +29,7 @@ export interface commentApiObject { totalLike: number; consultStyle: string; updatedAt: string; + counselorId: number; isChosen: boolean; } diff --git a/src/components/Seller/SellerOpenConsult/MainQuestionSection.tsx b/src/components/Seller/SellerOpenConsult/MainQuestionSection.tsx index a9ee6544..45dc822b 100644 --- a/src/components/Seller/SellerOpenConsult/MainQuestionSection.tsx +++ b/src/components/Seller/SellerOpenConsult/MainQuestionSection.tsx @@ -46,7 +46,8 @@ function MainQuestionSection() {
- + {/* 나중에 사용할수도 있는 코드 */} + {/* {card?.totalLike} @@ -55,7 +56,7 @@ function MainQuestionSection() { {card?.totalScrap} - + */} ); } @@ -103,22 +104,23 @@ const Circle = styled.div` background-color: ${Grey3}; `; -const ButtonList = styled.div` - display: flex; - gap: 1.2rem; -`; +// 나중에 사용할 수도 있는 코드.. +// const ButtonList = styled.div` +// display: flex; +// gap: 1.2rem; +// `; -const ButtonItem = styled.div` - border-radius: 0.8rem; - background: ${Grey6}; - display: flex; - padding: 0.6rem 1.2rem 0.6rem 0.6rem; - align-items: center; - gap: 0.4rem; -`; +// const ButtonItem = styled.div` +// border-radius: 0.8rem; +// background: ${Grey6}; +// display: flex; +// padding: 0.6rem 1.2rem 0.6rem 0.6rem; +// align-items: center; +// gap: 0.4rem; +// `; -const SaveResizeIcon = styled(SaveIcon)` - width: 2rem; - height: 2rem; -`; +// const SaveResizeIcon = styled(SaveIcon)` +// width: 2rem; +// height: 2rem; +// `; export default React.memo(MainQuestionSection); diff --git a/src/pages/Buyer/BuyerFinishPayment.tsx b/src/pages/Buyer/BuyerFinishPayment.tsx index 21b4288d..c2ab3e5e 100644 --- a/src/pages/Buyer/BuyerFinishPayment.tsx +++ b/src/pages/Buyer/BuyerFinishPayment.tsx @@ -30,7 +30,6 @@ function BuyerFinishPayment() { 상담 신청 완료 - blabla
diff --git a/src/pages/Buyer/BuyerWriteOpenConsult.tsx b/src/pages/Buyer/BuyerWriteOpenConsult.tsx index a7578621..8652d171 100644 --- a/src/pages/Buyer/BuyerWriteOpenConsult.tsx +++ b/src/pages/Buyer/BuyerWriteOpenConsult.tsx @@ -22,7 +22,9 @@ import { getOneOpenConsult } from 'api/get'; function BuyerWriteOpenConsult() { const navigate = useNavigate(); const [categoryType, setCategoryType] = useState(0); + const categoryList = [ + '상담 카테고리', '연애갈등', '이별/재회', '여자심리',