show testing tag

This commit is contained in:
Sebastian 2023-07-10 09:43:27 -03:00
parent f6b63a691b
commit bf3e99ea27
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
2 changed files with 24 additions and 1 deletions

View File

@ -165,7 +165,8 @@ export function BankFrame({
</div>
<div style="flex-grow:1" />
<p>
Copyright &copy; 2014&mdash;2022 Taler Systems SA. {versionText}
Copyright &copy; 2014&mdash;2022 Taler Systems SA. {versionText}{" "}
<TestingTag />
</p>
</div>
</section>
@ -299,3 +300,23 @@ function StatusBanner(): VNode | null {
</div>
);
}
function TestingTag(): VNode {
const testingUrl = localStorage.getItem("bank-base-url");
if (!testingUrl) return <Fragment />;
return (
<span style={{ color: "gray" }}>
Testing with {testingUrl}{" "}
<a
href=""
onClick={(e) => {
e.preventDefault();
localStorage.removeItem("bank-base-url");
window.location.reload();
}}
>
stop testing
</a>
</span>
);
}

View File

@ -79,6 +79,7 @@ export function LoginForm({ onRegister }: { onRegister?: () => void }): VNode {
name="username"
id="username"
value={username ?? ""}
enterkeyhint="next"
placeholder="Username"
autocomplete="username"
required
@ -98,6 +99,7 @@ export function LoginForm({ onRegister }: { onRegister?: () => void }): VNode {
name="password"
id="password"
autocomplete="current-password"
enterkeyhint="send"
value={password ?? ""}
placeholder="Password"
required