-
+
+
+
{`${current}`}
+
{`/ ${count}`}
+
diff --git a/src/entities/lecture/ui/IntroductionBanner/IntroductionBanner.tsx b/src/entities/lecture/ui/IntroductionBanner/IntroductionBanner.tsx
new file mode 100644
index 0000000..39fcf4a
--- /dev/null
+++ b/src/entities/lecture/ui/IntroductionBanner/IntroductionBanner.tsx
@@ -0,0 +1,36 @@
+import Link from "next/link";
+
+const IntroductionBanner = () => {
+ return (
+
+
+
+
+
+
+ 새로운 일상의
+
+
+ 반은 왔어요
+
+
+
+ 시작이 반이다!
+
+
+
+
+ );
+};
+
+export default IntroductionBanner;
diff --git a/src/entities/lecture/ui/IntroductionBanner/index.ts b/src/entities/lecture/ui/IntroductionBanner/index.ts
new file mode 100644
index 0000000..b55c4ed
--- /dev/null
+++ b/src/entities/lecture/ui/IntroductionBanner/index.ts
@@ -0,0 +1 @@
+export { default as IntroductionBanner } from "./IntroductionBanner";
diff --git a/src/entities/lecture/ui/LectureCard/HomeLectureCard/HomeLectureCard.tsx b/src/entities/lecture/ui/LectureCard/HomeLectureCard/HomeLectureCard.tsx
new file mode 100644
index 0000000..796bb75
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/HomeLectureCard/HomeLectureCard.tsx
@@ -0,0 +1,168 @@
+import { LectureInfo, PickLectureInfo } from "@/entities/lecture/model/lecture";
+import { MouseEvent, useEffect, useState } from "react";
+
+import { Button } from "@/shared/ui";
+import { HeartsLectureListResDataInfo } from "@/features/like/model/like";
+import Image from "next/image";
+import Link from "next/link";
+import { toast } from "sonner";
+import useDeleteLikeLecture from "@/features/like/api/useDeleteLikeLecture";
+import usePostLikeLecture from "@/features/like/api/usePostLikeLecture";
+
+interface HomeLectureCardProps {
+ lectureData: LectureInfo | PickLectureInfo | HeartsLectureListResDataInfo;
+ type: "homeLecture" | "pickLecture";
+}
+const HomeLectureCard = (props: HomeLectureCardProps) => {
+ const { lectureData, type } = props;
+
+ const {
+ id,
+ thumbnail,
+ name,
+ time,
+ target,
+ status,
+ address,
+ division,
+ link,
+ heart,
+ start_date,
+ end_date,
+ day_of_week,
+ } = lectureData;
+
+ const [dimensions, setDimensions] = useState({ width: 384, height: 280 });
+
+ const postLikeLecture = usePostLikeLecture(id);
+ const deleteLikeLecture = useDeleteLikeLecture(id);
+
+ useEffect(() => {
+ const handleResize = () => {
+ if (window.innerWidth < 768) {
+ setDimensions({ width: 240, height: 168 });
+ } else if (window.innerWidth < 1440) {
+ setDimensions({ width: 280, height: 188 });
+ } else {
+ setDimensions({ width: 384, height: 280 });
+ }
+ };
+
+ window.addEventListener("resize", handleResize);
+
+ // 초기 크기 설정
+ handleResize();
+
+ return () => {
+ window.removeEventListener("resize", handleResize);
+ };
+ }, []);
+
+ const handleLikeClick = (e: MouseEvent
) => {
+ e.stopPropagation();
+ e.preventDefault();
+
+ if (lectureData.heart === true) {
+ deleteLikeLecture.mutate(
+ {
+ lectureId: id,
+ },
+ {
+ onSuccess: () => {
+ toast("좋아요 삭제 성공");
+ },
+ },
+ );
+ }
+ if (lectureData.heart === false) {
+ postLikeLecture.mutate(
+ {
+ lectureId: id,
+ },
+ {
+ onSuccess: () => {
+ toast("좋아요 성공");
+ },
+ },
+ );
+ }
+ };
+
+ return (
+
+
+
+
+
+
+
{`문화`}
+
+
+
+
+
+
+
+ {/* FIXME: 색상 추가 */}
+
+ {address}
+
+
+ {start_date.replaceAll("-", ".").split(".")[1]}.
+ {start_date.replaceAll("-", ".").split(".")[2]}({day_of_week}){" "}
+ {/* TODO: time to 오전 오후 시간 */}
+ {Number(time.split(":")[0]) / 12 ? "오후" : "오전"}{" "}
+ {Number(time.split(":")[0]) % 12}:
+ {time.split(":")[1].slice(0, 2)}
+
+
+
+
+
+
+
+ );
+};
+
+export default HomeLectureCard;
diff --git a/src/entities/lecture/ui/LectureCard/HomeLectureCard/index.ts b/src/entities/lecture/ui/LectureCard/HomeLectureCard/index.ts
new file mode 100644
index 0000000..06254fe
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/HomeLectureCard/index.ts
@@ -0,0 +1 @@
+export { default as HomeLectureCard } from "./HomeLectureCard";
diff --git a/src/entities/lecture/ui/LectureCard/LectureCard.tsx b/src/entities/lecture/ui/LectureCard/LectureCard.tsx
index 18b9a0e..45f6b32 100755
--- a/src/entities/lecture/ui/LectureCard/LectureCard.tsx
+++ b/src/entities/lecture/ui/LectureCard/LectureCard.tsx
@@ -1,170 +1,19 @@
import { LectureInfo, PickLectureInfo } from "@/entities/lecture/model/lecture";
-import { Button } from "@/shared/ui";
import { HeartsLectureListResDataInfo } from "@/features/like/model/like";
-import Image from "next/image";
-import Link from "next/link";
-import { MouseEvent } from "react";
-import { toast } from "sonner";
-import useDeleteLikeLecture from "@/features/like/api/useDeleteLikeLecture";
-import usePostLikeLecture from "@/features/like/api/usePostLikeLecture";
+import { HomeLectureCard } from "./HomeLectureCard";
+import { PickLectureCard } from "./PickLectureCard";
interface LectureCardProps {
lectureData: LectureInfo | PickLectureInfo | HeartsLectureListResDataInfo;
- type: "row" | "col";
+ type: "homeLecture" | "pickLecture";
}
const LectureCard = ({ lectureData, type }: LectureCardProps) => {
- const {
- id,
- thumbnail,
- name,
- time,
- target,
- status,
- address,
- link,
- heart,
- start_date,
- end_date,
- day_of_week,
- } = lectureData;
-
- const postLikeLecture = usePostLikeLecture(id);
- const deleteLikeLecture = useDeleteLikeLecture(id);
-
- const handleLikeClick = (e: MouseEvent) => {
- e.stopPropagation();
- e.preventDefault();
-
- if (lectureData.heart === true) {
- deleteLikeLecture.mutate(
- {
- lectureId: id,
- },
- {
- onSuccess: () => {
- toast("좋아요 삭제 성공");
- },
- },
- );
- }
- if (lectureData.heart === false) {
- postLikeLecture.mutate(
- {
- lectureId: id,
- },
- {
- onSuccess: () => {
- toast("좋아요 성공");
- },
- },
- );
- }
- };
-
- return type === "col" ? (
-
-
-
-
-
-
-
-
-
-
-
- {target}
-
-
-
- [{name}]
-
-
-
-
-
-
- {/* FIXME: 색상 추가 */}
-
- {address}
-
-
- {time.split(" ")[0].replaceAll("-", ".")}
-
-
-
-
-
-
-
+ return type === "homeLecture" ? (
+
) : (
-
-
-
-
-
-
-
- {/* TODO: CHIP 컴포넌트 개발 필요 */}
-
- 문화
-
-
-
-
- {name}
-
-
- {target}
-
-
-
- {/* FIXME: 색상 추가 */}
-
- {address}
-
-
- {time.split(" ")[0].replaceAll("-", ".")}
-
-
-
-
-
+
);
};
diff --git a/src/entities/lecture/ui/LectureCard/PickLectureCard/PickLectureCard.tsx b/src/entities/lecture/ui/LectureCard/PickLectureCard/PickLectureCard.tsx
new file mode 100644
index 0000000..41de6bd
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/PickLectureCard/PickLectureCard.tsx
@@ -0,0 +1,168 @@
+import { LectureInfo, PickLectureInfo } from "@/entities/lecture/model/lecture";
+import { MouseEvent, useEffect, useState } from "react";
+
+import { Button } from "@/shared/ui";
+import { HeartsLectureListResDataInfo } from "@/features/like/model/like";
+import Image from "next/image";
+import Link from "next/link";
+import { toast } from "sonner";
+import useDeleteLikeLecture from "@/features/like/api/useDeleteLikeLecture";
+import usePostLikeLecture from "@/features/like/api/usePostLikeLecture";
+
+interface PickLectureCardProps {
+ lectureData: LectureInfo | PickLectureInfo | HeartsLectureListResDataInfo;
+ type: "homeLecture" | "pickLecture";
+}
+
+const PickLectureCard = (props: PickLectureCardProps) => {
+ const { lectureData, type } = props;
+
+ const {
+ id,
+ thumbnail,
+ name,
+ time,
+ target,
+ status,
+ address,
+ link,
+ heart,
+ start_date,
+ end_date,
+ day_of_week,
+ division,
+ } = lectureData;
+
+ const [dimensions, setDimensions] = useState({ width: 384, height: 280 });
+
+ const postLikeLecture = usePostLikeLecture(id);
+ const deleteLikeLecture = useDeleteLikeLecture(id);
+
+ useEffect(() => {
+ const handleResize = () => {
+ if (window.innerWidth < 768) {
+ setDimensions({ width: 312, height: 190 });
+ } else if (window.innerWidth < 1440) {
+ setDimensions({ width: 344, height: 256 });
+ } else {
+ setDimensions({ width: 384, height: 280 });
+ }
+ };
+
+ window.addEventListener("resize", handleResize);
+
+ // 초기 크기 설정
+ handleResize();
+
+ return () => {
+ window.removeEventListener("resize", handleResize);
+ };
+ }, []);
+
+ const handleLikeClick = (e: MouseEvent) => {
+ e.stopPropagation();
+ e.preventDefault();
+
+ if (lectureData.heart === true) {
+ deleteLikeLecture.mutate(
+ {
+ lectureId: id,
+ },
+ {
+ onSuccess: () => {
+ toast("좋아요 삭제 성공");
+ },
+ },
+ );
+ }
+ if (lectureData.heart === false) {
+ postLikeLecture.mutate(
+ {
+ lectureId: id,
+ },
+ {
+ onSuccess: () => {
+ toast("좋아요 성공");
+ },
+ },
+ );
+ }
+ };
+ return (
+
+
+
+
+
+
+
{`문화`}
+
+
+
+
+
+
+
+ {/* FIXME: 색상 추가 */}
+
+ {address}
+
+
+ {start_date.replaceAll("-", ".").split(".")[1]}.
+ {start_date.replaceAll("-", ".").split(".")[2]}({day_of_week}){" "}
+ {/* TODO: time to 오전 오후 시간 */}
+ {Number(time.split(":")[0]) / 12 ? "오후" : "오전"}{" "}
+ {Number(time.split(":")[0]) % 12}:
+ {time.split(":")[1].slice(0, 2)}
+
+
+
+
+
+
+
+ );
+};
+
+export default PickLectureCard;
diff --git a/src/entities/lecture/ui/LectureCard/PickLectureCard/index.ts b/src/entities/lecture/ui/LectureCard/PickLectureCard/index.ts
new file mode 100644
index 0000000..3ed864b
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/PickLectureCard/index.ts
@@ -0,0 +1 @@
+export { default as PickLectureCard } from "./PickLectureCard";
diff --git a/src/entities/lecture/ui/LectureCard/RowLectureCard/RowLectureCard.tsx b/src/entities/lecture/ui/LectureCard/RowLectureCard/RowLectureCard.tsx
new file mode 100644
index 0000000..a21ca60
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/RowLectureCard/RowLectureCard.tsx
@@ -0,0 +1,59 @@
+import { LectureInfo, PickLectureInfo } from "@/entities/lecture/model/lecture";
+
+import { HeartsLectureListResDataInfo } from "@/features/like/model/like";
+import Image from "next/image";
+import Link from "next/link";
+
+interface RowLectureCardProps {
+ lectureData: LectureInfo | PickLectureInfo | HeartsLectureListResDataInfo;
+ type: "homeLecture" | "pickLecture";
+}
+
+const RowLectureCard = (props: RowLectureCardProps) => {
+ const { lectureData, type } = props;
+
+ const { id, thumbnail, name, time, target, address } = lectureData;
+
+ return (
+
+
+
+
+
+
+
+ {/* TODO: CHIP 컴포넌트 개발 필요 */}
+
+ 문화
+
+
+
+
+ {name}
+
+
+ {target}
+
+
+
+ {/* FIXME: 색상 추가 */}
+
+ {address}
+
+
+ {time.split(" ")[0].replaceAll("-", ".")}
+
+
+
+
+
+ );
+};
+
+export default RowLectureCard;
diff --git a/src/entities/lecture/ui/LectureCard/RowLectureCard/index.ts b/src/entities/lecture/ui/LectureCard/RowLectureCard/index.ts
new file mode 100644
index 0000000..9bdf593
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCard/RowLectureCard/index.ts
@@ -0,0 +1 @@
+export { default as RowLectureCard } from "./RowLectureCard";
diff --git a/src/entities/lecture/ui/LectureCard/index.ts b/src/entities/lecture/ui/LectureCard/index.ts
index 0d54338..54a3f03 100755
--- a/src/entities/lecture/ui/LectureCard/index.ts
+++ b/src/entities/lecture/ui/LectureCard/index.ts
@@ -1 +1,4 @@
export { default as LectureCard } from "./LectureCard";
+export * from "./HomeLectureCard";
+export * from "./PickLectureCard";
+export * from "./RowLectureCard";
diff --git a/src/entities/lecture/ui/LectureCarousel/LectureCarousel.tsx b/src/entities/lecture/ui/LectureCarousel/LectureCarousel.tsx
new file mode 100644
index 0000000..d88e536
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCarousel/LectureCarousel.tsx
@@ -0,0 +1,69 @@
+import {
+ Carousel,
+ CarouselApi,
+ CarouselContent,
+ CarouselItem,
+ CarouselNext,
+ CarouselPrevious,
+} from "@/shared/ui";
+import { Dispatch, SetStateAction } from "react";
+
+import Image from "next/image";
+import { LectureCard } from "../LectureCard";
+import { LectureInfo } from "../../model/lecture";
+
+export interface CarouselImage {
+ src: string;
+ alt: string;
+ width: number;
+ height: number;
+}
+
+interface LectureCarouselProps {
+ setApi: Dispatch>;
+ lectureInfo: LectureInfo[];
+ isPreviousIcon?: boolean;
+ isNextIcon?: boolean;
+}
+
+const LectureCarousel = ({
+ setApi,
+ lectureInfo,
+ isPreviousIcon,
+ isNextIcon,
+}: LectureCarouselProps) => {
+ return (
+
+
+ {lectureInfo.map((lectureData) => {
+ return (
+
+
+
+ );
+ })}
+
+ {isPreviousIcon && (
+
+ )}
+ {isNextIcon && (
+
+ )}
+
+ );
+};
+
+export default LectureCarousel;
diff --git a/src/entities/lecture/ui/LectureCarousel/index.ts b/src/entities/lecture/ui/LectureCarousel/index.ts
new file mode 100644
index 0000000..3789193
--- /dev/null
+++ b/src/entities/lecture/ui/LectureCarousel/index.ts
@@ -0,0 +1 @@
+export { default as LectureCarousel } from "./LectureCarousel";
diff --git a/src/entities/lecture/ui/LectureDetail/LectureDetail.tsx b/src/entities/lecture/ui/LectureDetail/LectureDetail.tsx
index 2ec4385..a1c2761 100644
--- a/src/entities/lecture/ui/LectureDetail/LectureDetail.tsx
+++ b/src/entities/lecture/ui/LectureDetail/LectureDetail.tsx
@@ -1,6 +1,7 @@
import { Divider, Skeleton } from "@/shared/ui";
import {
Lecture,
+ LectureDetailListProps,
LectureDetailTitleEnum,
lectureDetailList,
} from "../../model/lecture";
@@ -15,46 +16,54 @@ interface LectureDetailProps {
const LectureDetail = ({ lectureInfo, isLoading }: LectureDetailProps) => {
if (isLoading) {
- return ;
+ return (
+
+
+
+ );
}
return (
-
-
-
+
+
+
클래스 내용
- {/* TODO: 컴포넌트화 */}
- {lectureDetailList.map((lectureDetailItem) => {
- return (
-
- );
- })}
+ {lectureDetailList.map(
+ (lectureDetailItem: LectureDetailListProps) => {
+ return (
+
+ );
+ },
+ )}
-
-
+
+
강사 이력
{isLoading &&
}
{lectureInfo && (
-
+
{lectureInfo.instructor_name.map((instructor) => instructor.name)}
-
+
{lectureInfo.instructor_name.map((instructor) => {
return instructor.instructor_history.map((history, idx) => {
return - {history.content}
;
@@ -64,8 +73,10 @@ const LectureDetail = ({ lectureInfo, isLoading }: LectureDetailProps) => {
)}
-
-
교육 계획
+
+
+ 교육 계획
+
{/* {isLoading &&
} */}
{/* {lectureInfo &&
{lectureInfo.educationPlan}
} */}
diff --git a/src/entities/lecture/ui/LectureDetail/LectureDetailItem/LectureDetailItem.tsx b/src/entities/lecture/ui/LectureDetail/LectureDetailItem/LectureDetailItem.tsx
index 16afa8c..75534ad 100644
--- a/src/entities/lecture/ui/LectureDetail/LectureDetailItem/LectureDetailItem.tsx
+++ b/src/entities/lecture/ui/LectureDetail/LectureDetailItem/LectureDetailItem.tsx
@@ -6,10 +6,12 @@ export interface LectureDetailItemProps {
const LectureDetailItem = ({ title, content }: LectureDetailItemProps) => {
return (
-
+
{title}
- {content &&
{content}
}
+ {content && (
+
{content}
+ )}
);
};
diff --git a/src/entities/lecture/ui/LectureFooter/LectureFooter.tsx b/src/entities/lecture/ui/LectureFooter/LectureFooter.tsx
index 9dc5ad5..07a6018 100644
--- a/src/entities/lecture/ui/LectureFooter/LectureFooter.tsx
+++ b/src/entities/lecture/ui/LectureFooter/LectureFooter.tsx
@@ -4,6 +4,7 @@ import { Button, IconButton, Skeleton, UnifiedDialog } from "@/shared/ui";
import Image from "next/image";
import { Lecture } from "../../model/lecture";
+import { getCookie } from "cookies-next";
import { toast } from "sonner";
import useDeleteLikeLecture from "@/features/like/api/useDeleteLikeLecture";
import usePostLikeLecture from "@/features/like/api/usePostLikeLecture";
@@ -17,7 +18,7 @@ interface LectureFooterProps {
const LectureFooter = ({ lectureInfo, isLoading }: LectureFooterProps) => {
const [open, setOpen] = useState
(false);
- const tempApplyStatus = false;
+ const token = getCookie("accessToken");
const router = useRouter();
const postLikeLecture = usePostLikeLecture(lectureInfo ? lectureInfo.id : -1);
@@ -66,7 +67,7 @@ const LectureFooter = ({ lectureInfo, isLoading }: LectureFooterProps) => {
const triggerItem = () => {
return (
-
@@ -75,17 +76,14 @@ const LectureFooter = ({ lectureInfo, isLoading }: LectureFooterProps) => {
const dialogContent = () => {
return (
-
+
-
- 데이터가 만료되거나 이용 완료되어 불러오지 못했습니다.
+
불러오지 못했어요