generated from scaffold-eth/scaffold-eth-2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Ifechukwudaniel/artist-detail
Artist detail
- Loading branch information
Showing
10 changed files
with
137 additions
and
143 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from "react"; | ||
import Rating from "./Rating"; | ||
import millify from "millify"; | ||
|
||
interface IProps { | ||
name: string; | ||
followers: number; | ||
albums: number; | ||
location: string; | ||
popularity: number; | ||
biography: string; | ||
following?: boolean; | ||
} | ||
|
||
export default function ArtistCard({ name, followers, albums, location, popularity, biography, following }: IProps) { | ||
return ( | ||
<div className="container w-4/5 mx-auto"> | ||
<div className="flex justify-between items-center"> | ||
<div className="flex mb-4 gap-3"> | ||
<div className="text-center"> | ||
<h1 className="text-2xl font-bold">{millify(followers)}</h1> | ||
<p>Followers</p> | ||
</div> | ||
<div className="text-center"> | ||
<h1 className="text-2xl font-bold">{millify(albums)}</h1> | ||
<p>Albums</p> | ||
</div> | ||
</div> | ||
<div> | ||
<button className={`bg-lightgreen text-black px-8 py-2 rounded bg-[#9DFF94] text-sm font-bold `}> | ||
{" "} | ||
{following ? "Unfollow" : "Follow"} | ||
</button> | ||
</div> | ||
</div> | ||
<div className="text-center py-8"> | ||
<h2 className="text-3xl">{name}</h2> | ||
<p className="text-sm uppercase">{location}</p> | ||
<Rating rating={popularity} /> | ||
<p className="mt-4 leading-[1.7]"> {biography}</p> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
interface IProps { | ||
rating: number; | ||
} | ||
|
||
export default function Rating({ rating }: IProps) { | ||
console.log(rating); | ||
return ( | ||
<div className="rating rating-lg"> | ||
<input type="radio" name="rating-9" className="rating-hidden" checked={rating <= 0} /> | ||
<input type="radio" name="rating-9" className="mask mask-star-2 bg-[#9DFF94]" checked={rating <= 20} /> | ||
<input type="radio" name="rating-9" className="mask mask-star-2 bg-[#9DFF94] ml-3" checked={rating <= 40} /> | ||
<input type="radio" name="rating-9" className="mask mask-star-2 bg-[#9DFF94] ml-3" checked={rating <= 60} /> | ||
<input type="radio" name="rating-9" className="mask mask-star-2 bg-[#9DFF94] ml-3" checked={rating <= 80} /> | ||
<input type="radio" name="rating-9" className="mask mask-star-2 bg-[#9DFF94] ml-3" checked={rating <= 100} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "spotifyVerifier" | ||
name = "SpotifyVerifier" | ||
type = "bin" | ||
authors = [""] | ||
authors = ["Ifechukwu Daniel"] | ||
compiler_version = "0.10.5" | ||
|
||
[dependencies] | ||
[dependencies] |
Oops, something went wrong.