From 3dd1047b085fa7795f322c5829f39208465bff13 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 29 Mar 2022 09:58:06 -0300 Subject: added react eslint and fix most of the warns --- .../taler-wallet-webextension/src/components/Banner.stories.tsx | 4 ++-- .../src/components/CheckboxOutlined.tsx | 2 +- .../taler-wallet-webextension/src/components/ErrorMessage.tsx | 2 +- .../taler-wallet-webextension/src/components/ExchangeToS.tsx | 2 +- packages/taler-wallet-webextension/src/components/LogoHeader.tsx | 4 ++-- packages/taler-wallet-webextension/src/components/Part.tsx | 5 ++--- .../src/components/PendingTransactions.stories.tsx | 5 ++--- .../src/components/PendingTransactions.tsx | 9 ++++----- .../taler-wallet-webextension/src/components/styled/index.tsx | 1 - 9 files changed, 15 insertions(+), 19 deletions(-) (limited to 'packages/taler-wallet-webextension/src/components') diff --git a/packages/taler-wallet-webextension/src/components/Banner.stories.tsx b/packages/taler-wallet-webextension/src/components/Banner.stories.tsx index f023e0d83..4d328a723 100644 --- a/packages/taler-wallet-webextension/src/components/Banner.stories.tsx +++ b/packages/taler-wallet-webextension/src/components/Banner.stories.tsx @@ -51,7 +51,7 @@ function SignalWifiOffIcon({ ...rest }: any): VNode { return ; } -export const BasicExample = () => ( +export const BasicExample = (): VNode => (

@@ -86,7 +86,7 @@ export const BasicExample = () => ( ); -export const PendingOperation = () => ( +export const PendingOperation = (): VNode => ( ( +const Tick = (): VNode => ( */ -import { VNode, h, ComponentChildren } from "preact"; +import { h, VNode } from "preact"; import { useState } from "preact/hooks"; import arrowDown from "../svg/chevron-down.svg"; import { ErrorBox } from "./styled/index.js"; diff --git a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx index a71108c50..6aee838a1 100644 --- a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx +++ b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx @@ -23,7 +23,7 @@ export function ExchangeXmlTos({ doc }: { doc: Document }): VNode {

The exchange send us an xml but there is no node with - 'ids=terms-of-service'. This is the content: + 'ids=terms-of-service'. This is the content:

{new XMLSerializer().serializeToString(doc)}
diff --git a/packages/taler-wallet-webextension/src/components/LogoHeader.tsx b/packages/taler-wallet-webextension/src/components/LogoHeader.tsx index 573221614..9e7bfc642 100644 --- a/packages/taler-wallet-webextension/src/components/LogoHeader.tsx +++ b/packages/taler-wallet-webextension/src/components/LogoHeader.tsx @@ -14,10 +14,10 @@ GNU Taler; see the file COPYING. If not, see */ -import { h } from "preact"; +import { h, VNode } from "preact"; import logo from "../svg/logo-2021.svg"; -export function LogoHeader() { +export function LogoHeader(): VNode { return (
*/ -import { AmountLike } from "@gnu-taler/taler-util"; -import { ExtraLargeText, LargeText, SmallLightText } from "./styled/index.js"; import { h, VNode } from "preact"; +import { ExtraLargeText, LargeText, SmallLightText } from "./styled/index.js"; export type Kind = "positive" | "negative" | "neutral"; interface Props { @@ -24,7 +23,7 @@ interface Props { kind: Kind; big?: boolean; } -export function Part({ text, title, kind, big }: Props) { +export function Part({ text, title, kind, big }: Props): VNode { const Text = big ? ExtraLargeText : LargeText; return (
diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx index 27146479b..32f970f9a 100644 --- a/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx +++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.stories.tsx @@ -19,14 +19,13 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { PendingTransactionsView as TestedComponent } from "./PendingTransactions.js"; -import { Fragment, h, VNode } from "preact"; -import { createExample } from "../test-utils.js"; import { TalerProtocolTimestamp, Transaction, TransactionType, } from "@gnu-taler/taler-util"; +import { createExample } from "../test-utils.js"; +import { PendingTransactionsView as TestedComponent } from "./PendingTransactions.js"; export default { title: "component/PendingTransactions", diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx index 0a101acd0..2d8a776cd 100644 --- a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx +++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx @@ -4,20 +4,19 @@ import { NotificationType, Transaction, } from "@gnu-taler/taler-util"; -import { PendingTaskInfo } from "@gnu-taler/taler-wallet-core"; -import { Fragment, h, JSX } from "preact"; +import { Fragment, h, JSX, VNode } from "preact"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { Avatar } from "../mui/Avatar.js"; import { Typography } from "../mui/Typography.js"; +import * as wxApi from "../wxApi.js"; import Banner from "./Banner.js"; import { Time } from "./Time.js"; -import * as wxApi from "../wxApi.js"; interface Props extends JSX.HTMLAttributes { goToTransaction: (id: string) => void; } -export function PendingTransactions({ goToTransaction }: Props) { +export function PendingTransactions({ goToTransaction }: Props): VNode { const state = useAsyncAsHook(wxApi.getTransactions, [ NotificationType.WithdrawGroupFinished, ]); @@ -43,7 +42,7 @@ export function PendingTransactionsView({ }: { goToTransaction: (id: string) => void; transactions: Transaction[]; -}) { +}): VNode { return (