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

[Feature] 검색 페이지, 찜 목록 페이지 리뉴얼된 버전으로 업데이트 + 검색 필터링 쿼리파라미터로 추가하여 검색 결과 유지 #231

Merged
merged 18 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
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
d68b37c
Hotfix: 백엔드 응답이 보이지 않은 이슈로 인하여 임시적으로 response status에 대한 처리 없이 공개상담 작…
rmdnps10 Apr 20, 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
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
5 changes: 5 additions & 0 deletions src/api/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,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);
18 changes: 16 additions & 2 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 Down
3 changes: 2 additions & 1 deletion src/components/Buyer/BuyerHome/HomeConsultInProgress.tsx
Original file line number Diff line number Diff line change
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 Down
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)``;
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ export const SavedCounselorCard = ({
}}
>
<TagWrapper>
{tagList.map((value: any) => {
return <TagA2Cartegory tagType={value} bgColorType={1} />;
{tagList.map((value: any, index) => {
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
return (
<TagA2Cartegory tagType={value} bgColorType={1} key={index} />
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
);
})}
</TagWrapper>
<Body1 margin={'0.8rem 1.6rem 1.2rem 1.6rem'}>{introduction}</Body1>
Expand Down
111 changes: 111 additions & 0 deletions src/components/Buyer/BuyerSavedCounselor.tsx/SavedOpenConsultCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
import styled from 'styled-components';
import { Green, Grey1, Grey2, Grey3, Grey6 } from 'styles/color';
import { Body1, Caption1, Caption2 } from 'styles/font';
import { LoadingSpinner } from 'utils/LoadingSpinner';
import { ReactComponent as LockIcon } from 'assets/icons/icon-lock.svg';
import { ReactComponent as HeartIcon } from 'assets/icons/icon-heart2.svg';
import { ReactComponent as HeartEmptyIcon } from 'assets/icons/icon-heart3.svg';
import { ReactComponent as SaveIcon } from 'assets/icons/icon-save2.svg';
import { ReactComponent as SaveEmptyIcon } from 'assets/icons/icon-save3.svg';
import { ReactComponent as CommentIcon } from 'assets/icons/icon-comment.svg';
import { ReactComponent as CheckIcon } from 'assets/icons/icon-check2.svg';
import { ReactComponent as WriteIcon } from 'assets/icons/icon-write.svg';
import { Space } from 'components/Common/Space';
import { BackDrop } from 'components/Common/BackDrop';
import { openConsultApiObject } from 'pages/Buyer/BuyerConsult';
import { useNavigate } from 'react-router-dom';
import useIntersectionObserver from 'hooks/useIntersectionObserver';
interface SavedCounselorCardProps {
item: openConsultApiObject;
}
function SavedOpenConsultCard({ item }: SavedCounselorCardProps) {
const navigate = useNavigate();
return (
<Wrapper
onClick={() => {
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
navigate(`/open-consult/${item.postId}`);
}}
>
<div className="row1">
<Body1>{item.title}</Body1>
</div>
<Space height="1.2rem" />
<div className="row2">{item.content}</div>
<div className="row3">
<IconItem>
<HeartResizeIcon />
<Caption1 color={Grey2}>{item.totalLike}</Caption1>
</IconItem>
<IconItem>
<SaveIcon />
<Caption1 color={Grey2}>{item.totalScrap}</Caption1>
</IconItem>
<IconItem>
<CommentIcon />
<Caption1 color={Grey2}>{item.totalComment}</Caption1>
</IconItem>
</div>
<TimeLeft>{item.updatedAt}</TimeLeft>
</Wrapper>
);
}

const Wrapper = styled.div`
width: 89%;
height: 14rem;
cursor: pointer;
position: relative;
background-color: ${Grey6};
padding: 1.6rem;
box-sizing: border-box;
border-radius: 1.2rem;
.row1 {
width: calc(100% - 5rem);
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
max-height: 5rem;
overflow: hidden;
}
.row2 {
display: -webkit-box;
max-height: 4.7rem;
-webkit-box-orient: vertical;
overflow: hidden;
align-self: flex-end;
margin-bottom: 0.4rem;
-webkit-line-clamp: 2;
color: ${Grey1};
height: 4.6rem;
text-overflow: ellipsis;
font-family: Pretendard;
font-size: 1.4rem;
font-style: normal;
font-weight: 400;
line-height: 155%;
}
.row3 {
display: flex;
gap: 1.2rem;
}
`;
const HeartResizeIcon = styled(HeartIcon)`
width: 2rem;
height: 2rem;
`;
const IconItem = styled.div`
display: flex;
align-items: center;
gap: 0.5rem;
`;
const TimeLeft = styled.div`
font-size: 1.2rem;
font-weight: 400;
color: ${Grey2};
position: absolute;
bottom: 1.8rem;
right: 1.6rem;
`;

export default SavedOpenConsultCard;
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { openConsultApiObject } from 'pages/Buyer/BuyerConsult';
import React from 'react';
import styled from 'styled-components';
import SavedOpenConsultCard from './SavedOpenConsultCard';

interface SavedOpenConsultResultsProps {
openConsultList: openConsultApiObject[];
}
function SavedOpenConsultResults({
openConsultList,
}: SavedOpenConsultResultsProps) {
return (
<Wrapper>
{openConsultList.map((card) => (
<SavedOpenConsultCard item={card} />
))}
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
</Wrapper>
);
}

const Wrapper = styled.div`
display: flex;
flex-direction: column;
gap: 1.2rem;
align-items: center;
width: 100%;
`;
export default SavedOpenConsultResults;
13 changes: 6 additions & 7 deletions src/components/Buyer/BuyerSearch/SearchHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export const SearchHeader = () => {
placeHolderColor={Grey4}
height="4.4rem"
width="100%"
padding="0 3.2rem 0 0"
textIndent="1rem"
isBoxSizing={true}
padding="0.8rem 3.4rem 0.8rem 1.6rem"
/>
<SearchIcon onClick={handleSubmit} />
</FormWrapper>
Expand All @@ -50,26 +50,25 @@ export const SearchHeader = () => {
};
const Wrapper = styled.div`
height: 5.2rem;
gap: 0.8rem;
background-color: ${White};
position: relative;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 0.4rem 2rem;
`;
const BackIcon = styled(Back)`
position: absolute;
top: 1.4rem;
left: 2rem;
cursor: pointer;
`;
const FormWrapper = styled.form`
position: relative;
width: 79%;
width: 100%;
`;
const SearchIcon = styled(Search)`
position: absolute;
right: -2.7rem;
right: 0.8rem;
top: 0.8rem;
cursor: pointer;
`;
25 changes: 25 additions & 0 deletions src/components/Buyer/BuyerSearchResult/OpenConsultResults.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import styled from 'styled-components';
import { openConsultApiObject } from 'pages/Buyer/BuyerConsult';
import SavedOpenConsultCard from '../BuyerSavedCounselor.tsx/SavedOpenConsultCard';
interface OpenConsultResultProps {
openConsultList: openConsultApiObject[];
}
function OpenConsultResults({ openConsultList }: OpenConsultResultProps) {
return (
<Wrapper>
{openConsultList.map((item) => (
<SavedOpenConsultCard item={item} />
))}
rmdnps10 marked this conversation as resolved.
Show resolved Hide resolved
</Wrapper>
);
}

const Wrapper = styled.div`
display: flex;
flex-direction: column;
gap: 1.2rem;
align-items: center;
width: 100%;
`;
export default OpenConsultResults;
Loading
Loading