diff --git a/plugins/eurotilities/components/settings.tsx b/plugins/eurotilities/components/settings.tsx index 9685e6b..3e6d2e0 100644 --- a/plugins/eurotilities/components/settings.tsx +++ b/plugins/eurotilities/components/settings.tsx @@ -2,7 +2,22 @@ import modules from "../helpers/modules.ts"; const { plugin: { store }, - ui: { SwitchItem, tooltip }, + ui: { + Header, + HeaderTags, + Divider, + SwitchItem, + openModal, + ModalRoot, + ModalSizes, + ModalHeader, + ModalBody, + ModalConfirmFooter, + Button, + ButtonLooks, + ButtonColors, + ButtonSizes, + }, React, } = shelter; @@ -10,48 +25,81 @@ const handleSettingChange = (key, value) => { store[key] = value; }; -export const settings = () => { - return ( - <> -
- handleSettingChange("colorSighted", v)} - hideBorder - // biome-ignore lint/correctness/noChildrenProp: N/A - children="Color Sighted" - /> -
- -
- handleSettingChange("noNitroUpsell", v)} - hideBorder - // biome-ignore lint/correctness/noChildrenProp: N/A - children="No Nitro Upsell" - /> -
+const camelize = (str: string) => { + return str + .replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => + index === 0 ? word.toLowerCase() : word.toUpperCase(), + ) + .replace(/\s+/g, ""); +}; -
- handleSettingChange("noTypingAnimation", v)} - hideBorder - // biome-ignore lint/correctness/noChildrenProp: N/A - children="No Typing Animation" - /> -
+const makeModal = () => { + const remove = openModal(() => ( + + { + remove(); + }} + > + €tilities Settings + + + + {Object.keys(modules).map((module) => { + const mod = modules[module]; + return ( +
+ handleSettingChange(camelize(module), v)} + hideBorder + // biome-ignore lint/correctness/noChildrenProp: + children="" + > + {mod.title} +
+ {mod.content} +
+ +
+ ); + })} +
+ { + remove(); + }} + cancelText="Close" + confirmText="Apply" + onConfirm={() => { + location.reload(); + }} + /> +
+ )); +}; -
- handleSettingChange("steamStatusSync", v)} - hideBorder - // biome-ignore lint/correctness/noChildrenProp: N/A - children="Steam Status Sync" - /> -
- +export const settings = () => { + return ( +