diff --git a/src/app/components/HeroBanner.tsx b/src/app/components/HeroBanner.tsx new file mode 100644 index 0000000..9d98c63 --- /dev/null +++ b/src/app/components/HeroBanner.tsx @@ -0,0 +1,24 @@ +"use client"; +import { useEffect, useState } from "react"; + +const defaultSlides = [ + { id: 1, title: "공지사항", subtitle: "중요 공지 확인하기" }, + { id: 2, title: "이벤트", subtitle: "진행중인 이벤트" }, +]; + +export function HeroBanner() { + const [idx, setIdx] = useState(0); + useEffect(() => { + const t = setInterval(() => setIdx((i) => (i + 1) % defaultSlides.length), 3000); + return () => clearInterval(t); + }, []); + const slide = defaultSlides[idx]; + return ( +
+

{slide.title}

+

{slide.subtitle}

+
+ ); +} + + diff --git a/src/app/page.tsx b/src/app/page.tsx index 705ce97..87bd0de 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,9 +1,11 @@ import Image from "next/image"; import { QuickActions } from "@/app/components/QuickActions"; +import { HeroBanner } from "@/app/components/HeroBanner"; export default function Home() { return (
+
); diff --git a/todolist.txt b/todolist.txt index 3d7c76c..0feaded 100644 --- a/todolist.txt +++ b/todolist.txt @@ -33,7 +33,7 @@ 5.4 테마/다크모드 및 반응형 설정 o [메인 화면] -6.1 Hero/공지 배너 컴포넌트(자동/수동 슬라이드) +6.1 Hero/공지 배너 컴포넌트(자동/수동 슬라이드) o 6.2 최근/인기 글 리스트 및 무한스크롤 연동 6.3 권한 기반 빠른 액션 노출 제어 6.4 검색 바 및 결과 페이지 라우팅