Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 05bdadd

Browse files
authored
Merge pull request #639 from aminroosta/aminfix
Fix "Not all accounts are shown in dropdown"
2 parents 886c662 + 31b368a commit 05bdadd

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/sidebar/AccountItemsList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class AccountItemsList extends PureComponent {
2020
}
2121
{accounts
2222
.filter(x => x.account !== loginid)
23-
.map(x => <AccountMenuItem key={x.token} account={x.account} token={x.token} />)
23+
.map(x => <AccountMenuItem key={x.token} account={x.account} token={x.token} currency={x.currency} />)
2424
}
2525
</div>
2626
);

src/sidebar/AccountMenuItem.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { PureComponent } from 'react';
2-
import { M } from 'binary-components';
32
import storage from '../_store/storage';
43

54
export default class AccountMenuItem extends PureComponent {
65

76
props: {
87
account: string,
98
token: string,
9+
currency: string
1010
};
1111

1212
switchToAccount = () => {
@@ -20,7 +20,7 @@ export default class AccountMenuItem extends PureComponent {
2020
};
2121

2222
render() {
23-
const { account } = this.props;
23+
const { account, currency } = this.props;
2424

2525
return (
2626
<a
@@ -29,9 +29,9 @@ export default class AccountMenuItem extends PureComponent {
2929
onClick={this.switchToAccount}
3030
>
3131
<img src="img/icon.png" alt="" />
32-
<M m="Switch to" />
33-
&nbsp;
3432
{account}
33+
&nbsp;
34+
{currency && `(${currency})`}
3535
</a>
3636
);
3737
}

styles/_header.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
display: block;
1111

1212
> .sidebar {
13-
top: -300px !important;
13+
top: -2000px !important;
14+
max-height: 100%;
15+
overflow: hidden;
1416
left: inherit;
1517
right: 0;
1618
}

styles/_menus.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
.account-items-list {
2626
display: flex;
2727
flex-direction: column;
28+
overflow: scroll;
2829
}

www/boot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
accounts.push({ account: account, token: token, currency : currency || '', });
3636
}
3737

38-
return accounts;
38+
var sortedAccounts = accounts.sort((a,b) => b.currency.length - a.currency.length);
39+
return sortedAccounts;
3940
}
4041

4142
function readConfig() {

0 commit comments

Comments
 (0)