From 30f86f8748a0d9c23538e972d30270a4f1e83941 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 7 May 2021 10:38:28 -0300
Subject: migrate to preact

---
 .../taler-wallet-webextension/src/renderHtml.tsx   | 25 +++++++++-------------
 1 file changed, 10 insertions(+), 15 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/renderHtml.tsx')

diff --git a/packages/taler-wallet-webextension/src/renderHtml.tsx b/packages/taler-wallet-webextension/src/renderHtml.tsx
index 3e66e5c5d..5574e96ea 100644
--- a/packages/taler-wallet-webextension/src/renderHtml.tsx
+++ b/packages/taler-wallet-webextension/src/renderHtml.tsx
@@ -23,12 +23,13 @@
 /**
  * Imports.
  */
-import React from "react";
 import {
   AmountJson,
   Amounts,
   amountFractionalBase,
 } from "@gnu-taler/taler-util";
+import { Component, ComponentChildren, JSX } from "preact";
+import { JSXInternal } from "preact/src/jsx";
 
 /**
  * Render amount as HTML, which non-breaking space between
@@ -87,7 +88,7 @@ interface CollapsibleProps {
  * Component that shows/hides its children when clicking
  * a heading.
  */
-export class Collapsible extends React.Component<
+export class Collapsible extends Component<
   CollapsibleProps,
   CollapsibleState
 > {
@@ -139,24 +140,18 @@ export function ExpanderText({ text }: ExpanderTextProps): JSX.Element {
   return <span>{text}</span>;
 }
 
-export interface LoadingButtonProps {
-  loading: boolean;
+export interface LoadingButtonProps extends JSX.HTMLAttributes<HTMLButtonElement> {
+  isLoading: boolean;
 }
 
-export function ProgressButton(
-  props: React.PropsWithChildren<LoadingButtonProps> &
-    React.DetailedHTMLProps<
-      React.ButtonHTMLAttributes<HTMLButtonElement>,
-      HTMLButtonElement
-    >,
-): JSX.Element {
+export function ProgressButton({isLoading, ...rest}: LoadingButtonProps): JSX.Element {
   return (
     <button
       className="pure-button pure-button-primary"
       type="button"
-      {...props}
+      {...rest}
     >
-      {props.loading ? (
+      {isLoading ? (
         <span>
           <object
             className="svg-icon svg-baseline"
@@ -164,13 +159,13 @@ export function ProgressButton(
           />
         </span>
       ) : null}{" "}
-      {props.children}
+      {rest.children}
     </button>
   );
 }
 
 export function PageLink(
-  props: React.PropsWithChildren<{ pageName: string }>,
+  props: { pageName: string, children?: ComponentChildren },
 ): JSX.Element {
   const url = chrome.extension.getURL(`/${props.pageName}`);
   return (
-- 
cgit v1.2.3

