chore: Enable HMR for frontend code (#2024)

* chore: Enable HMR for frontend code
closes #2021

* revert
This commit is contained in:
Tom Moor
2021-04-11 15:09:00 -07:00
committed by GitHub
parent 2a6dfdea5d
commit cdc7f61fa1
7 changed files with 134 additions and 44 deletions

View File

@@ -1,17 +1,18 @@
// @flow
import { inject, observer } from "mobx-react";
import { 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";
import useStores from "hooks/useStores";
type Props = {
ui: UiStore,
type Props = {|
children: React.Node,
};
|};
function Theme({ children }: Props) {
const { ui } = useStores();
function Theme({ children, ui }: Props) {
return (
<ThemeProvider theme={ui.resolvedTheme === "dark" ? dark : light}>
<>
@@ -22,4 +23,4 @@ function Theme({ children, ui }: Props) {
);
}
export default inject("ui")(observer(Theme));
export default observer(Theme);