Skip to content
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

[0426] main 배포 #243

Merged
merged 40 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bcc960a
Hotfix: 마인더 답장썻는지 여부에 따라 답장쓰기 버튼 활성, 비활성화 #211
rmdnps10 Apr 18, 2024
47595b0
Fix: 마인더 정보에서 consultStyle null 일떄 기본으로 뜨는 프로필을 4번 캐릭터로 표시함
rmdnps10 Apr 18, 2024
b1617e9
Fix: 상담사 결제내역 리스트에서 토글 리스트 상단에 항상 고정하고 CardList에 height 값 부여하여 스크롤 컨테…
rmdnps10 Apr 18, 2024
f7dba3a
Merge pull request #229 from sharemindteam/hotfix/fixed-api
kyuhho Apr 18, 2024
1df205c
Style: Divder2 makrup #229
rmdnps10 Apr 18, 2024
90cf37a
Feat: 찜 목록 페이지 api 연동 및 무한스크롤 구현 완료 #228
rmdnps10 Apr 18, 2024
1419d58
Fix: 셰어 홈화면 들준마, 진중상 바로가기 토글 버튼 스타일에 통일성 부여
rmdnps10 Apr 18, 2024
07a82dc
Fix: 검색 페이지 input 스타일 리팩토링
rmdnps10 Apr 18, 2024
7600c19
Fix: revised api url reflection 228
rmdnps10 Apr 18, 2024
1915ae7
Feat: 검색 페이지 api 연동 및 여러 필터링에 따른 뷰 구현 #228
rmdnps10 Apr 18, 2024
93f467d
Fix: add input component in loading ui #228
rmdnps10 Apr 18, 2024
14ee167
Feat: 검색 필터링 조건 및 검색어 쿼리 스트링 값으로 반영하여 검색 결과 유지, useSearchPageParams 구…
rmdnps10 Apr 19, 2024
5b1a615
feat: add checking stompClient connected logic when subscribe (#230)
kyuhho Apr 20, 2024
7d6ae2e
feat: add exception stompClient connection error (#230)
kyuhho Apr 20, 2024
533aefd
feat: add chat start request time constants (#230)
kyuhho Apr 20, 2024
dcec01b
feat: apply chat time constant (#230)
kyuhho Apr 20, 2024
29f0b5b
feat: remove isConnected in consult in progress
kyuhho Apr 20, 2024
1a71c74
feat: apply stompClient connected in consult chat (#230)
kyuhho Apr 20, 2024
369eff3
feat: apply stompClient connected in consult tab (#230)
kyuhho Apr 20, 2024
26c7188
chore: fix exception on `useEffect` to avoid wrong unread count (#230)
kyuhho Apr 20, 2024
ecdf564
feat: fix navigate backspace (#208)
kyuhho Apr 20, 2024
22076bc
Chore: Add comments to variables and functions and remove unused impo…
rmdnps10 Apr 20, 2024
d3df242
Feat: Changed the previous search value storage method from recoil to…
rmdnps10 Apr 20, 2024
5749bef
Merge pull request #235 from sharemindteam/hotfix/service_backspace_208
rmdnps10 Apr 20, 2024
d68b37c
Hotfix: 백엔드 응답이 보이지 않은 이슈로 인하여 임시적으로 response status에 대한 처리 없이 공개상담 작…
rmdnps10 Apr 20, 2024
efb4ea7
Merge pull request #234 from sharemindteam/hotfix/rerender_chat_disco…
kyuhho Apr 21, 2024
707b28a
Fix: api 인스턴스 부분 수정하여 공개상담 작성 시 api response status에 따른 예외처리 구현 #236
rmdnps10 Apr 21, 2024
061eec0
Fix: sort modal props error 해결, 들준마와 카테고리 페이지에서 쿼리스트링으로 필터링 구현 #233
rmdnps10 Apr 21, 2024
228503e
Chore: delete useless import and styled-components error message #228
rmdnps10 Apr 21, 2024
5b045b2
Feat: Fix the options tab in the buyer and counselor side consultatio…
rmdnps10 Apr 21, 2024
b3802b0
Feat: 마인더 수익 관리 페이지 페이지 스타일 수정 및 무한 스크롤 구현
rmdnps10 Apr 21, 2024
28571c6
Feat: 들준마 헤더에서 navigate하는 경로를 -1에서 홈화면으로 지정 #228
rmdnps10 Apr 21, 2024
88a3a90
Feat: 상담사 카테고리 페이지의 쿼리 파라미터 구분을 통하여 뒤로가기 눌렀을 때 이동하는 페이지를 홈 화면과 검색 페이지…
rmdnps10 Apr 21, 2024
6756ff6
Merge pull request #231 from sharemindteam/feature/search-revised
kyuhho Apr 21, 2024
949a1d8
Fix: 최근 검색어 클릭 시 쿼리 파라미터로써 keyword 추가하기 #237
rmdnps10 Apr 22, 2024
7209887
Fix: 마인더 프로필 편집 페이지 마인더 인증 통과하지 않을 경우 response status code를 404에서 403…
rmdnps10 Apr 22, 2024
5c3887e
Style: adjust common header searchIcon marginTop
rmdnps10 Apr 22, 2024
735ae43
Feat: 한 줄 소개와 경험 소개에서 , 문자 유효성 검사 통과하기
rmdnps10 Apr 22, 2024
c7477de
Fix: 마인더 받은 리뷰 뒤로가기 navigate 주소를 쿼리파라미터에 따라 이원화
rmdnps10 Apr 22, 2024
889736d
Merge pull request #238 from sharemindteam/hotfix/recent-search-query…
rmdnps10 Apr 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Router = () => {
<Route path="/paymentComplete" element={<BuyerPaymentComplete />} />
<Route path="/paymentFinish" element={<BuyerFinishPayment />} />
<Route path="/counselors" element={<BuyerAvailCounselor />} />
<Route path="/mypage" element={<BuyerMypage />} />
<Route path="/mypage" element={<BuyerMypage />} />
<Route path="/reviewManage" element={<BuyerReviewManage />} />
<Route path="/review" element={<BuyerWriteReview />} />
<Route path="/saved" element={<BuyerSavedCounselor />} />
Expand Down
8 changes: 8 additions & 0 deletions src/api/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export const getCounselorsComments = async (postId: any) =>
export const getCustomersComments = async (postId: any) =>
await getInstance(`/comments/customers/${postId}`);

export const getCounselorsIsWriteComments = async (postId: any) =>
await getInstance(`/comments/counselors/authentication/${postId}`);

// Post Controller
export const getOneOpenConsult = async (id: string | undefined) =>
await getInstance(`/posts/${id}`);
Expand All @@ -175,3 +178,8 @@ export const getCustomerIsWriter = async (postId: any) =>

export const getOpenConsultDraft = async (postId: any) =>
await getInstance(`/posts/drafts/${postId}`);

// Post Scrap Controller

export const getPostScraps = async (params: any) =>
getInstance(`/postScraps`, params);
21 changes: 17 additions & 4 deletions src/api/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,23 @@ export const patchApplyPayments = async (id: any) =>

//SearchWord Controller
//검색 결과 반환
export const patchSearchWordsResults = async (sortType: string, body: any) =>
await patchPublicInstance(`/searchWords/results?sortType=${sortType}`, body);
export const patchSearchWordsCounselorsResults = async (
sortType: string,
body: any,
) =>
await patchPublicInstance(
`/searchWords/results/counselors?sortType=${sortType}`,
body,
);

export const patchSearchWordsPostsResults = async (
sortType: string,
body: any,
) =>
await patchPublicInstance(
`/searchWords/results/posts?sortType=${sortType}`,
body,
);
//Wishlist Controlloer
//찜하기 추가
export const patchWishLists = async (counselorId: number) =>
Expand All @@ -80,6 +94,5 @@ export const patchAdoptComment = async (postId: any, commentId: string) =>
await patchInstance(`/comments/customers/${postId}?commentId=${commentId}`);

//Post Controller
export const patchOpenConsult = async (body: any) => {
export const patchOpenConsult = async (body: any) =>
await patchInstance(`/posts`, body);
};
2 changes: 1 addition & 1 deletion src/api/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const postWishLists = async (body: any) =>
// 일대다상담

// Comment Controller
export const postComment = async (body) =>
export const postComment = async (body: any) =>
await postInstance('/comments/counselors', body);

// CommentLike Controller
Expand Down
16 changes: 11 additions & 5 deletions src/components/Buyer/BuyerCategoryResult/CategoryResultHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ import { Grey1, Grey6, White } from 'styles/color';
import { Heading } from 'styles/font';
import { ReactComponent as Back } from 'assets/icons/icon-back.svg';
import { useNavigate } from 'react-router-dom';
import { useCallback, useMemo } from 'react';
interface ResultHeaderProps {
categoryType: string;
}
export const CategoryResultHeader = ({ categoryType }: ResultHeaderProps) => {
const url = new URL(window.location.href);
const params = useMemo(() => new URLSearchParams(url.search), [url.search]);
const navigate = useNavigate();
const handleClickBackIcon = useCallback(() => {
if (params.has('from', 'search')) {
navigate('/search');
} else {
navigate('/share');
}
}, [navigate, params]);
return (
<Wrapper>
<BackIcon
onClick={() => {
navigate(-1);
}}
/>
<BackIcon onClick={handleClickBackIcon} />
<Heading color={Grey1}>{categoryType}</Heading>
</Wrapper>
);
Expand Down
34 changes: 19 additions & 15 deletions src/components/Buyer/BuyerConsult/BuyerConsultChatSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { LoadingSpinner } from 'utils/LoadingSpinner';
import { Heading } from 'styles/font';
import { ReactComponent as Empty } from 'assets/icons/graphic-noting.svg';
import { convertChatListDate } from 'utils/convertDate';
import { Space } from 'components/Common/Space';

//
//
Expand Down Expand Up @@ -37,7 +38,7 @@ export const BuyerConsultChatSection = ({
* https://stackoverflow.com/questions/73896315/rxjs-subscribe-callback-doesnt-have-access-to-current-react-state-functional-c
*/
const cardDataRef = useRef<consultApiObject[]>([]);
const { stompClient, isConnected } = useStompContext();
const { stompClient } = useStompContext();

/**
* 채팅 readId, 가장 최근 unread message, 정렬 업데이트
Expand Down Expand Up @@ -84,6 +85,7 @@ export const BuyerConsultChatSection = ({
unreadMessageCount: 0,
reviewCompleted: null,
consultId: null,
consultCategory: '',
};
//add roomIds for unsubscribe
roomIdsRef.current.unshift(notification.chatId);
Expand All @@ -94,12 +96,12 @@ export const BuyerConsultChatSection = ({
};

useEffect(() => {
if (!isConnected) {
if (!stompClient.current?.connected) {
return;
}

const sendConnectRequest = () => {
if (stompClient.current) {
if (stompClient.current && stompClient.current.connected) {
stompClient.current.send(
'/app/api/v1/chat/customers/connect',
{},
Expand Down Expand Up @@ -181,19 +183,21 @@ export const BuyerConsultChatSection = ({
//

return () => {
roomIdsRef.current.forEach((value) => {
stompClient.current?.unsubscribe(
'/queue/chatMessages/customers/' + value,
);
});
if (userIdRef.current !== -1) {
stompClient.current?.unsubscribe(
'/queue/chattings/notifications/customers/' + userIdRef.current,
);
if (stompClient.current?.connected) {
roomIdsRef.current.forEach((value) => {
stompClient.current?.unsubscribe(
'/queue/chatMessages/customers/' + value,
);
});
if (userIdRef.current !== -1) {
stompClient.current?.unsubscribe(
'/queue/chattings/notifications/customers/' + userIdRef.current,
);
}
stompClient.current?.unsubscribe('/queue/chattings/connect/customers/');
}
stompClient.current?.unsubscribe('/queue/chattings/connect/customers/');
};
}, [stompClient, isConnected]);
}, [stompClient, stompClient.current?.connected]);

useLayoutEffect(() => {
const fetchData = async () => {
Expand Down Expand Up @@ -261,6 +265,7 @@ export const BuyerConsultChatSection = ({
/>
);
})}
<Space height="4rem" />
</BuyerConsultChatSectionWrapper>
);
} else {
Expand All @@ -279,7 +284,6 @@ const BuyerConsultChatSectionWrapper = styled.section`
flex-direction: column;
gap: 0.8rem;
align-items: center;
padding: 1.2rem 0;
`;
const EmptyWrapper = styled.div`
margin-top: 10vh;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getLettersCustomers } from 'api/get';
import { LoadingSpinner } from 'utils/LoadingSpinner';
import { ReactComponent as Empty } from 'assets/icons/graphic-noting.svg';
import { Heading } from 'styles/font';
import { Space } from 'components/Common/Space';

interface BuyerConsultLetterSectionProps {
sortType: number;
Expand Down Expand Up @@ -71,6 +72,7 @@ export const BuyerConsultLetterSection = ({
{cardData.map((value) => {
return (
<ConsultCard
key={value.id}
consultStyle={value.consultStyle}
id={value.id}
latestMessageContent={value.latestMessageContent}
Expand All @@ -85,6 +87,7 @@ export const BuyerConsultLetterSection = ({
/>
);
})}
<Space height="4rem" />
</BuyerConsultLetterSectionWrapper>
) : (
<EmptyWrapper>
Expand All @@ -102,7 +105,6 @@ const BuyerConsultLetterSectionWrapper = styled.section`
flex-direction: column;
gap: 0.8rem;
align-items: center;
padding: 1.2rem 0;
`;

const EmptyIcon = styled(Empty)`
Expand Down
18 changes: 6 additions & 12 deletions src/components/Buyer/BuyerConsult/BuyerOpenConsultSection.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useLayoutEffect, useRef, useState } from 'react';
import { useRecoilState } from 'recoil';
import styled from 'styled-components';
import { Green, Grey1, Grey2, Grey3, Grey6 } from 'styles/color';
import { Grey1, Grey2, Grey3, Grey6 } from 'styles/color';
import { Body1, Body3, Caption1, Heading } from 'styles/font';
import { LoadingSpinner } from 'utils/LoadingSpinner';
import { isBuyPopupOpenState, isConsultModalOpenState } from 'utils/atom';
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';
Expand Down Expand Up @@ -83,7 +83,7 @@ function BuyerOpenConsultSection({ isChecked }: BuyerOpenConsultSectionProps) {
{isLoading ? (
<div
style={{
height: 'calc(100vh - 46rem)',
height: 'calc(70vh)',
display: 'flex',
alignItems: 'center',
}}
Expand Down Expand Up @@ -167,6 +167,8 @@ function BuyerOpenConsultSection({ isChecked }: BuyerOpenConsultSectionProps) {
})
)}
{/* 상담카드 부분 */}
{/* 마지막 요소가 가려지지 않도록 마진 영역을 추가 */}
<Space height="4rem" />
</BuyerOpenConsultCardList>
)}
{!isLastElem ? (
Expand Down Expand Up @@ -196,7 +198,7 @@ function BuyerOpenConsultSection({ isChecked }: BuyerOpenConsultSectionProps) {

const BuyerOpenConsultCardList = styled.div`
display: flex;
margin: 1.2rem 2rem;
margin: 0 2rem;
flex-direction: column;
align-items: flex-start;
gap: 1.2rem;
Expand Down Expand Up @@ -279,14 +281,6 @@ const TimeLeft = styled.div`
right: 1.6rem;
`;

const CreateConsultButton = styled.button`
width: 5.8rem;
height: 5.8rem;
border-radius: 100%;
background-color: ${Green};
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.25);
align-self: flex-end;
`;
const CreateConsultButtonWrapper = styled.div`
width: 100%;
padding: 0 2rem;
Expand Down
18 changes: 9 additions & 9 deletions src/components/Buyer/BuyerHome/HomeConsultInProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useStompContext } from 'contexts/StompContext';
import { convertChatListDate } from 'utils/convertDate';
interface ConsultItem {
id: number;
consultStyle: string;
consultStyle: string;
status: string;
opponentNickname: string;
latestMessageUpdatedAt: string;
Expand All @@ -25,7 +25,7 @@ interface ConsultItem {
export const HomeConsultInProgress = () => {
const navigate = useNavigate();

const { stompClient, isConnected } = useStompContext();
const { stompClient } = useStompContext();

const [consultCard, setConsultCard] = useState<ConsultItem>();
const [totalOngoing, setTotalOngoing] = useState<number>();
Expand All @@ -39,7 +39,7 @@ export const HomeConsultInProgress = () => {
*
*/
const connectConsultInProgress = (id: number) => {
if (stompClient.current && isConnected && isLogined) {
if (stompClient.current && stompClient.current?.connected && isLogined) {
stompClient.current.subscribe(
'/queue/chatMessages/customers/' + id,
(message) => {
Expand Down Expand Up @@ -85,13 +85,13 @@ export const HomeConsultInProgress = () => {
fetchData();

return () => {
if (stompClient.current && isConnected && isLogined) {
if (stompClient.current && stompClient.current?.connected && isLogined) {
stompClient.current?.unsubscribe(
'/queue/chatMessages/customers/' + currentChatIdRef.current,
);
}
};
}, [stompClient, isConnected, isLogined]);
}, [stompClient, stompClient.current?.connected, isLogined]);

if (!isLogined || !totalOngoing || !consultCard) {
return <></>;
Expand Down Expand Up @@ -145,10 +145,11 @@ const Wrapper = styled.div`
.nav-consult {
display: flex;
width: 100%;
height: 4.4rem;
box-sizing: border-box;
padding: 2.2rem 3.2rem 1.2rem 2rem;
justify-content: space-between;
align-items: center;
justify-content: space-between;
cursor: pointer;
margin-bottom: 0.4rem;
}
Expand All @@ -157,7 +158,6 @@ const NavConsult = styled.div`
display: flex;
align-items: center;
gap: 0.8rem;
margin: 0px auto 0px 0px
`;
const MoreIcon = styled(More)`
margin: 0px auto 0px 0px;
`;
const MoreIcon = styled(More)``;
11 changes: 5 additions & 6 deletions src/components/Buyer/BuyerHome/HomeConsultInReady.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const Wrapper = styled.div`
width: 100%;
height: 4.4rem;
display: flex;
box-sizing: border-box;
align-items: center;
justify-content: space-between;
padding: 2.2rem 3.2rem 1.2rem 2rem;
cursor: pointer;
margin-bottom: 0.4rem;
}
Expand All @@ -73,10 +76,6 @@ const NavConsult = styled.div`
display: flex;
align-items: center;
gap: 0.8rem;
margin-top: 0.9rem;
margin-left: 2rem;
`;
const MoreIcon = styled(More)`
margin-right: 3.8rem;
margin-top: 1.5rem;
margin: 0px auto 0px 0px;
`;
const MoreIcon = styled(More)``;
3 changes: 2 additions & 1 deletion src/components/Buyer/BuyerOpenConsult/HotOpenConsultList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import { ReactComponent as FireIcon } from 'assets/icons/icon-fire.svg';
import { Body3, Body4 } from 'styles/font';
import { Body4 } from 'styles/font';
import { Grey6 } from 'styles/color';
import { getCustomerPopularConsultList } from 'api/get';
import { useNavigate } from 'react-router-dom';
Expand All @@ -26,6 +26,7 @@ function HotOpenConsultList() {
</FireIconWrapper>
{hotConsultList.map((item) => (
<HotTitleItem
key={item.postId}
onClick={() => {
navigate(`/open-consult/${item.postId}`);
}}
Expand Down
Loading
Loading