Fix and make toast dark theme

This commit is contained in:
David Ralph
2020-11-30 11:56:33 +00:00
parent 727e21480d
commit 86b6ad6542
3 changed files with 14 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ export default class App extends React.PureComponent {
if (localStorage.getItem('showWelcome') === 'true') this.setState({ welcomeModal: true });
const css = localStorage.getItem('customcss');
if (css) document.head.insertAdjacentHTML('beforeend', '<style>' + css + '</style>');
if (localStorage.getItem('darkTheme') === 'true') document.getElementsByClassName('Toastify')[0].classList.add('dark');
}
closeWelcome() {

View File

@@ -112,8 +112,7 @@ export default class Quote extends React.PureComponent {
<div className='quotediv'>
<h1 className='quote'>{`${this.state.quote}`}</h1>
<h1 className='quoteauthor'>
<a href={this.state.authorlink} className='quoteauthorlink' target='_blank' rel='noopener noreferrer'>{this.state.author}</a>
{copy} {tweet} {this.state.favourited}
<a href={this.state.authorlink} className='quoteauthorlink' target='_blank' rel='noopener noreferrer'>{this.state.author}</a> {copy} {tweet} {this.state.favourited}
</h1>
</div>
);

View File

@@ -26,3 +26,15 @@
.Toastify__toast-container {
width: auto !important;
}
.dark {
.Toastify__toast {
background-color: #2f3542 !important;
}
.Toastify__toast-body,
.Toastify__progress-bar--default,
.Toastify__close-button {
color: white !important;
}
}