diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 0167b28..fd5e979 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -13,7 +13,8 @@ import ReactTooltip from "react-tooltip"; import { useAppLayout } from "contexts/AppLayoutContext"; import { ImageQuality } from "./Img"; import Popup from "./Popup"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; +import Select from "./Select"; type AppLayoutProps = { subPanel?: React.ReactNode; @@ -96,7 +97,20 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element { document.getElementsByTagName("html")[0].style.fontSize = `${ (appLayout.fontSize || 1) * 100 }%`; - }); + }, [appLayout.fontSize]); + + const currencyOptions = ["EUR", "USD", "CAD", "JPY"]; + const [currencySelect, setCurrencySelect] = useState(-1); + + useEffect(() => { + appLayout.currency && + setCurrencySelect(currencyOptions.indexOf(appLayout.currency)); + }, [appLayout.currency]); + + useEffect(() => { + currencySelect >= 0 && + appLayout.setCurrency(currencyOptions[currencySelect]); + }, [currencySelect]); return (

Settings

-

Theme

-
- - - -
+
+
+

Theme

+
+ + + +
+
-

Font size

-
- - - -
+
+

Currency

+
+