Skip to content

Commit 9a4a22b

Browse files
authored
Merge pull request #191 from lightninglabs/account-section
pool+accounts: minor account section updates
2 parents 16bad21 + 54b2060 commit 9a4a22b

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

app/src/components/pool/account/AccountSummary.tsx

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ const AccountSummary: React.FC = () => {
6969
<span>{l('accountStatus')}</span>
7070
<StatusBadge pending={account.isPending}>{account.stateLabel}</StatusBadge>
7171
</SummaryItem>
72+
<SummaryItem>
73+
<span>{l('traderKey')}</span>
74+
<Tip overlay={account.traderKey} capitalize={false}>
75+
<span>{account.traderKeyEllipsed}</span>
76+
</Tip>
77+
</SummaryItem>
7278
<SummaryItem>
7379
<span>{l('fundingTxn')}</span>
7480
<Tip overlay={account.fundingTxnId} capitalize={false}>
@@ -122,14 +128,25 @@ const AccountSummary: React.FC = () => {
122128
</SummaryItem>
123129
</>
124130
) : (
125-
<Button
126-
primary
127-
ghost
128-
disabled={account.stateLabel !== 'Open'}
129-
onClick={accountSectionView.showFundAccount}
130-
>
131-
{l('fundAccount')}
132-
</Button>
131+
<SummaryItem>
132+
<Button
133+
danger
134+
ghost
135+
compact
136+
disabled={account.stateLabel !== 'Open'}
137+
onClick={accountSectionView.showCloseAccount}
138+
>
139+
{l('close')}
140+
</Button>
141+
<Button
142+
primary
143+
ghost
144+
disabled={account.stateLabel !== 'Open'}
145+
onClick={accountSectionView.showFundAccount}
146+
>
147+
{l('fundAccount')}
148+
</Button>
149+
</SummaryItem>
133150
)}
134151
</Actions>
135152
</>

app/src/i18n/locales/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"cmps.pool.account.AccountSummary.expiresIn": "Expires in",
9696
"cmps.pool.account.AccountSummary.expiresHeight": "{{remaining}} blocks (Height #{{height}})",
9797
"cmps.pool.account.AccountSummary.accountStatus": "Account Status",
98+
"cmps.pool.account.AccountSummary.traderKey": "Trader Key",
9899
"cmps.pool.account.AccountSummary.fundingTxn": "Funding Transaction",
99100
"cmps.pool.account.AccountSummary.currentBalance": "Current Balance",
100101
"cmps.pool.account.AccountSummary.openOrdersCount": "Open Orders",

app/src/store/models/account.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export default class Account {
2222
this.update(poolAccount);
2323
}
2424

25+
/** the first and last 6 chars of the trader key */
26+
get traderKeyEllipsed() {
27+
return ellipseInside(this.traderKey, 4);
28+
}
29+
2530
/** the first and last 6 chars of the funding txn id */
2631
get fundingTxnIdEllipsed() {
2732
return ellipseInside(this.fundingTxnId, 4);

0 commit comments

Comments
 (0)