diff options
author | Sebastian <sebasjm@gmail.com> | 2021-11-19 14:51:27 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-11-19 14:51:35 -0300 |
commit | a35604fd562a72e4e266bf6a4255d89d3c1374a1 (patch) | |
tree | d0c4df01a89dc78c412be6da3aba3cec343937ff /packages/taler-wallet-webextension/src/wallet/Settings.tsx | |
parent | 60cfb0e78f3afed92f315c1394da717329db9564 (diff) | |
download | wallet-core-a35604fd562a72e4e266bf6a4255d89d3c1374a1.tar.xz |
some changes:
- simplify design to reuse more components (from wallet instead of popup)
- simplify hooks (useAsyncAsHook)
- updateNotification from backend now filter events by type
- new balance design proposed by Belen
- more information when the withdrawal is in process
- manual withdrawal implementation
- some bugs killed
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Settings.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Settings.tsx | 73 |
1 files changed, 38 insertions, 35 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx index 8d8f3cdbc..586d7b53e 100644 --- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx @@ -15,16 +15,15 @@ */ import { ExchangeListItem, i18n } from "@gnu-taler/taler-util"; -import { VNode, h, Fragment } from "preact"; +import { Fragment, h, VNode } from "preact"; import { Checkbox } from "../components/Checkbox"; -import { EditableText } from "../components/EditableText"; -import { SelectList } from "../components/SelectList"; -import { ButtonPrimary, ButtonSuccess, WalletBox } from "../components/styled"; +import { ButtonPrimary } from "../components/styled"; import { useDevContext } from "../context/devContext"; +import { useAsyncAsHook } from "../hooks/useAsyncAsHook"; import { useBackupDeviceName } from "../hooks/useBackupDeviceName"; import { useExtendedPermissions } from "../hooks/useExtendedPermissions"; -import { useAsyncAsHook } from "../hooks/useAsyncAsHook"; import { useLang } from "../hooks/useLang"; +// import { strings as messages } from "../i18n/strings"; import * as wxApi from "../wxApi"; export function SettingsPage(): VNode { @@ -32,7 +31,7 @@ export function SettingsPage(): VNode { const { devMode, toggleDevMode } = useDevContext(); const { name, update } = useBackupDeviceName(); const [lang, changeLang] = useLang(); - const exchangesHook = useAsyncAsHook(() => wxApi.listExchanges()); + const exchangesHook = useAsyncAsHook(wxApi.listExchanges); return ( <SettingsView @@ -65,34 +64,32 @@ export interface ViewProps { knownExchanges: Array<ExchangeListItem>; } -import { strings as messages } from "../i18n/strings"; - -type LangsNames = { - [P in keyof typeof messages]: string; -}; +// type LangsNames = { +// [P in keyof typeof messages]: string; +// }; -const names: LangsNames = { - es: "Español [es]", - en: "English [en]", - fr: "Français [fr]", - de: "Deutsch [de]", - sv: "Svenska [sv]", - it: "Italiano [it]", -}; +// const names: LangsNames = { +// es: "Español [es]", +// en: "English [en]", +// fr: "Français [fr]", +// de: "Deutsch [de]", +// sv: "Svenska [sv]", +// it: "Italiano [it]", +// }; export function SettingsView({ knownExchanges, - lang, - changeLang, - deviceName, - setDeviceName, + // lang, + // changeLang, + // deviceName, + // setDeviceName, permissionsEnabled, togglePermissions, developerMode, toggleDeveloperMode, }: ViewProps): VNode { return ( - <WalletBox> + <Fragment> <section> <h2> <i18n.Translate>Known exchanges</i18n.Translate> @@ -100,17 +97,23 @@ export function SettingsView({ {!knownExchanges || !knownExchanges.length ? ( <div>No exchange yet!</div> ) : ( - <table> - {knownExchanges.map((e) => ( - <tr> - <td>{e.currency}</td> - <td> - <a href={e.exchangeBaseUrl}>{e.exchangeBaseUrl}</a> - </td> - </tr> - ))} - </table> + <Fragment> + <table> + {knownExchanges.map((e, idx) => ( + <tr key={idx}> + <td>{e.currency}</td> + <td> + <a href={e.exchangeBaseUrl}>{e.exchangeBaseUrl}</a> + </td> + </tr> + ))} + </table> + </Fragment> )} + <div style={{ display: "flex", justifyContent: "space-between" }}> + <div /> + <ButtonPrimary>Manage exchange</ButtonPrimary> + </div> <h2> <i18n.Translate>Permissions</i18n.Translate> @@ -131,6 +134,6 @@ export function SettingsView({ onToggle={toggleDeveloperMode} /> </section> - </WalletBox> + </Fragment> ); } |