Skip to content

Commit 4cd62b8

Browse files
authored
Fix Ledger Fees; Minor UI fixes (#386)
* wallet: fix tx fee when using ledger * ui: sidenav update * styling fix
1 parent 4abb20c commit 4cd62b8

File tree

8 files changed

+112
-48
lines changed

8 files changed

+112
-48
lines changed

app/background/wallet/service.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,10 @@ class WalletService {
554554
);
555555

556556
send = (to, amount, fee) => this._ledgerProxy(
557-
() => this._executeRPC('createsendtoaddress', [to, Number(amount), '', '', false, 'default']),
557+
async () => {
558+
await this._executeRPC('settxfee', [Number(fee)]);
559+
return this._executeRPC('createsendtoaddress', [to, Number(amount), '', '', false, 'default']);
560+
},
558561
async () => {
559562
const res = await this.client.send(this.name, {
560563
rate: Number(toBaseUnits(fee)),

app/components/Sidebar/index.js

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ class Sidebar extends Component {
4949
return (
5050
<div className="sidebar">
5151
<div className="sidebar__content">
52-
<div>
53-
<div className="sidebar__logo-wrapper">
54-
<Logo />
55-
</div>
56-
{this.renderNav()}
52+
<div className="sidebar__logo-wrapper">
53+
<Logo />
5754
</div>
58-
{this.renderFooter()}
55+
{this.renderNav()}
5956
</div>
57+
{this.renderFooter()}
6058
</div>
6159
);
6260
}
@@ -90,67 +88,83 @@ class Sidebar extends Component {
9088
>
9189
Receive
9290
</NavLink>
91+
9392
<NavLink
9493
className="sidebar__action"
95-
to="/sign_message"
94+
to="/domain_manager"
9695
activeClassName="sidebar__action--selected"
9796
>
98-
Sign Message
97+
Domain Manager
9998
</NavLink>
99+
</div>
100+
<div className="sidebar__section">Top-Level Domains</div>
101+
<div className="sidebar__actions">
100102
<NavLink
101103
className="sidebar__action"
102-
to="/verify_message"
104+
to="/domains"
103105
activeClassName="sidebar__action--selected"
104106
>
105-
Verify Message
107+
Browse Domains
106108
</NavLink>
107109
<NavLink
108110
className="sidebar__action"
109-
to="/domain_manager"
111+
to="/bids"
110112
activeClassName="sidebar__action--selected"
111113
>
112-
Domain Manager
114+
Your Bids
113115
</NavLink>
114116
<NavLink
115117
className="sidebar__action"
116-
to="/get_coins"
118+
to="/watching"
117119
activeClassName="sidebar__action--selected"
118120
>
119-
Add Funds
121+
Watching
120122
</NavLink>
121-
</div>
122-
<div className="sidebar__section">Top-Level Domains</div>
123-
<div className="sidebar__actions">
124123
<NavLink
125124
className="sidebar__action"
126-
to="/domains"
125+
to="/exchange"
127126
activeClassName="sidebar__action--selected"
128127
>
129-
Browse Domains
128+
Exchange
130129
</NavLink>
130+
</div>
131+
{ this.renderMisc() }
132+
</React.Fragment>
133+
);
134+
}
135+
136+
renderMisc() {
137+
return (
138+
<>
139+
<div
140+
className="sidebar__section"
141+
>
142+
Miscellaneous
143+
</div>
144+
<div className="sidebar__actions">
131145
<NavLink
132146
className="sidebar__action"
133-
to="/bids"
147+
to="/get_coins"
134148
activeClassName="sidebar__action--selected"
135149
>
136-
Your Bids
150+
Add Funds
137151
</NavLink>
138152
<NavLink
139153
className="sidebar__action"
140-
to="/watching"
154+
to="/sign_message"
141155
activeClassName="sidebar__action--selected"
142156
>
143-
Watching
157+
Sign Message
144158
</NavLink>
145159
<NavLink
146160
className="sidebar__action"
147-
to="/exchange"
161+
to="/verify_message"
148162
activeClassName="sidebar__action--selected"
149163
>
150-
Exchange
164+
Verify Message
151165
</NavLink>
152166
</div>
153-
</React.Fragment>
167+
</>
154168
);
155169
}
156170

app/components/Sidebar/sidebar.scss

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
.sidebar {
44
@extend %col-nowrap;
5-
65
background-color: $athens-gray;
76
box-shadow: 1px 0 0 0 rgba($black, 0.1);
8-
padding: 0 2rem 0 1.5rem;
97
font-size: 0.9rem;
108
flex: 1 1 auto;
119
height: 100%;
1210
overflow-x: hidden;
11+
cursor: default;
1312

1413
&--empty {
1514
.sidebar__logo {
@@ -29,18 +28,25 @@
2928
@extend %col-nowrap;
3029
height: 100%;
3130
justify-content: space-between;
31+
padding: 0 2rem 0 1.5rem;
32+
flex: 1 1 auto;
33+
overflow-y: auto;
3234
}
3335

3436
&__section {
3537
@extend %h6;
3638
color: $manatee-gray;
3739
text-transform: uppercase;
3840
padding: 0.5rem 0.75rem 0.5rem 0;
41+
42+
&--clickable {
43+
cursor: pointer;
44+
}
3945
}
4046

4147
&__actions {
4248
@extend %col-nowrap;
43-
margin-bottom: 1rem;
49+
margin-bottom: .5rem;
4450
}
4551

4652
&__action {
@@ -73,13 +79,17 @@
7379

7480
&__footer {
7581
@extend %col-nowrap;
76-
bottom: 1rem;
82+
padding-bottom: 1rem;
7783
position: relative;
84+
flex: 0 0 auto;
85+
border-top: 1px solid rgba($black, 0.1);
86+
background-color: rgba($white, 0.5);
7887

7988
&__row {
8089
@extend %col-nowrap;
81-
padding: 0.5rem 0.75rem;
90+
padding: .25rem .75rem .5rem;
8291
}
92+
8393
&__title {
8494
@extend %h6;
8595
opacity: 0.5;

app/pages/Account/account.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77

88
&__header {
99
@extend %row-nowrap;
10-
padding: 1rem 0;
10+
padding: 1rem;
1111
align-items: center;
1212
background: rgba($black, 0.04);
1313
border: solid 1px #f1f1f3;
1414
overflow-x: auto;
15+
cursor: default;
1516

1617
&__section {
1718
padding: 0 1rem;
@@ -20,10 +21,11 @@
2021
// Spendable block
2122
&:first-child {
2223
text-align: right;
23-
border-right: solid 2px rgba($black, 0.5);
24+
border-right: solid 1px rgba($black, 0.25);
2425

2526
& > .label {
2627
visibility: visible;
28+
color: rgba($black, 0.25);
2729
}
2830
& > .amount {
2931
font-weight: 700;
@@ -36,24 +38,24 @@
3638
}
3739

3840
& > .label {
39-
font-size: 0.75rem;
41+
font-size: 0.6875rem;
4042
font-weight: 700;
4143
visibility: hidden;
44+
color: rgba($black, 0.25);
4245
}
4346

4447
& > .amount {
45-
margin: 0;
4648
font-size: 1.125rem;
4749
font-weight: 500;
48-
line-height: 1.75rem;
50+
margin: .3125rem 0 .125rem;
4951
}
5052

5153
& > .subtext {
5254
display: inline-block;
53-
font-size: 0.875rem;
55+
font-size: 0.8125rem;
5456
font-weight: 500;
5557
line-height: 1.25rem;
56-
color: rgba($black, 0.6);
58+
color: rgba($black, 0.25);
5759
}
5860
}
5961

app/pages/Account/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default class Account extends Component {
175175
<div className="account__header__section">
176176
<span className="label">SPENDABLE</span>
177177
<p className="amount">
178-
{displayBalance(spendableBalance.HNS || 0, true)}
178+
{displayBalance(spendableBalance.HNS || 0, true, 2)}
179179
</p>
180180
<span className="subtext">
181181
~${spendableBalance.converted || "0.00"} {spendableBalance.currency}
@@ -187,7 +187,7 @@ export default class Account extends Component {
187187
<div className="account__header__section">
188188
<span className="label">LOCKED</span>
189189
<p className="amount">
190-
{displayBalance(lockedBalance.bidding.HNS, true)}
190+
{displayBalance(lockedBalance.bidding.HNS, true, 2)}
191191
</p>
192192
<span className="subtext">
193193
In bids ({lockedBalance.bidding.num}{" "}
@@ -205,7 +205,7 @@ export default class Account extends Component {
205205
<div className="account__header__section">
206206
<span className="label">LOCKED</span>
207207
<p className="amount">
208-
{displayBalance(lockedBalance.revealable.HNS, true)}
208+
{displayBalance(lockedBalance.revealable.HNS, true, 2)}
209209
</p>
210210
<span className="subtext">
211211
In reveal ({lockedBalance.revealable.num}{" "}
@@ -223,7 +223,7 @@ export default class Account extends Component {
223223
<div className="account__header__section">
224224
<span className="label">LOCKED</span>
225225
<p className="amount">
226-
{displayBalance(lockedBalance.finished.HNS, true)}
226+
{displayBalance(lockedBalance.finished.HNS, true, 2)}
227227
</p>
228228
<span className="subtext">
229229
In finished auctions ({lockedBalance.finished.num}{" "}

app/utils/balances.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {consensus} from "hsd/lib/protocol";
44
const DECIMALS = 6;
55
const UNIT_DIVISOR = 1000000;
66

7-
export function displayBalance(bal, withUnit) {
8-
const ret = new BigNumber(bal).div(UNIT_DIVISOR).toFixed(DECIMALS);
7+
export function displayBalance(bal, withUnit, decimals = DECIMALS) {
8+
const ret = new BigNumber(bal).div(UNIT_DIVISOR).toFixed(decimals);
99
return withUnit ? `${ret} HNS` : ret;
1010
}
1111

package-lock.json

Lines changed: 37 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bob-wallet",
33
"productName": "Bob",
44
"author": "Kyokan Group, Inc.",
5-
"version": "0.8.0-rc.1",
5+
"version": "0.8.0",
66
"description": "A Handshake wallet and auction manager.",
77
"scripts": {
88
"build": "./scripts/package.sh",

0 commit comments

Comments
 (0)