From 32899d3bed9fd7f2f2e71ccb14c08423f1e3a3d4 Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Sat, 14 Dec 2019 23:39:40 -0500 Subject: [PATCH] Artist and Artist Search --- src/components/Artist.jsx | 49 ++++++++++++++++++++++++++------ src/components/Artist.scss | 56 +++++++++++++++++++++++++++++++++++++ src/components/Star.jsx | 14 ++++++++++ src/views/ArtistSearch.scss | 5 ++-- 4 files changed, 113 insertions(+), 11 deletions(-) create mode 100644 src/components/Artist.scss create mode 100644 src/components/Star.jsx diff --git a/src/components/Artist.jsx b/src/components/Artist.jsx index d8141e7..a85ca4d 100644 --- a/src/components/Artist.jsx +++ b/src/components/Artist.jsx @@ -1,15 +1,48 @@ -import React from 'react' +import React, { useState, useEffect } from 'react' +// import Star from './Star.jsx' +import './Artist.scss' + +const star = ( + + + Layer 1 + + + +) function Artist({ props }) { + let [rate, setRate] = useState([]) + + useEffect(() => { + let stars = [] + for (let i=0; i - {props.images.length > 0 && ( - - )} -

{props.name}

-

Popularity: {Math.floor(props.popularity/20)}

-

Followers: {props.followers.total}

-

Id: {props.id}

+
+ {props.images.length > 0 && ( + + )} +
+ +
+
+

{props.name}

+

{props.followers.total.toLocaleString()} followers

+
+ +
+ {rate} +
+ +
+ ) } diff --git a/src/components/Artist.scss b/src/components/Artist.scss new file mode 100644 index 0000000..5b7b2f1 --- /dev/null +++ b/src/components/Artist.scss @@ -0,0 +1,56 @@ +.artist { + border: solid thin #b6b6b6; + width: 12em; + height: 16em; + + .picture { + border-bottom: solid thin #b6b6b6; + background: #d7d7d7; + height: 9em; + overflow: hidden; + + img { + min-height: 9em; + max-width: 12em; + } + } + + .details { + display: inline-table; + position: relative; + height: 7em; + width: 100%; + text-align: left; + + h2 { + font-size: 1rem; + margin-bottom: 5px; + font-weight: 500; + color: #444; + } + + p { + font-size: 0.7rem; + color: #787878; + margin-top: 0; + } + + .text { + padding: 0 1em; + } + + .rate { + position: absolute; + bottom: 0; + padding-left: 1em; + padding-bottom: 10px; + + svg { + height: 20px; + width: 20px; + margin: auto; + } + } + } + +} diff --git a/src/components/Star.jsx b/src/components/Star.jsx new file mode 100644 index 0000000..a2d06ef --- /dev/null +++ b/src/components/Star.jsx @@ -0,0 +1,14 @@ +import React from 'react' + +function Star() { + return ( + + + Layer 1 + + + + ) +} + +export default Star diff --git a/src/views/ArtistSearch.scss b/src/views/ArtistSearch.scss index c873e05..45c9866 100644 --- a/src/views/ArtistSearch.scss +++ b/src/views/ArtistSearch.scss @@ -1,7 +1,5 @@ .artist-search { - h1 { - text-align: center; - } + text-align: center; ul { list-style-type: none; @@ -11,6 +9,7 @@ li { display: inline-block; + margin: 10pt 14pt; } } }