refactor and fix some things

This commit is contained in:
David Ralph
2021-01-16 18:39:03 +00:00
parent 5c579ee0a2
commit 0a735384df
23 changed files with 122 additions and 117 deletions

View File

@@ -93,15 +93,12 @@ export default class Quote extends React.PureComponent {
}
componentDidMount() {
if (localStorage.getItem('quote') === 'false') return;
if (localStorage.getItem('favouriteQuote')) this.setState({ favourited: <StarIcon className='copyButton' onClick={() => this.favourite()} /> });
if (localStorage.getItem('favouriteQuoteEnabled') === 'false') this.setState({ favourited: null });
this.getQuote();
}
render() {
if (localStorage.getItem('quote') === 'false') return null;
let copy = <FileCopy className='copyButton' onClick={() => this.copyQuote()}></FileCopy>;
if (localStorage.getItem('copyButton') === 'false') copy = null;