From 47787c0b0b846d5f4a057661efdd05d8786032f1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 6 Apr 2020 23:32:01 +0530 Subject: make linter less grumpy --- src/webex/renderHtml.tsx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/webex/renderHtml.tsx') diff --git a/src/webex/renderHtml.tsx b/src/webex/renderHtml.tsx index b6ff1248c..8fc6a6a63 100644 --- a/src/webex/renderHtml.tsx +++ b/src/webex/renderHtml.tsx @@ -29,14 +29,13 @@ import { DenominationRecord } from "../types/dbTypes"; import { ExchangeWithdrawDetails } from "../types/walletTypes"; import * as i18n from "./i18n"; import React from "react"; -import ReactDOM from "react-dom"; import { stringifyTimestamp } from "../util/time"; /** * Render amount as HTML, which non-breaking space between * decimal value and currency. */ -export function renderAmount(amount: AmountJson | string) { +export function renderAmount(amount: AmountJson | string): JSX.Element { let a; if (typeof amount === "string") { a = Amounts.parse(amount); @@ -54,14 +53,17 @@ export function renderAmount(amount: AmountJson | string) { ); } -export const AmountView = ({ amount }: { amount: AmountJson | string }) => - renderAmount(amount); +export const AmountView = ({ + amount, +}: { + amount: AmountJson | string; +}): JSX.Element => renderAmount(amount); /** * Abbreviate a string to a given length, and show the full * string on hover as a tooltip. */ -export function abbrev(s: string, n = 5) { +export function abbrev(s: string, n = 5): JSX.Element { let sAbbrev = s; if (s.length > n) { sAbbrev = s.slice(0, n) + ".."; @@ -94,12 +96,12 @@ export class Collapsible extends React.Component< super(props); this.state = { collapsed: props.initiallyCollapsed }; } - render() { - const doOpen = (e: any) => { + render(): JSX.Element { + const doOpen = (e: any): void => { this.setState({ collapsed: false }); e.preventDefault(); }; - const doClose = (e: any) => { + const doClose = (e: any): void => { this.setState({ collapsed: true }); e.preventDefault(); }; @@ -188,7 +190,7 @@ function FeeDetailsView(props: { countByPub[x.denomPub] = c; }); - function row(denom: DenominationRecord) { + function row(denom: DenominationRecord): JSX.Element { return ( {countByPub[denom.denomPub] + "x"} @@ -296,7 +298,7 @@ interface ExpanderTextProps { /** * Show a heading with a toggle to show/hide the expandable content. */ -export function ExpanderText({ text }: ExpanderTextProps) { +export function ExpanderText({ text }: ExpanderTextProps): JSX.Element { return {text}; } @@ -310,7 +312,7 @@ export function ProgressButton( React.ButtonHTMLAttributes, HTMLButtonElement >, -) { +): JSX.Element { return (