diff options
author | Sebastian <sebasjm@gmail.com> | 2023-10-19 09:02:45 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-10-19 09:02:45 -0300 |
commit | 6bc2ca85e7238dbd9a88643e540a73cee6c918c7 (patch) | |
tree | a2df12d2f4e75cfb8513ebcdf8e445864bd69b38 /packages/demobank-ui/src/hooks | |
parent | 366cccb8fcae6a9971a1e8a9143d821e289339d1 (diff) | |
download | wallet-core-6bc2ca85e7238dbd9a88643e540a73cee6c918c7.tar.xz |
mobile for side menu
Diffstat (limited to 'packages/demobank-ui/src/hooks')
-rw-r--r-- | packages/demobank-ui/src/hooks/settings.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/demobank-ui/src/hooks/settings.ts b/packages/demobank-ui/src/hooks/settings.ts index ad853f9d7..cfc3b6a5b 100644 --- a/packages/demobank-ui/src/hooks/settings.ts +++ b/packages/demobank-ui/src/hooks/settings.ts @@ -17,6 +17,7 @@ import { AmountString, Codec, + TranslatedString, buildCodecForObject, codecForAmountString, codecForBoolean, @@ -25,6 +26,7 @@ import { codecOptional, } from "@gnu-taler/taler-util"; import { buildStorageKey, useLocalStorage } from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; interface Settings { currentWithdrawalOperationId: string | undefined; @@ -34,6 +36,23 @@ interface Settings { maxWithdrawalAmount: number; fastWithdrawal: boolean; showDebugInfo: boolean; + +} + +export function getAllBooleanSettings(): Array<keyof Settings> { + return ["fastWithdrawal", "showDebugInfo", "showDemoDescription", "showInstallWallet", "showWithdrawalSuccess"] +} + +export function getLabelForSetting(k: keyof Settings, i18n: ReturnType<typeof useTranslationContext>["i18n"]): TranslatedString { + switch (k) { + case "currentWithdrawalOperationId": return i18n.str`Current withdrawal operation` + case "maxWithdrawalAmount": return i18n.str`Max withdrawal amount` + case "showWithdrawalSuccess": return i18n.str`Show withdrawal confirmation` + case "showDemoDescription": return i18n.str`Show demo description` + case "showInstallWallet": return i18n.str`Show install wallet first` + case "fastWithdrawal": return i18n.str`Use fast withdrawal form` + case "showDebugInfo": return i18n.str`Show debug info` + } } export const codecForSettings = (): Codec<Settings> => |