Skip to content

Commit 2fb7cc9

Browse files
committed
feat(artist-list) : 아티스트 목록 구현
1 parent 4d5438c commit 2fb7cc9

File tree

4 files changed

+38
-30
lines changed

4 files changed

+38
-30
lines changed

next.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const nextConfig: NextConfig = {
1313
protocol: "https",
1414
hostname: "example.com",
1515
},
16+
{
17+
protocol: "https",
18+
hostname: "i.scdn.co",
19+
},
1620
],
1721
},
1822
};

src/components/artist/list/ArtistListButtons.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { Button } from "@/components/ui/button";
24
import {
35
Select,
@@ -27,7 +29,6 @@ export default function ArtistListButtons() {
2729
<Button variant={"outline"} type={"button"} className={"rounded-full"}>
2830
EDM
2931
</Button>
30-
{/*TODO: 아래 dropdown들 모두 select로 바꾸기*/}
3132
<Select>
3233
<SelectTrigger type={"button"} className={"rounded-full text-sm font-bold"}>
3334
<SelectValue placeholder="더 보기" />

src/components/artist/list/ArtistListItems.tsx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
import Link from "next/link";
2-
import { Card } from "@/components/ui/card";
3-
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
4-
import { UsersRound } from "lucide-react";
2+
import { ArtistListItem } from "@/types/artists";
3+
import Image from "next/image";
4+
import { Heart } from "lucide-react";
55
import { Button } from "@/components/ui/button";
66

77
{
88
/*TODO: 나중에 바로 아래 div에서 api로 불러온 콘서트 목록 map으로 돌리기*/
99
}
1010

11-
export default function ArtistListItems() {
11+
export default function ArtistListItems({ artists }: { artists: ArtistListItem[] }) {
1212
return (
13-
<div className="grid grid-cols-5 gap-8">
14-
{Array.from({ length: 10 }).map((_, index) => (
15-
// TODO: 나중에 ArtistCard로 바꿔끼우기
16-
<Link key={index} href="artists/1">
17-
<Card className="items-center p-8 text-center shadow-none">
18-
<Avatar className="ring-border size-30 ring-4">
19-
<AvatarImage
20-
src="https://kopis.or.kr/_next/image?url=%2Fupload%2FpfmPoster%2FPF_PF281383_251211_125646.jpg&w=384&q=75"
21-
alt="아티스트"
22-
/>
23-
<AvatarFallback>CN</AvatarFallback>
24-
</Avatar>
25-
<div className="">
26-
<h3 className="text-text-main text-lg font-bold">먼데이키즈</h3>
27-
<p className="text-text-sub text-sm font-semibold">발라드 가수</p>
28-
</div>
29-
<div className="text-text-sub flex items-center gap-2 text-sm font-semibold">
30-
<UsersRound size={12} strokeWidth={3} />
31-
<p>24.5K 팔로우 중</p>
32-
</div>
33-
<Button variant="default" size="lg" className="w-full">
34-
팔로우
13+
<div className="grid grid-cols-5 gap-x-8 gap-y-12">
14+
{artists.map((artist) => (
15+
<Link
16+
key={artist.id}
17+
href={`/concerts/${artist.id}`}
18+
className="flex cursor-pointer flex-col gap-5"
19+
>
20+
<div className="relative aspect-square w-full overflow-hidden rounded-lg border">
21+
<Image
22+
src={artist.imageUrl || "/images/artist-placeholder.png"}
23+
alt="Concert Poster"
24+
fill
25+
sizes="(min-width: 1024px) 20vw, (min-width: 768px) 25vw, 50vw"
26+
className="object-cover"
27+
/>
28+
<Button
29+
type="button"
30+
aria-label="아티스트 좋아요"
31+
className="absolute top-2 right-2 z-10 h-10 w-10 cursor-pointer rounded-full bg-black/50 opacity-80 backdrop-blur-sm"
32+
>
33+
<Heart />
3534
</Button>
36-
</Card>
35+
</div>
36+
<strong className="line-clamp-1 text-2xl">{artist.artistName}</strong>
3737
</Link>
3838
))}
3939
</div>

src/components/artist/list/ArtistListMain.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import ArtistListFilters from "@/components/artist/list/ArtistListFilters";
22
import ArtistListItems from "@/components/artist/list/ArtistListItems";
3+
import { getArtists } from "@/lib/artists/artists";
4+
5+
export default async function ArtistListMain() {
6+
const artists = await getArtists();
37

4-
export default function ArtistListMain() {
58
return (
69
<section className={"bg-bg-main flex justify-center px-15 py-16"}>
710
<div className={"flex w-full max-w-400 flex-col gap-8"}>
811
<ArtistListFilters />
9-
<ArtistListItems />
12+
<ArtistListItems artists={artists} />
1013
</div>
1114
</section>
1215
);

0 commit comments

Comments
 (0)