-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29 feat: calander Modal api & UI 구현
- Loading branch information
1 parent
b2ea71e
commit eb32533
Showing
6 changed files
with
138 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,85 @@ | ||
const CalendarModal = ({ filterName }) => { | ||
import { GetProgramDetailBody } from "@/apis/calendar"; | ||
import { useGetProgramDetail } from "@/apis/hooks/calendar"; | ||
import Close from "@/public/svgs/Close.svg"; | ||
|
||
const CalendarModal = ({ | ||
programIdx, | ||
toggleModal, | ||
}: { | ||
programIdx: number; | ||
toggleModal: () => {}; | ||
}) => { | ||
console.log(programIdx); | ||
const { data }: { data: GetProgramDetailBody } = | ||
useGetProgramDetail(programIdx); | ||
console.log(data); | ||
|
||
return ( | ||
<div className="w-fit h-[1.9rem] flex justify-center items-center bg-main-color rounded-3xl text-white py-[0.31rem] pl-[0.94rem] pr-[0.44rem] gap-0.5"> | ||
<div>{filterName}</div> | ||
<div | ||
className="w-screen h-full flex flex-col items-center justify-center fixed bg-[rgba(1,0,0,0.4)] z-10" | ||
key={programIdx} | ||
> | ||
<div className="flex flex-col relative items-center justify-center w-[80%] h-[60%] bg-white z-10 rounded-xl py-5 px-8 gap-3"> | ||
<Close className="absolute right-3 top-3" onClick={toggleModal} /> | ||
<div className="h0 text-main-color h-fit">{data.name}</div> | ||
<div className="flex flex-col mt-3 flex-grow h-full w-full gap-3 overflow-auto scrollbar-hide"> | ||
{data.locatedPlace && ( | ||
<TextLine title="위치" className="" children={data.locatedPlace} /> | ||
)} | ||
|
||
<TextLine title="기간"> | ||
{data.openDate.year}년 {data.openDate.month}월 {data.openDate.day}일 | ||
{" ~ "} | ||
{data.dueDate.year}년 {data.dueDate.month}월 {data.dueDate.day}일 | ||
</TextLine> | ||
|
||
<TextLine title="주관센터" className="" children={data.host} /> | ||
<TextLine | ||
title="활동 요일" | ||
className="" | ||
children={data.schedule} | ||
addExpFront="매주 " | ||
addExpBack="요일마다" | ||
/> | ||
{data.location && ( | ||
<TextLine title="지역" className="" children={data.location} /> | ||
)} | ||
<TextLine | ||
title="기타 사항" | ||
className="" | ||
children={data.description} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CalendarModal; | ||
|
||
interface TextProps { | ||
title?: string; | ||
className?: string; | ||
children?: React.ReactNode; | ||
addExpFront?: string; | ||
addExpBack?: string; | ||
} | ||
|
||
function TextLine({ | ||
title, | ||
className, | ||
children, | ||
addExpFront, | ||
addExpBack, | ||
}: TextProps) { | ||
return ( | ||
<div className="flex flex-col gap-1"> | ||
<div className="h3">{title}</div> | ||
<div className={`flex h4 ${className}`}> | ||
{addExpFront} | ||
{children} | ||
{addExpBack} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters