This commit is contained in:
David Ralph
2020-09-15 22:38:32 +01:00
parent a1963fb31b
commit 3399705935
10 changed files with 15 additions and 19 deletions

View File

@@ -20,7 +20,7 @@ export default class View extends React.PureComponent {
viewStuff() {
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv'];
elements.forEach(element => {
elements.forEach((element) => {
try {
(this.state.hidden === false) ? document.querySelector(element).style.display = 'none' : document.querySelector(element).style.display = 'block';
} catch (e) {

View File

@@ -24,7 +24,7 @@ export default class Quote extends React.PureComponent {
async getQuote() {
const quotePack = JSON.parse(localStorage.getItem('quote_packs'));
if (quotePack) {
const data = quotePack[Math.floor(Math.random() * quotePack.length)]
const data = quotePack[Math.floor(Math.random() * quotePack.length)];
return this.setState({
quote: '"' + data.quote + '"',
author: data.author
@@ -64,6 +64,6 @@ export default class Quote extends React.PureComponent {
<h1 className='quote'>{`${this.state.quote}`}</h1>
<h1 className='quoteauthor'>{this.state.author} {copy}</h1>
</div>
)
);
}
}

View File

@@ -25,7 +25,7 @@ export default class Search extends React.PureComponent {
let value = document.getElementById('searchtext').value;
if (!value) value = 'mue fast';
window.location.href = url + '?q=' + value;
}
};
return <div id='searchBar' className='searchbar'>
<form id='searchBar' className='searchbarform' action={url}>