summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Van Doorn <vandoorn.nick@gmail.com>2019-04-06 12:39:37 -0700
committerNick Van Doorn <vandoorn.nick@gmail.com>2019-04-06 12:39:37 -0700
commit38be37635571f85a5113fed9ce65d92a2eaff796 (patch)
tree2fed0905035c4f26f5bf991e60f3705bbe42c4b8 /src
parent548fbaab3e42f4e39e5e894063f42738fbcb4ebe (diff)
Factor out array of themes
Diffstat (limited to 'src')
-rw-r--r--src/components/layout.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/layout.js b/src/components/layout.js
index fcc942e..afb3f8e 100644
--- a/src/components/layout.js
+++ b/src/components/layout.js
@@ -67,6 +67,11 @@ const siteData = {
]
}
+const themeSwitcherThemes = [
+ { name: '👔', key: 'mainTheme' },
+ { name: '📰', key: 'highContrastTheme' }
+]
+
const getThemeKeyFromUrl = () => {
const queryObj = parseQuery()
return queryObj && queryObj.themeKey
@@ -109,14 +114,10 @@ export default class Layout extends Component {
links={siteData.navLinks}
socialEntries={siteData.socialEntries}
/>
-
{children}
<ThemeSwitcher
currentTheme={this.state.currentThemeKey}
- themes={[
- { name: '👔', key: 'mainTheme' },
- { name: '📰', key: 'highContrastTheme' }
- ]}
+ themes={themeSwitcherThemes}
onClick={t => this.changeTheme(t)}
/>
</BaseLayout>