mirror of
https://github.com/mue/mue.git
synced 2026-07-14 04:24:01 +02:00
tweet button for quotes
This commit is contained in:
@@ -137,6 +137,7 @@ export default class Settings extends React.PureComponent {
|
||||
</Section>
|
||||
<Section title={this.props.language.quote.title} name='quote'>
|
||||
<Checkbox name='copyButton' text={this.props.language.quote.copy} />
|
||||
<Checkbox name='tweetButton' text='Tweet Button' />
|
||||
</Section>
|
||||
<Section title={this.props.language.background.title} name='background'>
|
||||
<BackgroundSettings language={this.props.language} resetItem={(item) => this.resetItem(item)}/>
|
||||
|
||||
@@ -3,6 +3,7 @@ import Quotes from '@muetab/quotes';
|
||||
import FileCopy from '@material-ui/icons/FilterNone';
|
||||
import { toast } from 'react-toastify';
|
||||
import * as Constants from '../../modules/constants';
|
||||
import TwitterIcon from '@material-ui/icons/Twitter';
|
||||
|
||||
export default class Quote extends React.PureComponent {
|
||||
constructor(...args) {
|
||||
@@ -77,12 +78,15 @@ export default class Quote extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
let copy = <FileCopy className='copyButton' onClick={() => this.copyQuote()}></FileCopy>;
|
||||
if (localStorage.getItem('copyButton') === 'false') copy = '';
|
||||
if (localStorage.getItem('copyButton') === 'false') copy = null;
|
||||
|
||||
let tweet = <TwitterIcon className='copyButton' onClick={() => window.open(`https://twitter.com/intent/tweet?text=${this.state.quote} - ${this.state.author} on @getmue`, '_blank').focus()}/>
|
||||
if (localStorage.getItem('tweetButton') === 'false') tweet = null;
|
||||
|
||||
return (
|
||||
<div className='quotediv'>
|
||||
<h1 className='quote'>{`${this.state.quote}`}</h1>
|
||||
<h1 className='quoteauthor'>{this.state.author} {copy}</h1>
|
||||
<h1 className='quoteauthor'>{this.state.author} {copy} {tweet}</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,5 +78,9 @@
|
||||
{
|
||||
"name": "favouriteEnabled",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"name": "tweetButton",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user