|
1 | 1 | import { useState } from "react"; |
2 | 2 |
|
| 3 | +import FilterBottomSheet from "../components/FilterBottomSheet"; |
3 | 4 | import WeeklyCalendar from "../components/WeeklyCalendar"; |
4 | 5 | import MonthlyCalendar from "../components/MonthlyCalendar"; |
5 | 6 | import CampaignCard from "../components/CampaignCard"; |
6 | 7 | import SectionTitle from "../components/SectionTitle"; |
| 8 | +import MatchingCard from "../components/MatchingCard"; |
| 9 | +import MatchingTabSection from "../components/MatchingTabSection"; |
| 10 | +import dropdownIcon from "../../../../assets/arrow-down.svg"; |
| 11 | +import EmptyState from "../components/EmptyState"; |
7 | 12 |
|
8 | 13 | export default function CalendarContent() { |
9 | | - const [mainTab, setMainTab] = |
10 | | - useState<"collaboration" | "matching">("collaboration"); |
11 | | - const [activeTab, setActiveTab] = |
12 | | - useState<"thisMonth" | "today">("thisMonth"); |
| 14 | + const [mainTab, setMainTab] = useState<"collaboration" | "matching">("collaboration"); |
| 15 | + const [activeTab, setActiveTab] = useState<"thisMonth" | "today">("thisMonth"); |
| 16 | + const [matchingSubTab, setMatchingSubTab] = useState<"sent" | "received">("sent"); |
| 17 | + const [isFilterOpen, setIsFilterOpen] = useState(false); |
| 18 | + const [activeFilter, setActiveFilter] = useState("전체"); |
| 19 | + |
| 20 | + const hasData = matchingSubTab === "sent"; |
13 | 21 |
|
14 | 22 | return ( |
15 | 23 | <div className="flex flex-col w-full min-h-screen bg-bluegray-1"> |
16 | | - {/* 1. 상단 협업/매칭 현황 탭 */} |
17 | | - <div className="flex w-full bg-[var(--color-bg-w)] border-b border-[var(--color-text-gray5)]"> |
| 24 | + {/* 탭 네비게이션 */} |
| 25 | + <div className="flex w-full bg-bg-w border-b border-text-gray5"> |
18 | 26 | <button |
19 | 27 | onClick={() => setMainTab("collaboration")} |
20 | | - className={`flex-1 py-4 text-[16px] font-bold relative transition-colors |
21 | | - ${ |
22 | | - mainTab === "collaboration" |
23 | | - ? "text-[var(--color-core-1)]" |
24 | | - : "text-[var(--color-text-gray3)]" |
| 28 | + className={`flex-1 py-4 text-[16px] font-bold relative transition-colors ${mainTab === "collaboration" ? "text-core-1" : "text-text-gray3" |
25 | 29 | }`} |
26 | 30 | > |
27 | 31 | 협업 현황 |
28 | 32 | {mainTab === "collaboration" && ( |
29 | | - <div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-[120px] h-[2px] bg-[var(--color-core-1)]" /> |
| 33 | + <div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-[120px] h-[2px] bg-core-1" /> |
30 | 34 | )} |
31 | 35 | </button> |
32 | | - |
33 | 36 | <button |
34 | 37 | onClick={() => setMainTab("matching")} |
35 | | - className={`flex-1 py-4 text-[16px] font-bold relative transition-colors |
36 | | - ${ |
37 | | - mainTab === "matching" |
38 | | - ? "text-[var(--color-core-1)]" |
39 | | - : "text-[var(--color-text-gray3)]" |
| 38 | + className={`flex-1 py-4 text-[16px] font-bold relative transition-colors ${mainTab === "matching" ? "text-core-1" : "text-text-gray3" |
40 | 39 | }`} |
41 | 40 | > |
42 | 41 | 매칭 현황 |
43 | 42 | {mainTab === "matching" && ( |
44 | | - <div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-[120px] h-[2px] bg-[var(--color-core-1)]" /> |
| 43 | + <div className="absolute bottom-0 left-1/2 -translate-x-1/2 w-[120px] h-[2px] bg-core-1" /> |
45 | 44 | )} |
46 | 45 | </button> |
47 | 46 | </div> |
48 | 47 |
|
49 | | - <main className="flex flex-col gap-6 px-4 py-6"> |
50 | | - {/* 진행 중인 협업 섹션 */} |
51 | | - <section className="flex flex-col gap-3"> |
52 | | - <SectionTitle title="진행 중인 협업" /> |
53 | | - <p className="text-title1 font-bold text-text-black"> |
54 | | - 이번주 일정 |
55 | | - </p> |
56 | | - <WeeklyCalendar /> |
57 | | - </section> |
58 | | - |
59 | | - {/* 이번달 일정 섹션 */} |
60 | | - <section className="flex flex-col gap-3"> |
61 | | - <p className="text-title1 font-bold text-text-black"> |
62 | | - 이번달 일정 |
63 | | - </p> |
64 | | - <MonthlyCalendar /> |
65 | | - </section> |
66 | | - |
67 | | - {/* 협업 리스트 섹션 */} |
68 | | - <section className="flex flex-col gap-4"> |
69 | | - <div className="flex items-center gap-2"> |
70 | | - <button |
71 | | - onClick={() => setActiveTab("thisMonth")} |
72 | | - className={`text-[14px] font-semibold |
73 | | - ${ |
74 | | - activeTab === "thisMonth" |
75 | | - ? "text-[var(--color-core-1)]" |
76 | | - : "text-[var(--color-text-gray3)]" |
77 | | - }`} |
78 | | - > |
79 | | - 이번달 |
80 | | - </button> |
81 | | - |
82 | | - <span className="text-[14px] text-[var(--color-text-gray3)]">|</span> |
83 | | - |
84 | | - <button |
85 | | - onClick={() => setActiveTab("today")} |
86 | | - className={`text-[14px] font-semibold |
87 | | - ${ |
88 | | - activeTab === "today" |
89 | | - ? "text-[var(--color-core-1)]" |
90 | | - : "text-[var(--color-text-gray3)]" |
91 | | - }`} |
92 | | - > |
93 | | - 오늘 |
94 | | - </button> |
| 48 | + <main className="flex flex-col flex-1"> |
| 49 | + {mainTab === "collaboration" ? ( |
| 50 | + /* [A] 협업 현황 */ |
| 51 | + <div className="flex flex-col gap-6 px-4 py-6"> |
| 52 | + <section className="flex flex-col gap-3"> |
| 53 | + <SectionTitle title="진행 중인 협업" /> |
| 54 | + <p className="text-title1 font-bold text-text-black">이번주 일정</p> |
| 55 | + <WeeklyCalendar /> |
| 56 | + </section> |
| 57 | + <section className="flex flex-col gap-3"> |
| 58 | + <p className="text-title1 font-bold text-text-black">이번달 일정</p> |
| 59 | + <MonthlyCalendar /> |
| 60 | + </section> |
| 61 | + <section className="flex flex-col gap-4"> |
| 62 | + <div className="flex items-center gap-2"> |
| 63 | + <button |
| 64 | + onClick={() => setActiveTab("thisMonth")} |
| 65 | + className={`text-[14px] font-semibold ${activeTab === "thisMonth" ? "text-core-1" : "text-text-gray3"}`} |
| 66 | + > |
| 67 | + 이번달 |
| 68 | + </button> |
| 69 | + <span className="text-[14px] text-text-gray3">|</span> |
| 70 | + <button |
| 71 | + onClick={() => setActiveTab("today")} |
| 72 | + className={`text-[14px] font-semibold ${activeTab === "today" ? "text-core-1" : "text-text-gray3"}`} |
| 73 | + > |
| 74 | + 오늘 |
| 75 | + </button> |
| 76 | + </div> |
| 77 | + <div className="flex flex-col gap-4"> |
| 78 | + <CampaignCard brand="비플레인" title="비플레인 클렌징 및 세럼 리뷰" startDate="12.21" endDate="12.24" /> |
| 79 | + <CampaignCard brand="비플레인" title="비플레인 클렌징 및 세럼 리뷰" startDate="12.23" endDate="12.26" /> |
| 80 | + </div> |
| 81 | + </section> |
95 | 82 | </div> |
| 83 | + ) : ( |
| 84 | + /* [B] 매칭 현황 */ |
| 85 | + <div className="flex flex-col flex-1"> |
| 86 | + <MatchingTabSection subTab={matchingSubTab} setSubTab={setMatchingSubTab} /> |
96 | 87 |
|
97 | | - <div className="flex flex-col gap-4"> |
98 | | - <CampaignCard |
99 | | - brand="비플레인" |
100 | | - title="비플레인 클렌징 및 세럼 리뷰" |
101 | | - startDate="12.21" |
102 | | - endDate="12.24" |
103 | | - /> |
104 | | - <CampaignCard |
105 | | - brand="비플레인" |
106 | | - title="비플레인 클렌징 및 세럼 리뷰" |
107 | | - startDate="12.23" |
108 | | - endDate="12.26" |
109 | | - /> |
110 | | - <CampaignCard |
111 | | - brand="비플레인" |
112 | | - title="비플레인 클렌징 및 세럼 리뷰" |
113 | | - startDate="01.10" |
114 | | - endDate="01.15" |
| 88 | + {hasData ? ( |
| 89 | + <div className="flex flex-col gap-4 px-4 py-6 flex-1"> |
| 90 | + <div className="flex items-center justify-between mb-1"> |
| 91 | + <h2 className="text-title1 font-bold text-text-black">매칭 현황</h2> |
| 92 | + <button |
| 93 | + onClick={() => setIsFilterOpen(true)} |
| 94 | + className="flex items-center gap-1 px-3 py-1 border border-text-gray4 rounded-full bg-white active:bg-bluegray-2 transition-colors" |
| 95 | + > |
| 96 | + <span className="text-callout1 text-text-gray2">{activeFilter}</span> |
| 97 | + <img src={dropdownIcon} alt="open filter" /> |
| 98 | + </button> |
| 99 | + </div> |
| 100 | + <div className="flex flex-col gap-4"> |
| 101 | + <MatchingCard brand="라운드랩" status="매칭" date="12.23.25" actionLabel="제안 보기" /> |
| 102 | + <MatchingCard brand="비플레인" status="검토 중" date="12.23.25" actionLabel="제안 보기" /> |
| 103 | + <MatchingCard brand="땡큐파머" status="검토 중" date="12.23.25" actionLabel="제안 보기" /> |
| 104 | + <MatchingCard brand="이즈트리" status="거절" date="12.23.25" actionLabel="거절 사유 보기" /> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + ) : ( |
| 108 | + <div className="flex-1 flex flex-col items-center justify-center"> |
| 109 | + <EmptyState |
| 110 | + message={`${(matchingSubTab as string) === "sent" ? "보낸" : "받은"} 제안이 없어요`} |
| 111 | + /> |
| 112 | + </div> |
| 113 | + )} |
| 114 | + |
| 115 | + <FilterBottomSheet |
| 116 | + isOpen={isFilterOpen} |
| 117 | + onClose={() => setIsFilterOpen(false)} |
| 118 | + onApply={(filter) => setActiveFilter(filter)} |
| 119 | + currentFilter={activeFilter} |
115 | 120 | /> |
116 | 121 | </div> |
117 | | - </section> |
| 122 | + )} |
118 | 123 | </main> |
119 | 124 | </div> |
120 | 125 | ); |
|
0 commit comments