[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] branch master updated: copying pybank's look
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] branch master updated: copying pybank's look - fix public accounts bar. WIP |
Date: |
Thu, 07 Apr 2022 11:57:03 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository merchant-backoffice.
The following commit(s) were added to refs/heads/master by this push:
new 54457bc copying pybank's look - fix public accounts bar. WIP
54457bc is described below
commit 54457bc6bdfe9ee61c3678012729f7199abf2a81
Author: ms <ms@taler.net>
AuthorDate: Thu Apr 7 11:56:42 2022 +0200
copying pybank's look - fix public accounts bar. WIP
---
packages/bank/src/pages/home/index.tsx | 44 ++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/packages/bank/src/pages/home/index.tsx
b/packages/bank/src/pages/home/index.tsx
index bb30682..90b7827 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -1453,33 +1453,36 @@ function PublicHistories(Props: any): VNode {
* Show the account specified in the props, or just one
* from the list if that's not given.
*/
- if (typeof showAccount === "undefined" && Object.keys(txs).length > 0)
- setShowAccount(Object.keys(txs).pop());
+ if (typeof showAccount === "undefined" && data.publicAccounts.length > 0)
+ setShowAccount(data.publicAccounts[1].accountLabel);
console.log(`Public history tab: ${showAccount}`);
// Ask first story of all the public accounts.
for (const account of data.publicAccounts) {
console.log("Asking transactions for", account.accountLabel)
+ const isSelected = account.accountLabel == showAccount;
accountsBar.push(
- <li>
- <a
- class={(account.accountLabel == showAccount) ? "pure-menu-item
pure-menu" : "pure-menu-item pure-menu-selected"}
- onClick={() =>
setShowAccount(account.accountLabel)}>{account.accountLabel}</a>
+ <li class={isSelected ? "pure-menu-selected pure-menu-item" :
"pure-menu-item pure-menu"}>
+ <a href="#"
+ class="pure-menu-link"
+ onClick={() =>
setShowAccount(account.accountLabel)}>{account.accountLabel}</a>
</li>
);
txs[account.accountLabel] = <Transactions
accountLabel={account.accountLabel} pageNumber={0} />
}
- return <Fragment>
+ return (<Fragment>
<h1 class="nav">{i18n`History of public accounts`}</h1>
<section id="main">
- <div name="accountMenu" class="pure-menu pure-menu-horizontal">
- <ul class="pure-menu-list">{accountsBar}</ul>
- {typeof showAccount !== "undefined" ? txs[showAccount] : <p>No public
transactions found.</p>}
- {Props.children}
- </div>
+ <article>
+ <div class="pure-menu pure-menu-horizontal" name="accountMenu">
+ <ul class="pure-menu-list">{accountsBar}</ul>
+ {typeof showAccount !== "undefined" ? txs[showAccount] : <p>No
public transactions found.</p>}
+ {Props.children}
+ </div>
+ </article>
</section>
- </Fragment>;
+ </Fragment>);
}
/**
@@ -1495,11 +1498,16 @@ export function BankHome(): VNode {
if (pageState.showPublicHistories) {
return (<SWRWithoutCredentials baseUrl={getRootPath()}>
- <PublicHistories pageStateSetter={pageStateSetter}>
- <a onClick={() => {
- pageStateSetter((prevState: PageStateType) =>
- ({...prevState, showPublicHistories: false}))}}>Go back</a>
- </PublicHistories>
+ <PageContext.Provider value={[pageState, pageStateSetter]}>
+ <BankFrame>
+ <PublicHistories pageStateSetter={pageStateSetter}>
+ <br />
+ <a class="pure-button" onClick={() => {
+ pageStateSetter((prevState: PageStateType) =>
+ ({...prevState, showPublicHistories: false}))}}>Go back</a>
+ </PublicHistories>
+ </BankFrame>
+ </PageContext.Provider>
</SWRWithoutCredentials>);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant-backoffice] branch master updated: copying pybank's look - fix public accounts bar. WIP,
gnunet <=