diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup')
5 files changed, 10 insertions, 159 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index a5f24470e..f5e721033 100644 --- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx @@ -17,10 +17,11 @@ import { Amounts, Balance, i18n } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { BalanceTable } from "../components/BalanceTable"; +import { JustInDevMode } from "../components/JustInDevMode"; import { Loading } from "../components/Loading"; import { LoadingError } from "../components/LoadingError"; import { MultiActionButton } from "../components/MultiActionButton"; -import { ButtonPrimary } from "../components/styled"; +import { ButtonBoxPrimary, ButtonPrimary } from "../components/styled"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook"; import { PageLink } from "../renderHtml"; import * as wxApi from "../wxApi"; @@ -77,8 +78,10 @@ export function BalanceView({ <Fragment> <p> <i18n.Translate> - You have no balance to show. Need some{" "} - <PageLink pageName="/welcome">help</PageLink> getting started? + You have no balance to show. + <a href="https://demo.taler.net/" style={{ display: "block" }}> + Learn how to top up your wallet balance ยป + </a> </i18n.Translate> </p> <footer style={{ justifyContent: "space-between" }}> @@ -109,6 +112,9 @@ export function BalanceView({ onClick={(c) => goToWalletDeposit(c)} /> )} + <JustInDevMode> + <ButtonBoxPrimary onClick={() => null}>enter uri</ButtonBoxPrimary> + </JustInDevMode> </footer> </Fragment> ); diff --git a/packages/taler-wallet-webextension/src/popup/Popup.stories.tsx b/packages/taler-wallet-webextension/src/popup/Popup.stories.tsx deleted file mode 100644 index 5009684c5..000000000 --- a/packages/taler-wallet-webextension/src/popup/Popup.stories.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 Taler Systems S.A. - - 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/> - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { createExample } from "../test-utils"; -import { NavBar as TestedComponent } from "../NavigationBar"; - -export default { - title: "popup/header", - // component: TestedComponent, - argTypes: { - onRetry: { action: "onRetry" }, - onDelete: { action: "onDelete" }, - onBack: { action: "onBack" }, - }, -}; - -export const OnBalance = createExample(TestedComponent, { - devMode: false, - path: "/balance", -}); - -export const OnHistoryWithDevMode = createExample(TestedComponent, { - devMode: true, - path: "/history", -}); diff --git a/packages/taler-wallet-webextension/src/popup/Settings.stories.tsx b/packages/taler-wallet-webextension/src/popup/Settings.stories.tsx deleted file mode 100644 index 069157475..000000000 --- a/packages/taler-wallet-webextension/src/popup/Settings.stories.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2021 Taler Systems S.A. - - 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/> - */ - -/** - * - * @author Sebastian Javier Marchano (sebasjm) - */ - -import { createExample } from "../test-utils"; -import { SettingsView as TestedComponent } from "./Settings"; - -export default { - title: "popup/settings", - component: TestedComponent, - argTypes: { - setDeviceName: () => Promise.resolve(), - }, -}; - -export const AllOff = createExample(TestedComponent, {}); - -export const OneChecked = createExample(TestedComponent, { - permissionsEnabled: true, -}); diff --git a/packages/taler-wallet-webextension/src/popup/Settings.tsx b/packages/taler-wallet-webextension/src/popup/Settings.tsx deleted file mode 100644 index a7cdf9cc0..000000000 --- a/packages/taler-wallet-webextension/src/popup/Settings.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/* - This file is part of TALER - (C) 2016 GNUnet e.V. - - 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. - - 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 - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ - -import { i18n } from "@gnu-taler/taler-util"; -import { Fragment, h, VNode } from "preact"; -import { Checkbox } from "../components/Checkbox"; -import { useExtendedPermissions } from "../hooks/useExtendedPermissions"; - -export function SettingsPage(): VNode { - const [permissionsEnabled, togglePermissions] = useExtendedPermissions(); - - return ( - <SettingsView - permissionsEnabled={permissionsEnabled} - togglePermissions={togglePermissions} - /> - ); -} - -export interface ViewProps { - permissionsEnabled: boolean; - togglePermissions: () => void; -} - -export function SettingsView({ - permissionsEnabled, - togglePermissions, -}: ViewProps): VNode { - return ( - <Fragment> - <section> - <h2> - <i18n.Translate>Permissions</i18n.Translate> - </h2> - <Checkbox - label="Automatically open wallet based on page content" - name="perm" - description="(Enabling this option below will make using the wallet faster, but requires more permissions from your browser.)" - enabled={permissionsEnabled} - onToggle={togglePermissions} - /> - </section> - <footer style={{ justifyContent: "space-around" }}> - <a - target="_blank" - rel="noopener noreferrer" - style={{ color: "darkgreen", textDecoration: "none" }} - href={ - // eslint-disable-next-line no-undef - chrome.runtime - ? // eslint-disable-next-line no-undef - chrome.runtime.getURL(`/static/wallet.html#/settings`) - : "#" - } - > - VIEW MORE SETTINGS - </a> - </footer> - </Fragment> - ); -} diff --git a/packages/taler-wallet-webextension/src/popup/index.stories.tsx b/packages/taler-wallet-webextension/src/popup/index.stories.tsx index 3abb80021..341b06b41 100644 --- a/packages/taler-wallet-webextension/src/popup/index.stories.tsx +++ b/packages/taler-wallet-webextension/src/popup/index.stories.tsx @@ -22,7 +22,6 @@ import * as a1 from "../wallet/AddNewActionView.stories"; import * as a2 from "./Balance.stories"; import * as a3 from "./DeveloperPage.stories"; -import * as a5 from "./Popup.stories"; import * as a6 from "./TalerActionFound.stories"; -export default [a1, a2, a3, a5, a6]; +export default [a1, a2, a3, a6]; |