diff options
author | Sebastian <sebasjm@gmail.com> | 2021-06-30 00:24:43 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-06-30 00:24:52 -0300 |
commit | 05e89a3cf7bc2e04ecb88be87ab5c14bb66d71e7 (patch) | |
tree | 2bab1f0b836b9b953a91da11e8d696d065e9f2a6 /packages/taler-wallet-webextension/src/popup/Settings.tsx | |
parent | b43c476590508b5b3b10a5c2da34ac30f1fbdf57 (diff) | |
download | wallet-core-05e89a3cf7bc2e04ecb88be87ab5c14bb66d71e7.tar.xz |
developer mode
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup/Settings.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/popup/Settings.tsx | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/Settings.tsx b/packages/taler-wallet-webextension/src/popup/Settings.tsx index 5028b597c..0a57092bb 100644 --- a/packages/taler-wallet-webextension/src/popup/Settings.tsx +++ b/packages/taler-wallet-webextension/src/popup/Settings.tsx @@ -15,20 +15,42 @@ */ -import { PermissionsCheckbox } from "../components/PermissionsCheckbox"; +import { VNode } from "preact"; +import { Checkbox } from "../components/Checkbox"; +import { useDevContext } from "../context/useDevContext"; import { useExtendedPermissions } from "../hooks/useExtendedPermissions"; - -export function SettingsPage() { +export function SettingsPage(): VNode { const [permissionsEnabled, togglePermissions] = useExtendedPermissions(); + const { devMode, toggleDevMode } = useDevContext() + return <SettingsView + permissionsEnabled={permissionsEnabled} togglePermissions={togglePermissions} + developerMode={devMode} toggleDeveloperMode={toggleDevMode} + />; +} + +export interface ViewProps { + permissionsEnabled: boolean; + togglePermissions: () => void; + developerMode: boolean; + toggleDeveloperMode: () => void; +} + +export function SettingsView({permissionsEnabled, togglePermissions, developerMode, toggleDeveloperMode}: ViewProps): VNode { return ( <div> <h2>Permissions</h2> - <PermissionsCheckbox enabled={permissionsEnabled} onToggle={togglePermissions} /> - {/* - <h2>Developer mode</h2> - <DebugCheckbox enabled={permissionsEnabled} onToggle={togglePermissions} /> - */} + <Checkbox label="Automatically open wallet based on page content" + name="perm" + description="(Enabling this option below will make using the wallet faster, but requires more permissions from your browser.)" + enabled={permissionsEnabled} onToggle={togglePermissions} + /> + <h2>Config</h2> + <Checkbox label="Developer mode" + name="devMode" + description="(More options and information useful for debugging)" + enabled={developerMode} onToggle={toggleDeveloperMode} + /> </div> - ); -} + ) +}
\ No newline at end of file |