From 08bc5c6d8913513ed8e4a2038968fa8f05969e90 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 20 Sep 2021 00:18:52 -0300
Subject: fix some feedback from belen

---
 .../taler-wallet-webextension/src/components/ExchangeToS.tsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
index 0325daa04..b7b0d2fd9 100644
--- a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
+++ b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
@@ -28,6 +28,11 @@ export function ExchangeXmlTos({ doc }: { doc: Document }) {
   </Fragment>
 }
 
+/**
+ * Map XML elements into HTML
+ * @param child 
+ * @returns 
+ */
 function renderChild(child: Element): VNode {
   const children = Array.from(child.children)
   switch (child.nodeName) {
@@ -55,13 +60,16 @@ function renderChild(child: Element): VNode {
   }
 }
 
+/**
+ * Simple anchor with a state persisted into 'data-open' prop
+ * @returns 
+ */
 function AnchorWithOpenState(props: JSXInternal.HTMLAttributes<HTMLAnchorElement>) {
   const [open, setOpen] = useState<boolean>(false)
   function doClick(e: JSXInternal.TargetedMouseEvent<HTMLAnchorElement>) {
     setOpen(!open);
-    e.stopPropagation();
     e.preventDefault();
   }
-  return <a data-open={JSON.stringify(open)} onClick={doClick} {...props} />
+  return <a data-open={open ? 'true' : 'false'} onClick={doClick} {...props} />
 }
 
-- 
cgit v1.2.3

