import React from "react"; import { connect } from "react-redux"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faTwitter } from "@fortawesome/free-brands-svg-icons"; import "./TweetQuote.css"; const mapStateToProps = state => ({ ...state }); class TweetQuote extends React.Component { render() { const colors = ["red-background", "blue-background", "yellow-background"]; const tweetQuoteClass = "TweetQuote " + colors[this.props.colorCount]; let href = "https://twitter.com/intent/tweet?text="; if (typeof this.props.newQuote.quote === "object") { href += encodeURIComponent( this.props.newQuote.quote.quote + "\n--" + this.props.newQuote.quote.author ); } return (
); } } export default connect(mapStateToProps)(TweetQuote);