From f014a7906551081d1c2bd7be4ed622b1e206b8a5 Mon Sep 17 00:00:00 2001
From: David Ralph
Date: Tue, 15 Sep 2020 12:21:45 +0100
Subject: [PATCH] Fix maximise, dark theme stuff etc
---
src/components/modals/Settings.jsx | 24 +++++++++++++-----------
src/components/modals/Update.jsx | 2 +-
src/components/widgets/Maximise.jsx | 6 +++++-
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/components/modals/Settings.jsx b/src/components/modals/Settings.jsx
index a7561214..f5f56d15 100644
--- a/src/components/modals/Settings.jsx
+++ b/src/components/modals/Settings.jsx
@@ -63,6 +63,8 @@ export default class Settings extends React.PureComponent {
document.getElementById('searchEngine').style.color = 'white';
document.getElementById('language').style.color = 'white';
document.getElementById('greetingName').style.color = 'white';
+ const choices = document.getElementsByClassName('choices');
+ for (let i = 0; i < choices.length; i++) choices[i].style.backgroundColor = '#2f3542';
}
}
@@ -170,8 +172,8 @@ export default class Settings extends React.PureComponent {
@@ -208,15 +210,15 @@ export default class Settings extends React.PureComponent {
diff --git a/src/components/modals/Update.jsx b/src/components/modals/Update.jsx
index 42574062..6afe7031 100644
--- a/src/components/modals/Update.jsx
+++ b/src/components/modals/Update.jsx
@@ -47,7 +47,7 @@ export default class Update extends React.PureComponent {
By {this.state.author} • {this.state.date}
- Read on the blog here: ${this.state.url}
`}}>
+ Read on the blog here: ${this.state.url}
`}}>
;
}
}
\ No newline at end of file
diff --git a/src/components/widgets/Maximise.jsx b/src/components/widgets/Maximise.jsx
index eb5ae1db..1aa7abf9 100644
--- a/src/components/widgets/Maximise.jsx
+++ b/src/components/widgets/Maximise.jsx
@@ -21,7 +21,11 @@ export default class View extends React.PureComponent {
viewStuff() {
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv'];
elements.forEach(element => {
- (this.state.hidden === false) ? document.querySelector(element).style.display = 'none' : document.querySelector(element).style.display = 'block';
+ try {
+ (this.state.hidden === false) ? document.querySelector(element).style.display = 'none' : document.querySelector(element).style.display = 'block';
+ } catch (e) {
+ return;
+ }
});
if (this.state.hidden === false) {
this.setState({ hidden: true });