issues
search
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) => (
))}
))}
); } ```
๐ท์คํฌ๋ฆฐ์ท(ํ์ ์)
โจPR Point
ํ ์คํธ ์ค ๋ฒํผ์ด ๋นํ์ฑํ ๋์ด์ผ ํ๋ ์ผ์ด์ค์๋ง ์๋ฌ๊ฐ ์๊ฒจ ์ด ๋ถ๋ถ์ ์ถํ์ ๋ฌธ์ ํด๊ฒฐ ์ ์ถ๊ฐํ๊ฒ ์ต๋๋ค.
๐์์ ๋ด์ฉ
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 (๐ท์คํฌ๋ฆฐ์ท(ํ์ ์)
โจPR Point