diff --git a/src/pages/settings/GenericSettings.tsx b/src/pages/settings/GenericSettings.tsx
index 34f22fa0..0c89c243 100644
--- a/src/pages/settings/GenericSettings.tsx
+++ b/src/pages/settings/GenericSettings.tsx
@@ -15,7 +15,7 @@ import {
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
-import { ThemeContext } from "../../context/Theme";
+import { useApplicationState } from "../../mobx/State";
import Category from "../../components/ui/Category";
import Header from "../../components/ui/Header";
@@ -53,7 +53,7 @@ export function GenericSettings({
showExitButton,
}: Props) {
const history = useHistory();
- const theme = useContext(ThemeContext);
+ const theme = useApplicationState().settings.theme;
const { page } = useParams<{ page: string }>();
const [closing, setClosing] = useState(false);
@@ -94,8 +94,8 @@ export function GenericSettings({
name="theme-color"
content={
isTouchscreenDevice
- ? theme["background"]
- : theme["secondary-background"]
+ ? theme.getVariable("background")
+ : theme.getVariable("secondary-background")
}
/>
diff --git a/src/pages/settings/panes/Appearance.tsx b/src/pages/settings/panes/Appearance.tsx
index 7ee6938e..d416e58e 100644
--- a/src/pages/settings/panes/Appearance.tsx
+++ b/src/pages/settings/panes/Appearance.tsx
@@ -1,5 +1,6 @@
import { Reset, Import } from "@styled-icons/boxicons-regular";
import { Pencil, Store } from "@styled-icons/boxicons-solid";
+import { Link } from "react-router-dom";
// @ts-expect-error shade-blend-color does not have typings.
import pSBC from "shade-blend-color";
@@ -8,16 +9,14 @@ import { Text } from "preact-i18n";
import { useCallback, useContext, useEffect, useState } from "preact/hooks";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
-import CategoryButton from "../../../components/ui/fluent/CategoryButton";
-
-
import { debounce } from "../../../lib/debounce";
+import { useApplicationState } from "../../../mobx/State";
import { dispatch } from "../../../redux";
import { connectState } from "../../../redux/connector";
+import { isExperimentEnabled } from "../../../redux/reducers/experiments";
import { EmojiPacks, Settings } from "../../../redux/reducers/settings";
-
import {
DEFAULT_FONT,
DEFAULT_MONO_FONT,
@@ -28,7 +27,6 @@ import {
MONOSPACE_FONTS,
MONOSPACE_FONT_KEYS,
Theme,
- ThemeContext,
ThemeOptions,
} from "../../../context/Theme";
import { useIntermediate } from "../../../context/intermediate/Intermediate";
@@ -40,14 +38,13 @@ import Checkbox from "../../../components/ui/Checkbox";
import ColourSwatches from "../../../components/ui/ColourSwatches";
import ComboBox from "../../../components/ui/ComboBox";
import InputBox from "../../../components/ui/InputBox";
+import CategoryButton from "../../../components/ui/fluent/CategoryButton";
import darkSVG from "../assets/dark.svg";
import lightSVG from "../assets/light.svg";
import mutantSVG from "../assets/mutant_emoji.svg";
import notoSVG from "../assets/noto_emoji.svg";
import openmojiSVG from "../assets/openmoji_emoji.svg";
import twemojiSVG from "../assets/twemoji_emoji.svg";
-import { Link } from "react-router-dom";
-import { isExperimentEnabled } from "../../../redux/reducers/experiments";
interface Props {
settings: Settings;
@@ -55,7 +52,7 @@ interface Props {
// ! FIXME: code needs to be rewritten to fix jittering
export function Component(props: Props) {
- const theme = useContext(ThemeContext);
+ const theme = useApplicationState().settings.theme;
const { writeClipboard, openScreen } = useIntermediate();
function setTheme(theme: ThemeOptions) {
@@ -112,8 +109,7 @@ export function Component(props: Props) {
draggable={false}
data-active={selected === "light"}
onClick={() =>
- selected !== "light" &&
- setTheme({ base: "light" })
+ selected !== "light" && setTheme({ base: "light" })
}
onContextMenu={(e) => e.preventDefault()}
/>
@@ -138,16 +134,24 @@ export function Component(props: Props) {
-
- }
+ {isExperimentEnabled("theme_shop") && (
+
}
+ action="chevron"
+ hover>
+