From bd2c343580c041383a98822de2c622a7d944d93d Mon Sep 17 00:00:00 2001 From: LekoArts Date: Thu, 9 Jul 2020 14:29:56 +0200 Subject: [PATCH] fix(minimal-blog): Use function for SpotifyPlayer example component --- .../SpotifyPlayer.js | 42 ++++++------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/examples/minimal-blog/content/posts/fantastic-beasts-and-where-to-find-them/SpotifyPlayer.js b/examples/minimal-blog/content/posts/fantastic-beasts-and-where-to-find-them/SpotifyPlayer.js index d85ba081d..c195e7d82 100644 --- a/examples/minimal-blog/content/posts/fantastic-beasts-and-where-to-find-them/SpotifyPlayer.js +++ b/examples/minimal-blog/content/posts/fantastic-beasts-and-where-to-find-them/SpotifyPlayer.js @@ -8,7 +8,7 @@ * @see https://developer.spotify.com/technologies/widgets/spotify-play-button/ */ -import React, { Component } from "react" +import React from "react" // Size presets, defined by Spotify const sizePresets = { @@ -22,34 +22,18 @@ const sizePresets = { }, } -/** - * SpotifyPlayer class - */ -class SpotifyPlayer extends Component { - // ------------------------------------------------------ - // Render - // ------------------------------------------------------ - - render() { - const { uri, view, theme } = this.props - let { size } = this.props - - if (typeof size === `string`) { - size = sizePresets[size] - } - - return ( -