Created
September 12, 2018 19:04
-
-
Save gate5th/eb838c2248581a4753c59505e62cadcf to your computer and use it in GitHub Desktop.
oldschoolshuffle
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
//FeaturedPost.js | |
import React, { Component } from 'react'; | |
import './FeaturedPost.css'; | |
import Typography from '@material-ui/core/Typography'; | |
import Paper from '@material-ui/core/Paper'; | |
import Author from './Author'; | |
import * as SpotifyFunctions from '../spotifyFunctions.js' | |
class FeaturedPost extends Component { | |
createMarkup(htmlString){ | |
return {__html: htmlString} | |
} | |
render() { | |
return ( | |
<div className="FeaturedPost"> | |
<Paper> | |
<Typography variant="headline" component="h3"> | |
{this.props.post.title} | |
</Typography> | |
<Author authorName={this.props.post.metadata.author.title} avatarImageSrc={this.props.post.metadata.author.metadata.avatarimage.url}/> | |
<div className="content" dangerouslySetInnerHTML={this.createMarkup(this.props.post.content)}> | |
</div> | |
<button className="playArtist" onClick={(e) => {SpotifyFunctions.playArtistDiscography(this.props.post.metadata.spotifyartistid, this.props.post.title)}}>Play Discography</button> | |
</Paper> | |
</div> | |
); | |
} | |
} | |
export default FeaturedPost; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment