Dark Mode (#912)

closes #704
This commit is contained in:
Tom Moor
2019-03-12 21:35:35 -07:00
committed by GitHub
parent 6445da33db
commit 59c82f1f06
46 changed files with 648 additions and 252 deletions

25
app/components/Theme.js Normal file
View File

@@ -0,0 +1,25 @@
// @flow
import * as React from 'react';
import { inject, observer } from 'mobx-react';
import { ThemeProvider } from 'styled-components';
import { dark, light } from 'shared/styles/theme';
import GlobalStyles from 'shared/styles/globals';
import UiStore from 'stores/UiStore';
type Props = {
ui: UiStore,
children: React.Node,
};
function Theme({ children, ui }: Props) {
return (
<ThemeProvider theme={ui.theme === 'dark' ? dark : light} key={ui.theme}>
<React.Fragment>
<GlobalStyles />
{children}
</React.Fragment>
</ThemeProvider>
);
}
export default inject('ui')(observer(Theme));