diff --git a/src/views/ArtistSearch.jsx b/src/views/ArtistSearch.jsx index 562c3c8..9dc5048 100644 --- a/src/views/ArtistSearch.jsx +++ b/src/views/ArtistSearch.jsx @@ -6,6 +6,17 @@ import './ArtistSearch.scss' const spotifyApi = new SpotifyWebApi() +const searchIcon = ( + + + Layer 2 + + + + + +) + function ArtistSearch({ props }) { let [search, setSearch] = useState(null) let [artists, setArtists] = useState(null) @@ -23,7 +34,7 @@ function ArtistSearch({ props }) { // Search artists useEffect(() => { - if (search && search.length > 2) { + if (search && search.length > 0) { spotifyApi.searchArtists(search) .then(function(data) { setArtists(data.artists.items) @@ -31,6 +42,9 @@ function ArtistSearch({ props }) { console.error(err); }) } + else { + setArtists(null) + } }, [search]) // Load search term from props @@ -59,7 +73,10 @@ function ArtistSearch({ props }) {

Artist search

- +
+ + {searchIcon} +
{artists && (
diff --git a/src/views/ArtistSearch.scss b/src/views/ArtistSearch.scss index 45f1cae..7f0f07e 100644 --- a/src/views/ArtistSearch.scss +++ b/src/views/ArtistSearch.scss @@ -1,15 +1,48 @@ .spotify { text-align: center; - ul { - list-style-type: none; - max-width: 60em; - margin: auto; - padding: 0; + .search-field { + border: solid thin #b6b6b6; + border-radius: 5px; + position: relative; + width: 31em; + height: 3em; + margin: 2em auto; - li { - display: inline-block; + input { + border: none; + font-size: 15pt; + width: 100%; + height: 100%; + margin: -1px; + position: absolute; + bottom: 0; + left: 0; + background: transparent; + text-align: center; + + &::placeholder { + color: black; + } + } + + svg { + width: 30px; + position: absolute; + right: 0; + bottom: 3px; + } + } + + ul { + list-style-type: none; + max-width: 60em; + margin: auto; + padding: 0; + + li { + display: inline-block; margin: 10pt 14pt; - } - } + } + } } diff --git a/src/views/Login.jsx b/src/views/Login.jsx index c29dc77..0e085b4 100644 --- a/src/views/Login.jsx +++ b/src/views/Login.jsx @@ -1,12 +1,23 @@ import React from 'react' import './Login.scss' +const spotify = ( + + + Layer 1 + + + + + +) + function Login() { return (

Touch Tunes

- Login to Spotify + Login{spotify}
) } diff --git a/src/views/Login.scss b/src/views/Login.scss index f815e5c..aa0a3ab 100644 --- a/src/views/Login.scss +++ b/src/views/Login.scss @@ -1,3 +1,25 @@ .login { text-align: center; + + h1 { + margin-bottom: 2em; + } + + a { + width: 150px; + border: solid thin #b6b6b6; + border-radius: 5px; + text-decoration: none; + padding: 14px 148px; + position: relative; + color: black; + font-size: 16pt; + + svg { + width: 35px; + position: absolute; + right: 8px; + bottom: 8px; + } + } }