6.1 Hero/공지 배너 컴포넌트(자동/수동 슬라이드) o
This commit is contained in:
24
src/app/components/HeroBanner.tsx
Normal file
24
src/app/components/HeroBanner.tsx
Normal file
@@ -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 (
|
||||||
|
<section style={{ padding: 24, background: "#f5f5f5", borderRadius: 12, marginBottom: 16 }}>
|
||||||
|
<h1 style={{ margin: 0 }}>{slide.title}</h1>
|
||||||
|
<p style={{ margin: 0, opacity: 0.8 }}>{slide.subtitle}</p>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { QuickActions } from "@/app/components/QuickActions";
|
import { QuickActions } from "@/app/components/QuickActions";
|
||||||
|
import { HeroBanner } from "@/app/components/HeroBanner";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div className="">
|
<div className="">
|
||||||
|
<HeroBanner />
|
||||||
<QuickActions />
|
<QuickActions />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
5.4 테마/다크모드 및 반응형 설정 o
|
5.4 테마/다크모드 및 반응형 설정 o
|
||||||
|
|
||||||
[메인 화면]
|
[메인 화면]
|
||||||
6.1 Hero/공지 배너 컴포넌트(자동/수동 슬라이드)
|
6.1 Hero/공지 배너 컴포넌트(자동/수동 슬라이드) o
|
||||||
6.2 최근/인기 글 리스트 및 무한스크롤 연동
|
6.2 최근/인기 글 리스트 및 무한스크롤 연동
|
||||||
6.3 권한 기반 빠른 액션 노출 제어
|
6.3 권한 기반 빠른 액션 노출 제어
|
||||||
6.4 검색 바 및 결과 페이지 라우팅
|
6.4 검색 바 및 결과 페이지 라우팅
|
||||||
|
|||||||
Reference in New Issue
Block a user