commit f31b0a4b422d8e419cd011ced04b35ced68e5e01
parent 482e00d055f70a178449603c6604f747779d0d5d
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 26 Sep 2022 22:16:56 +0200
-fix spa
Diffstat:
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/packages/bank/src/pages/home/index.tsx b/packages/bank/src/pages/home/index.tsx
@@ -12,11 +12,11 @@ import talerLogo from '../../assets/logo-white.svg';
import { LangSelectorLikePy as LangSelector } from '../../components/menu/LangSelector';
// @ts-ignore
-const __LIBEUFIN_UI_ALLOW_REGISTRATIONS__ = window.__LIBEUFIN_UI_ALLOW_REGISTRATIONS__ ?? 1;
+const UI_ALLOW_REGISTRATIONS = ('__LIBEUFIN_UI_ALLOW_REGISTRATIONS__') ?? 1;
// @ts-ignore
-const __LIBEUFIN_UI_IS_DEMO__ = window.__LIBEUFIN_UI_IS_DEMO__ ?? 0;
+const UI_IS_DEMO = ('__LIBEUFIN_UI_IS_DEMO__') ?? 0;
// @ts-ignore
-const __LIBEUFIN_UI_BANK_NAME__ = window.__LIBEUFIN_UI_BANK_NAME__ ?? 'Taler Bank';
+const UI_BANK_NAME = ('__LIBEUFIN_UI_BANK_NAME__') ?? 'Taler Bank';
/**
* FIXME:
@@ -133,7 +133,7 @@ interface AccountStateType {
***********/
function maybeDemoContent(content: VNode) {
- if (__LIBEUFIN_UI_IS_DEMO__) return content;
+ if (UI_IS_DEMO) return content;
}
async function fetcher(url: string) {
@@ -865,7 +865,7 @@ function BankFrame(Props: any): VNode {
<h1>
<span class="it">
<a href="/">{
- __LIBEUFIN_UI_BANK_NAME__
+ UI_BANK_NAME
}
</a>
</span>
@@ -1284,7 +1284,7 @@ function TalerWithdrawal(Props: any): VNode {
function RegistrationButton(Props: any): VNode {
const { backendStateSetter, pageStateSetter } = Props;
const i18n = useTranslator();
- if (__LIBEUFIN_UI_ALLOW_REGISTRATIONS__)
+ if (UI_ALLOW_REGISTRATIONS)
{
return (<button
autofocus
@@ -1360,9 +1360,8 @@ function LoginForm(Props: any): VNode {
);
submitDataSetter(undefined);
}}>{i18n`Login`}
- </button>)
- + RegistrationButton(props) +
- (
+ </button>
+ {RegistrationButton(Props)}
</div>
</form>);
}
@@ -1380,7 +1379,7 @@ function RegistrationForm(Props: any): VNode {
<Fragment>
<h1 class="nav">
{
- i18n`Welcome to ${__LIBEUFIN_UI_BANK_NAME__}!`
+ i18n`Welcome to ${UI_BANK_NAME}!`
}
</h1>
<aside class="sidebar" id="left" />
@@ -1890,8 +1889,8 @@ export function BankHome(): VNode {
</SWRWithoutCredentials>);
if (pageState.tryRegister) {
- console.log('allow registrations?', __LIBEUFIN_UI_ALLOW_REGISTRATIONS__);
- if (__LIBEUFIN_UI_ALLOW_REGISTRATIONS__)
+ console.log('allow registrations?', UI_ALLOW_REGISTRATIONS);
+ if (UI_ALLOW_REGISTRATIONS)
return (
<PageContext.Provider value={[pageState, pageStateSetter]}>
<BankFrame>
@@ -1936,7 +1935,7 @@ export function BankHome(): VNode {
<BankFrame>
<h1 class="nav">
{
- i18n`Welcome to ${__LIBEUFIN_UI_BANK_NAME__}!`
+ i18n`Welcome to ${UI_BANK_NAME}!`
}
</h1>
<LoginForm