Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
make settings page load
Browse files Browse the repository at this point in the history
  • Loading branch information
smartfrigde committed Jul 13, 2024
1 parent 3788f8b commit e864a42
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions plugins/armcordSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { LegacyPage } from "./pages/LegacyPage";
import { SettingsPage } from "./pages/SettingsPage";
import { ThemesPage } from "./pages/ThemesPage";
import { UpdaterPage } from "./pages/UpdaterPage";
import { refreshSettings } from "./settings";
const {
plugin: {store},
settings: {registerSection},
util: { log },
} = shelter;
Expand All @@ -17,6 +19,7 @@ let settingsPages = [
]

export function onLoad() {
refreshSettings()
log("ArmCord Settings")
settingsPages
}
Expand Down
10 changes: 4 additions & 6 deletions plugins/armcordSettings/pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@


import { set } from "../settings";
const {
plugin: { store },
ui: { SwitchItem, Header, Divider, HeaderTags },
} = shelter;


export async function SettingsPage() {
const settings = armcord.settings.config
console.error(settings)
export function SettingsPage() {
return(
<>
<Header tag={HeaderTags.H1}>Settings</Header>
<Divider mt mb="30px"/>
<Header tag={HeaderTags.H5}>Mods</Header>
<SwitchItem note="placeholder" value={settings.armcordCSP}>ArmCord CSP</SwitchItem>
<SwitchItem note="placeholder" value={settings.autoScroll}>Vencord</SwitchItem>
<SwitchItem note="placeholder" value={store.settings.armcordCSP} onChange={(e) => set("armcordCSP", e)}>ArmCord CSP</SwitchItem>
<SwitchItem note="placeholder" value={store.settings.autoScroll}>Vencord</SwitchItem>
</>
)
}
9 changes: 9 additions & 0 deletions plugins/armcordSettings/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const {plugin: { store }} = shelter
export function refreshSettings() {
store.settings = window.armcord.settings.config
console.log(store.settings)
}
export function set(key, value) {
armcord.settings.setConfig(key, value)
refreshSettings()
}

0 comments on commit e864a42

Please sign in to comment.