Login and artist search pages

This commit is contained in:
Rodrigo Pinto 2019-12-14 12:32:28 -05:00
commit f4dce4653f
5 changed files with 50 additions and 24 deletions

View file

@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'
function ArtistSearch() {
let [token, setToken] = useState(null)
let [search, setSearch] = useState(null)
useEffect(() => {
const search = window.location.search
@ -9,11 +10,19 @@ function ArtistSearch() {
setToken(params.get('access_token'))
}, [])
useEffect(() => {
console.log(search)
}, [search])
const handleChange = e => {
setSearch(e.currentTarget.value)
}
return (
<div className="artist-search">
<h1>Artist search</h1>
<p>{token}</p>
<input placeholder='Search for an artist' onChange={handleChange} />
</div>
)
}

13
src/views/Login.jsx Normal file
View file

@ -0,0 +1,13 @@
import React from 'react'
function Login() {
return (
<div className="artist-search">
<h1>Touch Tunes</h1>
<a href='http://localhost:8888/login' className='App-link'> Login to Spotify </a>
</div>
)
}
export default Login