This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const clientID = '82cf58344ff048c9b6df55e2b480e977'; | |
let accessToken; // we use let because we plan to reassign it later | |
const redirectUri = 'http://localhost:3000/'; | |
const Spotify = { | |
get getAccessToken() { | |
if (accessToken) { | |
return accessToken; // we return the token if it exists your naming was off is all | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let accessToken = ''; | |
const clientId = '664b972b62e44bec946cdda0e4d72ff9'; | |
const redirectUri = 'http://localhost:3000/'; | |
const Spotify = { | |
getAccessToken() { | |
if (accessToken) { | |
return accessToken; | |
console.log(`This is ${accessToken}`); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
savePlayList(playListName, trackURIs) { | |
if (!playListName || !trackURIs.length) { | |
return; | |
} | |
const newAccessToken = this.getAccessToken(); | |
let userId; | |
let playListId; | |
const header = { | |
Authorization: `Bearer ${newAccessToken}` | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
savePlayList: (name, trackURIs) => { | |
if (!name || !trackURIs.length) { | |
return; | |
} | |
//Step 91: Create 3 variables, one for access token set to users token | |
//a header set to object with authorization parameter with user's token from Spotify's implicit grnat flow | |
//an empty variable for user ID. | |
const accessToken = Spotify.getAccessToken(); | |
const headers = { | |
Authorization: `Bearer ${accessToken}` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> | |
Daddy & Ronan's Secret Message Decoder | |
</title> | |
</head> | |
<body> | |
<input type="text" id="user"> | |
<button id="expand">Enter</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './track.css'; | |
class Track extends Component { | |
constructor(props) { | |
super(props) | |
this.addTrack = this.addTrack.bind(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (jsonResponse.businesses) { | |
return jsonResponse.businesses.map(business => { | |
id: business.id, | |
imageSrc: business.image_url, | |
name: business.name, | |
address: business.location.address1, | |
city: business.location.city, | |
state: business.location.state, | |
zipCode: business.location.zip_code, | |
category: category.title, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = () => ( | |
<Container> | |
<PulseLoader | |
loading | |
width={200} | |
height={200} | |
pColor="green" | |
sColor="yellow" | |
/> | |
<BouceLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { render } from "react-dom"; | |
import styled from "styled-components"; | |
// we import our new loaders | |
import PulseLoader from "./PulseLoader"; | |
import BouceLoader from "./BouceLoader"; | |
// we create a div to hold our components to give them some breathing room | |
// otherwise they would render on top of each other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import styled, { keyframes } from "styled-components"; | |
// we create our bounce effect with the below keyframe | |
const bounce = keyframes` | |
0%, 75%, 100% { | |
transform: translateY(0px) | |
} | |
25% { | |
transform: translateY(-30px) |