Skip to content

Commit

Permalink
Merge pull request #45 from team-Ollie/main
Browse files Browse the repository at this point in the history
[deploy] main -> deploy
  • Loading branch information
leejin-rho authored Jul 2, 2024
2 parents 4c49cea + cd26e9f commit 553a3fa
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 38 deletions.
4 changes: 2 additions & 2 deletions apis/hooks/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const useGetMonthCalendar = () => {
};

const useGetProgramDetail = (programIdx: number) => {
const { data } = useQuery({
const { data, isLoading } = useQuery({
queryKey: ["getProgramDetail"],
queryFn: () => getProgramDetail(programIdx),
});
return { data };
return { data, isLoading };
};

export { useGetMonthCalendar, useGetProgramDetail };
79 changes: 44 additions & 35 deletions components/calendar/CalendarModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,56 @@ const CalendarModal = ({
programIdx: number;
toggleModal: () => void;
}) => {
const { data }: { data: GetProgramDetailBody } =
useGetProgramDetail(programIdx);
const { data, isLoading } = useGetProgramDetail(programIdx);

if (isLoading) {
return <div>Loading...</div>;
}

return (
<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} />
)}
data && (
<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="기간">
{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}
/>
<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>
</div>
)
);
};

Expand Down
1 change: 0 additions & 1 deletion pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const Login: NextPage = () => {
mutationKey: ["SignIn"],
mutationFn: SignIn,
onSuccess: async (data) => {
console.log(data);
const accessToken = data.result.accessToken;
const refreshToken = data.result.refreshToken;
const isAdmin = data.result.isAdmin;
Expand Down

0 comments on commit 553a3fa

Please sign in to comment.