From 3b057fa31d3025e68a5359e4a148482481054eac Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Mon, 16 Dec 2019 20:40:52 -0500 Subject: [PATCH] Album CSS and link to Spotify --- src/components/Album.jsx | 29 ++++++++++++++++------------- src/components/Album.scss | 26 ++++++++++++++++++++++---- src/components/Artist.jsx | 2 +- src/views/Albums.jsx | 6 +----- 4 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/components/Album.jsx b/src/components/Album.jsx index eff481d..cb923ec 100644 --- a/src/components/Album.jsx +++ b/src/components/Album.jsx @@ -1,25 +1,28 @@ -import React, { useState, useEffect } from 'react' +import React from 'react' import './Album.scss' -function Album({ props, callback }) { - let [rate, setRate] = useState([]) - - const openAlbums = () => { - callback(props.id) - } - +function Album({ props }) { return ( -
+
{props.images.length > 0 && ( - + {props.name}/ )}
-

{props.name}

-

{props.artists[0].name}

+
+

{props.name}

+
+ +
+
    + {props.artists.map((artist, index) => ( +
  • {artist.name}
  • + ))} +
+
@@ -27,7 +30,7 @@ function Album({ props, callback }) {

{props.total_tracks} {props.total_tracks === 1 ? 'track' : 'tracks'}

- + Preview on Spotify
diff --git a/src/components/Album.scss b/src/components/Album.scss index 37372eb..0ecb1f6 100644 --- a/src/components/Album.scss +++ b/src/components/Album.scss @@ -2,7 +2,6 @@ border: solid thin #b6b6b6; width: 12em; height: 18.5em; - cursor: pointer; .picture { border-bottom: solid thin #b6b6b6; @@ -35,12 +34,28 @@ } } - p { + p, li { font-size: 0.7rem; color: #787878; margin: 0; } + .artists { + display: grid; + max-height: 36px; + + ul { + width: 100%; + + li { + width: 100%; + margin: 0; + padding: 0; + display: block; + } + } + } + .top { padding: 10px; } @@ -51,10 +66,13 @@ bottom: 25px; } - button { + a { position: absolute; bottom: 0; - height: 2.5em; + text-align: center; + padding: 7px 0; + text-decoration: none; + font-size: 9pt; width: 100%; color: #868686; background: #f1f1f1; diff --git a/src/components/Artist.jsx b/src/components/Artist.jsx index 40ae08c..e4a18b9 100644 --- a/src/components/Artist.jsx +++ b/src/components/Artist.jsx @@ -30,7 +30,7 @@ function Artist({ props, callback }) {
{props.images.length > 0 && ( - + {props.name} )}
diff --git a/src/views/Albums.jsx b/src/views/Albums.jsx index edbeade..74b7c9d 100644 --- a/src/views/Albums.jsx +++ b/src/views/Albums.jsx @@ -19,10 +19,6 @@ function Albums({ props }) { }) }, [props]) - const detailsCallback = id => { - console.log('Navigate to', id) - } - return (

Albums

@@ -32,7 +28,7 @@ function Albums({ props }) {
    {albums.map((album, index) => (
  • - +
  • ))}