From ae7121a1d54e0a624b3ab477a6639e5328a333eb Mon Sep 17 00:00:00 2001 From: Kilerd Chan Date: Sat, 19 Oct 2024 12:48:27 +0800 Subject: [PATCH 1/2] fix: fix the sidebar and scroll the content only --- frontend/src/App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index b779d194..ac73f1ef 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -77,11 +77,11 @@ export default function App() { }, [mutate]); return ( -
+
-
+
From c5e7609be56b93fb9b5bbe2f9fff928caf85edd3 Mon Sep 17 00:00:00 2001 From: Kilerd Chan Date: Sat, 19 Oct 2024 12:51:33 +0800 Subject: [PATCH 2/2] style: make prettier happy --- .../components/AccountBalanceHistoryGraph.tsx | 6 ++---- frontend/src/components/AccountLine.tsx | 3 +-- frontend/src/components/Amount.tsx | 8 ++------ frontend/src/components/ReportGraph.tsx | 6 ++---- .../tableView/TableViewTransactionLine.tsx | 9 +++------ frontend/src/pages/SingleAccount.tsx | 17 +++++------------ 6 files changed, 15 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/AccountBalanceHistoryGraph.tsx b/frontend/src/components/AccountBalanceHistoryGraph.tsx index 4469cd38..132ec7d3 100644 --- a/frontend/src/components/AccountBalanceHistoryGraph.tsx +++ b/frontend/src/components/AccountBalanceHistoryGraph.tsx @@ -81,12 +81,10 @@ export function AccountBalanceHistoryGraph(props: Props) { > - + } /> {series.map((it) => ( - + ))} diff --git a/frontend/src/components/AccountLine.tsx b/frontend/src/components/AccountLine.tsx index 35769155..91386cce 100644 --- a/frontend/src/components/AccountLine.tsx +++ b/frontend/src/components/AccountLine.tsx @@ -93,8 +93,7 @@ export default function AccountLine({ data, spacing }: Props) { {isShow && Object.keys(data.children) .sort() - .map((child) => )} + .map((child) => )} ); } diff --git a/frontend/src/components/Amount.tsx b/frontend/src/components/Amount.tsx index cb97b520..cede293e 100644 --- a/frontend/src/components/Amount.tsx +++ b/frontend/src/components/Amount.tsx @@ -36,12 +36,8 @@ export default function Amount({ amount, currency, negative, mask, className }: return ( {isNegative && -} - - {commodity?.prefix} - - - {maskedValue} - + {commodity?.prefix} + {maskedValue} {commodity?.suffix && {commodity?.suffix}} {shouldDisplayCurrencyName && {currency}} diff --git a/frontend/src/components/ReportGraph.tsx b/frontend/src/components/ReportGraph.tsx index 4b9d45f9..9383e174 100644 --- a/frontend/src/components/ReportGraph.tsx +++ b/frontend/src/components/ReportGraph.tsx @@ -59,8 +59,7 @@ export default function ReportGraph(props: Props) { - + } /> @@ -68,8 +67,7 @@ export default function ReportGraph(props: Props) { - + diff --git a/frontend/src/components/journalLines/tableView/TableViewTransactionLine.tsx b/frontend/src/components/journalLines/tableView/TableViewTransactionLine.tsx index 3c2341f3..8ca80983 100644 --- a/frontend/src/components/journalLines/tableView/TableViewTransactionLine.tsx +++ b/frontend/src/components/journalLines/tableView/TableViewTransactionLine.tsx @@ -51,8 +51,7 @@ export default function TableViewTransactionLine({ data }: Props) { const summary = calculate(data); const hasDocuments = data.metas.some((meta) => meta.key === 'document'); return ( - + {time} @@ -64,15 +63,13 @@ export default function TableViewTransactionLine({ data }: Props) { {data.links && data.links.map((it) => ( - handleLinkClick(it)()}> + handleLinkClick(it)()}> ^{it} ))} {data.tags && data.tags.map((tag) => ( - handleTagClick(tag)()}> + handleTagClick(tag)()}> #{tag} ))} diff --git a/frontend/src/pages/SingleAccount.tsx b/frontend/src/pages/SingleAccount.tsx index 4d353ba9..825c46b5 100644 --- a/frontend/src/pages/SingleAccount.tsx +++ b/frontend/src/pages/SingleAccount.tsx @@ -30,10 +30,7 @@ function SingleAccount() { const [lightboxSrc, setLightboxSrc] = useState(undefined); const { data: account, error } = useSWR(`/api/accounts/${accountName}`, fetcher); - const { - data: account_balance_data, - error: account_balance_error, - } = useSWR(`/api/accounts/${accountName}/balances`, fetcher); + const { data: account_balance_data, error: account_balance_error } = useSWR(`/api/accounts/${accountName}/balances`, fetcher); const ledgerTitle = useAtomValue(titleAtom); useDocumentTitle(`${accountName} | Accounts - ${ledgerTitle}`); @@ -56,8 +53,7 @@ function SingleAccount() {
-

{account.alias ?? account.name}

+

{account.alias ?? account.name}

{account.status} @@ -158,12 +154,10 @@ function SingleAccount() { render={(data: Document[]) => ( <> -
+
{data.map((document, idx) => ( - setLightboxSrc(path)} key={idx} uri={document.path} - filename={document.path} /> + setLightboxSrc(path)} key={idx} uri={document.path} filename={document.path} /> ))}
@@ -190,8 +184,7 @@ function SingleAccount() { {Object.entries(account?.amount.detail ?? {}).map(([commodity, amount]) => ( - + ))}