gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 02/02: stories resize (wip)


From: gnunet
Subject: [taler-wallet-core] 02/02: stories resize (wip)
Date: Wed, 14 Sep 2022 13:20:19 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

commit 62911fd59364e709f1a3e904090f2f55ecd0db7c
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Sep 14 08:14:00 2022 -0300

    stories resize (wip)
---
 .../src/NavigationBar.tsx                          |  4 +--
 packages/taler-wallet-webextension/src/stories.tsx | 39 ++++++++++++++++++++--
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx 
b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index 9b222cdb..f6c56af1 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -143,7 +143,7 @@ export function PopupNavBar({ path = "" }: { path?: string 
}): VNode {
       <div style={{ display: "flex", paddingTop: 4, justifyContent: "right" }}>
         <a href={Pages.qr}>
           <SvgIcon
-            title={i18n.str`QR Reader`}
+            title={i18n.str`QR Reader and Taler URI`}
             dangerouslySetInnerHTML={{ __html: qrIcon }}
             color="white"
           />
@@ -189,7 +189,7 @@ export function WalletNavBar({ path = "" }: { path?: string 
}): VNode {
         >
           <a href={Pages.qr}>
             <SvgIcon
-              title={i18n.str`QR Reader`}
+              title={i18n.str`QR Reader and Taler URI`}
               dangerouslySetInnerHTML={{ __html: qrIcon }}
               color="white"
             />
diff --git a/packages/taler-wallet-webextension/src/stories.tsx 
b/packages/taler-wallet-webextension/src/stories.tsx
index 09261d6f..02cc1539 100644
--- a/packages/taler-wallet-webextension/src/stories.tsx
+++ b/packages/taler-wallet-webextension/src/stories.tsx
@@ -62,7 +62,7 @@ const Page = styled.div`
 `;
 
 const SideBar = styled.div`
-  min-width: 200px;
+  min-width: var(--with-size);
   height: calc(100vh - 20px);
   overflow-y: visible;
   overflow-x: hidden;
@@ -106,6 +106,35 @@ const SideBar = styled.div`
   }
 `;
 
+const ResizeHandleDiv = styled.div`
+  width: 10px;
+  background: #ddd;
+  cursor: ew-resize;
+`;
+
+function ResizeHandle({ onUpdate }: { onUpdate: (x: number) => void }): VNode {
+  const [start, setStart] = useState<number | undefined>(undefined);
+  return (
+    <ResizeHandleDiv
+      onMouseDown={(e: any) => {
+        setStart(e.pageX);
+        console.log("active", e.pageX);
+        return false;
+      }}
+      onMouseMove={(e: any) => {
+        if (start !== undefined) {
+          onUpdate(e.pageX - start);
+        }
+        return false;
+      }}
+      onMouseUp={() => {
+        setStart(undefined);
+        return false;
+      }}
+    />
+  );
+}
+
 const Content = styled.div`
   width: 100%;
   padding: 20px;
@@ -380,11 +409,12 @@ function Application(): VNode {
   const ExampleContent = getContentForExample(selected);
 
   const GroupWrapper = getWrapperForGroup(selected?.group || "default");
+  const [sidebarWidth, setSidebarWidth] = useState(200);
 
   return (
     <Page>
       <LiveReload />
-      <SideBar>
+      <SideBar style={{ "--with-size": `${sidebarWidth}px` }}>
         {allExamples.map((e) => (
           <ExampleList
             key={e.title}
@@ -401,6 +431,11 @@ function Application(): VNode {
         ))}
         <hr />
       </SideBar>
+      <ResizeHandle
+        onUpdate={(x) => {
+          setSidebarWidth((s) => s + x);
+        }}
+      />
       <Content>
         <ErrorReport selected={selected}>
           <GroupWrapper>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]