fix: revert theme workarounds

This commit is contained in:
Kyle Gill
2019-05-29 23:00:59 -06:00
parent 5d46b17eef
commit abfa052fa0
8 changed files with 282 additions and 5747 deletions

View File

@@ -17,21 +17,11 @@ class ThemeToggler extends React.Component {
: "DARK",
}
componentDidMount() {
// set the body style property on mount so routes don't flash between transitions
const { themeName } = this.state
this.toggle(themeName)
}
toggle = newThemeName => {
toggle = () => {
const { themeName } = this.state
const body = document.body
let newTheme
if (newThemeName) {
newTheme = newThemeName
} else {
newTheme = themeName === "LIGHT" ? "DARK" : "LIGHT"
}
newTheme = themeName === "LIGHT" ? "DARK" : "LIGHT"
body.style.setProperty(
"background-color",
theme[newTheme].colors.bodyBackground