2021-06-16 22:17:12 +02:00
|
|
|
/*
|
|
|
|
This file is part of GNU Taler
|
2022-06-06 17:05:26 +02:00
|
|
|
(C) 2022 Taler Systems S.A.
|
2021-06-16 22:17:12 +02:00
|
|
|
|
|
|
|
GNU Taler is free software; you can redistribute it and/or modify it under the
|
|
|
|
terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3, or (at your option) any later version.
|
|
|
|
|
|
|
|
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Welcome page, shown on first installs.
|
|
|
|
*
|
2022-02-23 19:18:37 +01:00
|
|
|
* @author sebasjm
|
2021-06-16 22:17:12 +02:00
|
|
|
*/
|
|
|
|
|
2022-03-14 19:20:32 +01:00
|
|
|
import { WalletDiagnostics } from "@gnu-taler/taler-util";
|
2021-11-19 18:51:27 +01:00
|
|
|
import { Fragment, h, VNode } from "preact";
|
2022-03-29 04:41:07 +02:00
|
|
|
import { Checkbox } from "../components/Checkbox.js";
|
|
|
|
import { SubTitle, Title } from "../components/styled/index.js";
|
2023-05-05 13:47:00 +02:00
|
|
|
import { useTranslationContext } from "@gnu-taler/web-util/browser";
|
2022-03-29 04:41:07 +02:00
|
|
|
import { useDiagnostics } from "../hooks/useDiagnostics.js";
|
2023-04-14 19:16:08 +02:00
|
|
|
import { useSettings } from "../hooks/useSettings.js";
|
2022-04-27 19:33:52 +02:00
|
|
|
import { ToggleHandler } from "../mui/handlers.js";
|
2023-01-04 19:44:28 +01:00
|
|
|
import { platform } from "../platform/foreground.js";
|
2023-04-14 19:16:08 +02:00
|
|
|
import { useAlertContext } from "../context/alert.js";
|
2021-06-16 22:17:12 +02:00
|
|
|
|
2021-11-16 17:59:53 +01:00
|
|
|
export function WelcomePage(): VNode {
|
2023-04-14 19:16:08 +02:00
|
|
|
const [settings, updateSettings] = useSettings();
|
|
|
|
const { safely } = useAlertContext();
|
2021-11-15 15:18:58 +01:00
|
|
|
const [diagnostics, timedOut] = useDiagnostics();
|
|
|
|
return (
|
|
|
|
<View
|
2023-04-14 19:16:08 +02:00
|
|
|
permissionToggle={{
|
|
|
|
value: settings.injectTalerSupport,
|
|
|
|
button: {
|
|
|
|
onClick: safely("update support injection", async () =>
|
|
|
|
updateSettings("injectTalerSupport", !settings.injectTalerSupport),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
}}
|
2021-11-15 15:18:58 +01:00
|
|
|
diagnostics={diagnostics}
|
|
|
|
timedOut={timedOut}
|
|
|
|
/>
|
|
|
|
);
|
2021-08-13 23:04:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ViewProps {
|
2022-04-27 19:33:52 +02:00
|
|
|
permissionToggle: ToggleHandler;
|
2021-11-15 15:18:58 +01:00
|
|
|
diagnostics: WalletDiagnostics | undefined;
|
|
|
|
timedOut: boolean;
|
2021-08-13 23:04:05 +02:00
|
|
|
}
|
2021-11-15 15:18:58 +01:00
|
|
|
export function View({
|
2022-04-27 19:33:52 +02:00
|
|
|
permissionToggle,
|
2021-11-15 15:18:58 +01:00
|
|
|
diagnostics,
|
|
|
|
timedOut,
|
2021-11-16 17:59:53 +01:00
|
|
|
}: ViewProps): VNode {
|
2022-03-14 19:20:32 +01:00
|
|
|
const { i18n } = useTranslationContext();
|
2021-11-15 15:18:58 +01:00
|
|
|
return (
|
2021-11-19 18:51:27 +01:00
|
|
|
<Fragment>
|
2022-03-28 19:03:59 +02:00
|
|
|
<Title>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>Browser Extension Installed!</i18n.Translate>
|
2022-03-28 19:03:59 +02:00
|
|
|
</Title>
|
2021-11-15 15:18:58 +01:00
|
|
|
<div>
|
2022-02-23 19:18:37 +01:00
|
|
|
<p>
|
2022-04-26 16:48:23 +02:00
|
|
|
<i18n.Translate>
|
|
|
|
You can open the GNU Taler Wallet using the combination{" "}
|
|
|
|
<pre style="font-weight: bold; display: inline;"><ALT+W></pre>
|
|
|
|
.
|
|
|
|
</i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
</p>
|
2022-04-26 16:48:23 +02:00
|
|
|
{!platform.isFirefox() && (
|
|
|
|
<Fragment>
|
|
|
|
<p>
|
|
|
|
<i18n.Translate>
|
|
|
|
Also pinning the GNU Taler Wallet to your Chrome browser allows
|
|
|
|
you to quick access without keyboard:
|
|
|
|
</i18n.Translate>
|
|
|
|
</p>
|
|
|
|
<ol style={{ paddingLeft: 40 }}>
|
|
|
|
<li>
|
|
|
|
<i18n.Translate>Click the puzzle icon</i18n.Translate>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<i18n.Translate>Search for GNU Taler Wallet</i18n.Translate>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<i18n.Translate>Click the pin icon</i18n.Translate>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
</Fragment>
|
|
|
|
)}
|
2022-03-28 19:03:59 +02:00
|
|
|
<SubTitle>
|
2023-04-14 19:16:08 +02:00
|
|
|
<i18n.Translate>Navigator</i18n.Translate>
|
2022-03-28 19:03:59 +02:00
|
|
|
</SubTitle>
|
2021-11-15 15:18:58 +01:00
|
|
|
<Checkbox
|
2023-04-18 15:47:53 +02:00
|
|
|
label={i18n.str`Inject Taler support in all pages`}
|
2023-04-14 19:16:08 +02:00
|
|
|
name="inject"
|
2022-02-23 19:18:37 +01:00
|
|
|
description={
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>
|
2023-04-14 19:16:08 +02:00
|
|
|
Disabling this option will make some web application not able to
|
|
|
|
trigger the wallet when clicking links but you will be able to
|
|
|
|
open the wallet using the keyboard shortcut
|
2022-02-23 19:44:14 +01:00
|
|
|
</i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
}
|
2022-04-27 19:33:52 +02:00
|
|
|
enabled={permissionToggle.value!}
|
|
|
|
onToggle={permissionToggle.button.onClick!}
|
2021-11-15 15:18:58 +01:00
|
|
|
/>
|
2022-03-28 19:03:59 +02:00
|
|
|
<SubTitle>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>Next Steps</i18n.Translate>
|
2022-03-28 19:03:59 +02:00
|
|
|
</SubTitle>
|
2021-11-15 15:18:58 +01:00
|
|
|
<a href="https://demo.taler.net/" style={{ display: "block" }}>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>Try the demo</i18n.Translate> »
|
2021-11-15 15:18:58 +01:00
|
|
|
</a>
|
|
|
|
<a href="https://demo.taler.net/" style={{ display: "block" }}>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>
|
|
|
|
Learn how to top up your wallet balance
|
|
|
|
</i18n.Translate>{" "}
|
|
|
|
»
|
2021-11-15 15:18:58 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
2021-11-19 18:51:27 +01:00
|
|
|
</Fragment>
|
2021-06-16 22:17:12 +02:00
|
|
|
);
|
|
|
|
}
|