fixed redirectUri and added search on enter press
This commit is contained in:
parent
d2bcd32dd2
commit
fddf1ed6b1
2
package-lock.json
generated
2
package-lock.json
generated
@ -13,7 +13,7 @@
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-scripts": "^5.0.1",
|
||||
"web-vitals": "^2.1.4"
|
||||
}
|
||||
},
|
||||
|
@ -8,7 +8,7 @@
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"react-scripts": "^5.0.1",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -15,12 +15,19 @@ class SearchBar extends React.Component {
|
||||
handleTermChange = (event) => {
|
||||
this.setState({ term: event.target.value });
|
||||
};
|
||||
handleKeyDown = event => {
|
||||
if (event.key === "Enter"){
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="SearchBar">
|
||||
<input
|
||||
placeholder="Enter A Song, Album, or Artist"
|
||||
onChange={this.handleTermChange}
|
||||
onKeyDown={this.handleKeyDown}
|
||||
/>
|
||||
<button className="SearchButton" onClick={this.search}>
|
||||
SEARCH
|
||||
|
@ -1,6 +1,6 @@
|
||||
const clientId = "c39c93bbf05745fb986d1e566004eb31";
|
||||
// Hosted on https://jammingcademy.surge.sh/, but save playlist does not work
|
||||
const redirectUri = "http://localhost:3000/";
|
||||
const redirectUri = "http://localhost:3000";
|
||||
let accessToken = "";
|
||||
|
||||
export const Spotify = {
|
||||
|
Loading…
Reference in New Issue
Block a user