feat(mobx): continue implementing themes; performance work on settings

This commit is contained in:
Paul Makles
2021-12-13 17:27:30 +00:00
parent bd4369cf29
commit 65be047dc6
15 changed files with 497 additions and 287 deletions

View File

@@ -1,7 +1,7 @@
import { observer } from "mobx-react-lite";
import { Helmet } from "react-helmet";
import { createGlobalStyle } from "styled-components";
import { createContext } from "preact";
import { useEffect } from "preact/hooks";
import { useApplicationState } from "../mobx/State";
@@ -316,7 +316,7 @@ export const generateVariables = (theme: Theme) => {
});
};
export default function Theme() {
export default observer(() => {
const settings = useApplicationState().settings;
const theme = settings.theme;
@@ -359,4 +359,4 @@ export default function Theme() {
<style dangerouslySetInnerHTML={{ __html: theme.getCSS() ?? "" }} />
</>
);
}
});