Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 35 additions & 4 deletions public/assets/label_activity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 35 additions & 18 deletions src/components/Common/CardFindMaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ interface CardFindMakerProps {
isFollowed?: boolean;
serviceTypes: ServiceType[];
}

const serviceTypeOrder: ServiceType[] = [
"SHOPPING",
"FOOD_TOUR",
"ACTIVITY",
"CULTURE",
"FESTIVAL",
"RELAXATION",
"REQUEST",
"PENDING",
"CONFIRMED",
];

const CardFindMaker = ({
labelSize,
cardSize,
Expand Down Expand Up @@ -86,6 +99,11 @@ const CardFindMaker = ({
};
}, []);


const sortedServiceTypes = [...serviceTypes].sort(
(a, b) => serviceTypeOrder.indexOf(a) - serviceTypeOrder.indexOf(b)
);

return (
<div
ref={cardRef}
Expand All @@ -94,24 +112,23 @@ const CardFindMaker = ({
`}
>
<div className="flex mb-2 gap-4">

{(serviceTypes || []).slice(0, cardWidth < 467 ? 2 : (cardWidth< 650 ? 3 : (cardWidth < 756 ? 4 : (cardWidth < 840 ? 5 : serviceTypes.length)))).map((type, index) => (
<Label
key={`${type}-${index}`}
labelType={type}
labelSize={labelSize}
customLabelContainerClass={customLabelContainerClass}
customLabelTextClass={customLabelTextClass}
/>
))}
{serviceTypes.length > (cardWidth < 467 ? 2 : (cardWidth < 650 ? 3 : (cardWidth < 756 ? 4 : (cardWidth < 840 ? 5 : serviceTypes.length)))) && (
<Image
src={moreIcon}
alt="더 있음"
width={24}
height={24}
/>
)}
{sortedServiceTypes.slice(0, cardWidth < 467 ? 2 : (cardWidth < 650 ? 3 : (cardWidth < 778 ? 4 : (cardWidth < 840 ? 5 : sortedServiceTypes.length)))).map((type, index) => (
<Label
key={`${type}-${index}`}
labelType={type}
labelSize={labelSize}
customLabelContainerClass={customLabelContainerClass}
customLabelTextClass={customLabelTextClass}
/>
))}
{sortedServiceTypes.length > (cardWidth < 467 ? 2 : (cardWidth < 650 ? 3 : (cardWidth < 778 ? 4 : (cardWidth < 840 ? 5 : sortedServiceTypes.length)))) && (
<Image
src={moreIcon}
alt="더 있음"
width={24}
height={24}
/>
)}
</div>

<h2 className={`mb-4 text-2xl semibold text-color-black-300 ${titleSize} ${cardSize === 'sm' ? 'text-md !mb-1' : ''} mobile-tablet:text-sm`}>
Expand Down
44 changes: 22 additions & 22 deletions src/components/Common/DreamerFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ import Image from "next/image";
import downBlue from "@public/assets/dropdown_down_blue.svg";
import downGray from "@public/assets/dropdown_down_gray.svg";

const placeholder = "지역";
const items = ["전체", "서울", "경기", "인천", "강원", "충북", "충남", "세종", "대전", "전북"];
const placeholder2 = "서비스";
const items2 = [
"전체",
"기념품/쇼핑형",
"맛집 탐방형",
"액티비티/탐험형",
"문화/역사탐방형",
"축제참여형",
"휴양형",
];
const placeholder = '지역';
const items = ['전체', '서울', '부산', '인천', '대구', '대전', '광주', '울산', '세종', '경기', '강원', '충북', '충남', '전북', '전남', '경북', '경남', '제주'];
const placeholder2 = '서비스';
const items2 = ['전체', '기념품/쇼핑형', '맛집 탐방형', '액티비티/탐험형', '문화/역사탐방형', '축제참여형', '휴양형'];

const serviceTypeMapping: Record<string, string> = {
전체: "",
Expand All @@ -27,16 +19,24 @@ const serviceTypeMapping: Record<string, string> = {
};

const areaMapping: Record<string, string> = {
전체: "",
서울: "SEOUL",
경기: "GYEONGGI",
인천: "INCHEON",
강원: "GANGWON",
충북: "CHUNGBUK",
충남: "CHUNGNAM",
세종: "SEJONG",
대전: "DAEJEON",
전북: "JEONBUK",
'전체': '',
'서울': 'SEOUL',
'부산': 'BUSAN',
'인천': 'INCHEON',
'대구': 'DAEGU',
'대전': 'DAEJEON',
'광주': 'GWANGJU',
'울산': 'ULSAN',
'세종': 'SEJONG',
'경기': 'GYEONGGI',
'강원': 'GANGWON',
'충북': 'CHUNGBUK',
'충남': 'CHUNGNAM',
'전북': 'JEONBUK',
'전남': 'JEONNAM',
'경북': 'GYEONGBUK',
'경남': 'GYEONGNAM',
'제주': 'JEJU',
};

interface DreamerFilterProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/DropdownSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const DropdownSort = ({ onSort }: DropdownSortProps) => {
/>
</button>
{isOpen && (
<div className="w-[114px] h-[120px] rounded-[8px] border border-color-line-100 absolute top-full z-50 shadow-sm overflow-y-scroll transition-all duration-300 ease-in-out bg-white
<div className="w-[114px] h-[120px] rounded-[8px] border border-color-line-100 absolute top-full z-50 shadow-sm transition-all duration-300 ease-in-out bg-white
mobile-tablet:w-[91px] mobile-tablet:h-[95px]
">
<div className="flex flex-col w-full">
Expand Down
30 changes: 24 additions & 6 deletions src/pages/finding-maker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,19 @@ export default function FindingMaker() {
}
};

if (isLoggedIn) {
fetchFollowedItems();
}
const handleResize = () => {
const isComponentVisible = window.innerWidth > 746;
if (isLoggedIn && isComponentVisible) {
fetchFollowedItems();
}
};

window.addEventListener('resize', handleResize);
handleResize();

return () => {
window.removeEventListener('resize', handleResize);
};
}, [isLoggedIn]);

return (
Expand All @@ -126,6 +136,14 @@ export default function FindingMaker() {
padding: 0 72px;
}
}
@media (max-width: 374px) {
.main-container {
padding: 0 5px;
}
.hide-on-374 {
display: none;
}
}
.flash {
animation: flash-animation 0.3s ease-in-out;
}
Expand Down Expand Up @@ -194,17 +212,17 @@ export default function FindingMaker() {
</div>
<div className="w-3/4 flex flex-col gap-[32px] mobile-tablet:w-full mobile:mx-[auto] mobile:w-[327px] tablet:mx-[auto] tablet:w-[600px] tablet:px-[10px] tablet:py-[12px]">
<div className="gap-6">
<div className="pc:ml-auto pc:flex pc:justify-between mobile-tablet:flex mobile-tablet:justify-between">
<div className="pc:ml-auto pc:flex pc:justify-between mobile-tablet:flex mobile-tablet:justify-between ">
<div className="pc:hidden mobile-tablet:flex mobile-tablet:gap-4">
<DreamerFilter type="service" reset={resetFilters} onSelect={handleServiceTypeChange} />
<DreamerFilter type="location" reset={resetFilters} onSelect={handleServiceAreaChange} />
</div>
<div className="pc:ml-auto">
<div className="pc:ml-auto hide-on-374">
<DropdownSort onSort={handleOrderByChange} />
</div>
</div>
<SearchBar
placeholder="텍스트를 입력해 주세요."
placeholder="타이틀 검색 & maker 검색"
className="w-full mobile-tablet:w-full"
value={searchValue}
onChange={handleSearchChange}
Expand Down