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