Skip to content

Commit 14d6e3d

Browse files
committed
Add terminal button
format sats flow info
1 parent 322bc65 commit 14d6e3d

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

apps/frontend/src/components/bookkeeper/BkprRoot/BkprRoot.tsx

+34-16
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ const Bookkeeper = () => {
4646

4747
return (
4848
<div data-testid="bookkeeper-container">
49-
<div className="fs-4 p-0 ps-3 fw-bold text-dark">Bookkeeper Dashboard</div>
49+
<div className="fs-4 p-0 ps-3 d-flex fw-bold text-dark">
50+
Bookkeeper Dashboard
51+
<button
52+
tabIndex={0}
53+
type="submit"
54+
className="btn-rounded bg-primary fs-6 ms-3"
55+
onClick={() => navigate('/bookkeeper/terminal')}
56+
>
57+
Terminal
58+
</button>
59+
</div>
5060
<Container fluid className="">
5161
<Row className="">
5262
<Col lg={5} md={12} xs={12} className="">
@@ -62,15 +72,25 @@ const Bookkeeper = () => {
6272
<Card.Body className="px-0 pt-0">
6373
Track channel and wallet balances over time.
6474
<div className="mt-5 d-flex flex-column align-items-start">
65-
<span className="fs-1 fw-bold text-primary">{bookkeeperLandingData?.balanceSheetSummary.numberOfChannels}</span>
75+
<span className="fs-1 fw-bold text-primary">
76+
{bookkeeperLandingData?.balanceSheetSummary.numberOfChannels}
77+
</span>
6678
<span className="fs-6 text-dark">Total Number of Channels</span>
6779
</div>
6880
<div className="mt-3 d-flex flex-column align-items-start">
69-
<span className="fs-1 fw-bold text-primary">{formatBalance(bookkeeperLandingData?.balanceSheetSummary.balanceInChannels || 0)}</span>
81+
<span className="fs-1 fw-bold text-primary">
82+
{formatBalance(
83+
bookkeeperLandingData?.balanceSheetSummary.balanceInChannels || 0,
84+
)}
85+
</span>
7086
<span className="fs-6 text-dark">Total Balance in Channels</span>
7187
</div>
7288
<div className="mt-3 d-flex flex-column align-items-start">
73-
<span className="fs-1 fw-bold text-primary">{formatBalance(bookkeeperLandingData?.balanceSheetSummary.balanceInWallet || 0)}</span>
89+
<span className="fs-1 fw-bold text-primary">
90+
{formatBalance(
91+
bookkeeperLandingData?.balanceSheetSummary.balanceInWallet || 0,
92+
)}
93+
</span>
7494
<span className="fs-6 text-dark">Total Balance in Wallet</span>
7595
</div>
7696
</Card.Body>
@@ -103,19 +123,17 @@ const Bookkeeper = () => {
103123
<Card.Body className="px-0 pt-0">
104124
Track inflows and outflow events over time.
105125
<Row className="g-3 flex-wrap">
106-
<Col
107-
lg={12}
108-
xl={6}
109-
className="d-flex flex-column align-items-start"
110-
>
111-
<SatsFlowInfo label={'Inflow this month'} value={bookkeeperLandingData?.satsFlowSummary.inflows || 0} />
126+
<Col lg={12} xl={6} className="d-flex flex-column align-items-start">
127+
<SatsFlowInfo
128+
label={'Inflow this month'}
129+
value={bookkeeperLandingData?.satsFlowSummary.inflows || 0}
130+
/>
112131
</Col>
113-
<Col
114-
lg={12}
115-
xl={6}
116-
className="d-flex flex-column align-items-start"
117-
>
118-
<SatsFlowInfo label={'Outflow this month'} value={-(bookkeeperLandingData?.satsFlowSummary.outflows || 0)} />
132+
<Col lg={12} xl={6} className="d-flex flex-column align-items-start">
133+
<SatsFlowInfo
134+
label={'Outflow this month'}
135+
value={-(bookkeeperLandingData?.satsFlowSummary.outflows || 0)}
136+
/>
119137
</Col>
120138
</Row>
121139
</Card.Body>

apps/frontend/src/components/bookkeeper/BkprRoot/SatsFlowInfo.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22

33
import './SatsFlowInfo.scss';
4+
import { format } from 'd3';
5+
import { BALANCE_FORMAT } from '../../../utilities/constants';
46

57
interface SatsFlowInfoProps {
68
label: string;
@@ -14,10 +16,12 @@ const SatsFlowInfo: React.FC<SatsFlowInfoProps> = ({ label, value }) => {
1416
return 'text-primary';
1517
};
1618

19+
const formatBalance = format(BALANCE_FORMAT);
20+
1721
return (
1822
<div className="mt-3 d-flex flex-column align-items-start">
1923
<span className="fs-7 text-dark">{label}</span>
20-
<span className={`fs-3 fw-bold ${getValueColor()}`}>{value}</span>
24+
<span className={`fs-3 fw-bold ${getValueColor()}`}>{formatBalance(value)}</span>
2125
</div>
2226
);
2327
};

0 commit comments

Comments
 (0)