Team-groupHi / grouphi-mvp-fe

๊ทธ๋ฃจํŒŒ์ด ํ”„๋ก ํŠธ์—”๋“œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ
https://grouphi.vercel.app/
MIT License
1 stars 2 forks source link

Carousel ์ปดํฌ๋„ŒํŠธ #55

Closed kim-hyunjoo closed 2 days ago

kim-hyunjoo commented 2 weeks ago

๐Ÿ“์ž‘์—… ๋‚ด์šฉ

shadcn๊ธฐ๋ฐ˜ Carousel ์ปดํฌ๋„ŒํŠธ๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ```jsx import * as React from 'react'; import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from '@/components/Carousel'; import { GameListCard } from '@/components/GameListCard'; const DUMMY = [ { title: 'title1', description: 'description1', }, { title: 'title2', description: 'description2', }, { title: 'title3', description: 'description3', }, { title: 'title4', description: 'description4', }, { title: 'title5', description: 'description5', }, { title: 'title6', description: 'description6', }, { title: 'title7', description: 'description7', }, { title: 'title8', description: 'description8', }, ]; export default function Home() { // DUMMY ๋ฐฐ์—ด์„ 6๊ฐœ์”ฉ ๋‚˜๋ˆ„์–ด ์ƒˆ๋กœ์šด ๋ฐฐ์—ด ์ƒ์„ฑ const groupedItems = []; for (let i = 0; i < DUMMY.length; i += 6) { groupedItems.push(DUMMY.slice(i, i + 6)); } return (
{groupedItems.map((group, index) => ( {group.map((item, index2) => ( ))} ))}
); } ```

๐Ÿ“ท์Šคํฌ๋ฆฐ์ƒท(ํ•„์š” ์‹œ)

image

โœจPR Point