From 0d86f84dc004c9d22d5df83182a58199d3349071 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 21 Jun 2021 10:07:56 -0300 Subject: fix some pixel and css classes and sync storybook --- .../.storybook/preview.js | 25 ++++++++++-- .../taler-wallet-webextension/src/i18n/index.ts | 24 ----------- .../src/popup/Balance.tsx | 4 +- .../src/popup/History.stories.tsx | 10 ----- .../src/popup/History.tsx | 2 +- .../src/popup/Transaction.stories.tsx | 12 +----- .../src/popup/Transaction.tsx | 24 +++++------ .../taler-wallet-webextension/src/popup/popup.tsx | 4 +- .../src/popupEntryPoint.tsx | 6 +-- .../taler-wallet-webextension/src/renderHtml.tsx | 12 +++--- .../taler-wallet-webextension/src/wallet/Pay.tsx | 2 +- .../src/wallet/Withdraw.tsx | 2 +- .../src/wallet/reset-required.tsx | 2 +- .../src/walletEntryPoint.tsx | 10 ++--- .../taler-wallet-webextension/static/popup.html | 3 +- .../static/style/popup.css | 46 ++++++++++++++++++++-- .../static/style/pure.css | 2 +- .../static/style/wallet.css | 25 ++++++------ .../taler-wallet-webextension/static/wallet.html | 3 +- 19 files changed, 116 insertions(+), 102 deletions(-) delete mode 100644 packages/taler-wallet-webextension/src/i18n/index.ts (limited to 'packages') diff --git a/packages/taler-wallet-webextension/.storybook/preview.js b/packages/taler-wallet-webextension/.storybook/preview.js index 6a7c8e867..1c07ba402 100644 --- a/packages/taler-wallet-webextension/.storybook/preview.js +++ b/packages/taler-wallet-webextension/.storybook/preview.js @@ -16,9 +16,6 @@ import { setupI18n } from "@gnu-taler/taler-util" import { strings } from '../src/i18n/strings.ts' -import '../static/style/pure.css' -import '../static/style/popup.css' -import '../static/style/wallet.css' const mockConfig = { backendURL: 'http://demo.taler.net', @@ -52,5 +49,27 @@ export const decorators = [ setupI18n(globals.locale, strings); return }, + (Story, { kind }) => { + if (kind.startsWith('popup')) { + return + } + if (kind.startsWith('wallet')) { + return
+ + + +
+ } + return
+

this story is not under wallet or popup, check title property

+ +
+ } // (Story) => ]; diff --git a/packages/taler-wallet-webextension/src/i18n/index.ts b/packages/taler-wallet-webextension/src/i18n/index.ts deleted file mode 100644 index 8db366a35..000000000 --- a/packages/taler-wallet-webextension/src/i18n/index.ts +++ /dev/null @@ -1,24 +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 - */ - -/** - * Translation helpers for React components and template literals. - */ - -/** - * Imports. - */ -export { strings } from "./strings.js"; diff --git a/packages/taler-wallet-webextension/src/popup/Balance.tsx b/packages/taler-wallet-webextension/src/popup/Balance.tsx index 77d2c4201..ae0eb07ff 100644 --- a/packages/taler-wallet-webextension/src/popup/Balance.tsx +++ b/packages/taler-wallet-webextension/src/popup/Balance.tsx @@ -143,7 +143,7 @@ export class BalancePage extends Component { const wallet = this.balance; if (this.gotError) { return ( -
+

{i18n.str`Error: could not retrieve balance information.`}

Click here for help and @@ -165,7 +165,7 @@ export class BalancePage extends Component { ); }); return listing.length > 0 ? ( -

{listing}
+
{listing}
) : ( ); diff --git a/packages/taler-wallet-webextension/src/popup/History.stories.tsx b/packages/taler-wallet-webextension/src/popup/History.stories.tsx index a82863b43..8eef7dc31 100644 --- a/packages/taler-wallet-webextension/src/popup/History.stories.tsx +++ b/packages/taler-wallet-webextension/src/popup/History.stories.tsx @@ -32,16 +32,6 @@ import { HistoryView as TestedComponent } from './History'; export default { title: 'popup/transaction/list', component: TestedComponent, - decorators: [ - (Story: any) =>
- - - -
- -
-
- ], }; const commonTransaction = { diff --git a/packages/taler-wallet-webextension/src/popup/History.tsx b/packages/taler-wallet-webextension/src/popup/History.tsx index f055f6cb0..e76e656c1 100644 --- a/packages/taler-wallet-webextension/src/popup/History.tsx +++ b/packages/taler-wallet-webextension/src/popup/History.tsx @@ -42,7 +42,7 @@ export function HistoryPage(props: any): JSX.Element { } export function HistoryView({ list }: { list: Transaction[] }) { - return
+ return
{list.map((tx, i) => ( ))} diff --git a/packages/taler-wallet-webextension/src/popup/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/popup/Transaction.stories.tsx index 38a348387..48f945783 100644 --- a/packages/taler-wallet-webextension/src/popup/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/popup/Transaction.stories.tsx @@ -32,16 +32,6 @@ import { TransactionView as TestedComponent } from './Transaction'; export default { title: 'popup/transaction/details', component: TestedComponent, - decorators: [ - (Story: any) =>
- - - -
- -
-
- ], }; const commonTransaction = { @@ -76,7 +66,7 @@ const exampleData = { }, orderId: '2021.167-03NPY6MCYMVGT', products: [], - summary: 'the summary', + summary: "Essay: Why the Devil's Advocate Doesn't Help Reach the Truth", fulfillmentMessage: '', }, proposalId: '1EMJJH8EP1NX3XF7733NCYS2DBEJW4Q2KA5KEB37MCQJQ8Q5HMC0', diff --git a/packages/taler-wallet-webextension/src/popup/Transaction.tsx b/packages/taler-wallet-webextension/src/popup/Transaction.tsx index 2db4cc1af..6a6876c02 100644 --- a/packages/taler-wallet-webextension/src/popup/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/popup/Transaction.tsx @@ -82,8 +82,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac Amounts.parseOrThrow(transaction.amountEffective), ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} From {transaction.exchangeBaseUrl} @@ -107,8 +107,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} To {transaction.info.merchant.name} @@ -145,8 +145,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac Amounts.parseOrThrow(transaction.amountEffective), ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} To {transaction.targetPaytoUri} @@ -165,8 +165,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac Amounts.parseOrThrow(transaction.amountEffective), ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} From {transaction.exchangeBaseUrl} @@ -185,8 +185,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac Amounts.parseOrThrow(transaction.amountEffective), ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} From {transaction.merchantBaseUrl} @@ -205,8 +205,8 @@ export function TransactionView({ transaction, onDelete, onBack }: WalletTransac Amounts.parseOrThrow(transaction.amountEffective), ).amount return ( -
-
+
+
{transaction.timestamp.t_ms === "never" ? "never" : format(transaction.timestamp.t_ms, 'dd/MM/yyyy HH:mm:ss')} From {transaction.info.merchant.name} diff --git a/packages/taler-wallet-webextension/src/popup/popup.tsx b/packages/taler-wallet-webextension/src/popup/popup.tsx index 95b87fad0..3692a0537 100644 --- a/packages/taler-wallet-webextension/src/popup/popup.tsx +++ b/packages/taler-wallet-webextension/src/popup/popup.tsx @@ -49,7 +49,7 @@ function Tab(props: TabProps): JSX.Element { cssClass = "active"; } return ( - + {props.children} ); @@ -57,7 +57,7 @@ function Tab(props: TabProps): JSX.Element { export function WalletNavBar({ current }: { current?: string }) { return ( -