This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Tom Moor e2bd03494d
chore: Update syntax, improve more typing (#1439)
* chore: <React.Fragment> to <>

* flow types
2020-08-09 09:48:04 -07:00

26 lines
599 B
JavaScript

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