Skip to content

Commit

Permalink
Merge pull request #35 from Aman-Mandal/artist-comp
Browse files Browse the repository at this point in the history
made seperate artist component
  • Loading branch information
Aadarsh805 authored Oct 5, 2022
2 parents 3b2200c + 7d02a04 commit 5dda011
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
25 changes: 25 additions & 0 deletions components/Artist/Artist.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Image from "next/image";
import React from "react";

const Artist = ({ img, name, count }) => {
return (
<div className="flex flex-col items-center gap-2 hover:scale-105">
<div className="rounded-md w-max h-max overflow-hidden mx-2 cursor-pointer z-10">
<Image
src={img}
alt={name}
width={150}
height={150}
className="rounded-md w-full object-top"
/>
</div>

<div className="flex-col items-center text-center">
<p className="text-gray-200 text-md">{name}</p>
<p className="swatch_text-primary text-xs">{count}</p>
</div>
</div>
);
};

export default Artist;
21 changes: 2 additions & 19 deletions components/TopArtists/TopArtists.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Image from "next/image";
import Link from "next/link";
import React from "react";
import { artists } from "../../data/data";
import Artist from "../Artist/Artist";

const TopArtists = () => {
return (
Expand All @@ -15,25 +16,7 @@ const TopArtists = () => {

<div className="flex items-center justify-between overflow-auto py-2">
{artists.map((artist) => (
<div
className="flex flex-col items-center gap-2 hover:scale-105"
key={artist.name}
>
<div className="rounded-md w-max h-max overflow-hidden mx-2 cursor-pointer z-10">
<Image
src={artist.img}
alt={artist.name}
width={150}
height={150}
className="rounded-md w-full object-top"
/>
</div>

<div className="flex-col items-center text-center">
<p className="text-gray-200 text-md">{artist.name}</p>
<p className="swatch_text-primary text-xs">{artist.count}</p>
</div>
</div>
<Artist name={artist.name} count={artist.count} img={artist.img} />
))}
</div>
</div>
Expand Down

0 comments on commit 5dda011

Please sign in to comment.