Skip to content

Commit

Permalink
:recyle: handle in better way showing delegates tab
Browse files Browse the repository at this point in the history
  • Loading branch information
faival committed Aug 15, 2018
1 parent 584c8ac commit e7c6357
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion i18n/locales/en/common.json
Expand Up @@ -36,7 +36,6 @@
"Become a delegate (Fee: {{fee}} LSK)": "Become a delegate (Fee: {{fee}} LSK)",
"Blockchain Application Registration": "Blockchain Application Registration",
"Blocks": "Blocks",
"Buy Lisk": "Buy Lisk",
"Cancel": "Cancel",
"Change account settings, enable delegate voting.": "Change account settings, enable delegate voting.",
"Check for updates...": "Check for updates...",
Expand Down
21 changes: 7 additions & 14 deletions src/components/mainMenu/mainMenu.js
Expand Up @@ -61,7 +61,7 @@ class MainMenu extends React.Component {
const {
history, t, showDelegate, account,
} = this.props;
const tabs = [
let tabs = [
{
label: t('Dashboard'),
route: `${routes.dashboard.path}`,
Expand All @@ -73,13 +73,11 @@ class MainMenu extends React.Component {
id: 'transactions',
image: menuLogos.wallet,
}, {
/* TODO: uncomment when the page is created
label: t('Buy Lisk'),
route: '/main/buyLisk',
id: 'buyLisk',
image: menuLogos.buyLisk,
label: t('Delegates'),
id: 'delegates',
route: `${routes.delegates.path}`,
image: menuLogos.delegates,
}, {
*/
label: t('Sidechains'),
route: `${routes.sidechains.path}`,
id: 'sidechains',
Expand All @@ -104,13 +102,8 @@ class MainMenu extends React.Component {
},
];

if (showDelegate) {
tabs.splice(tabs.length - 1, 0, {
label: t('Delegates'),
id: 'delegates',
route: `${routes.delegates.path}`,
image: menuLogos.delegates,
});
if (!showDelegate) {
tabs = tabs.filter(tab => tab.id !== 'delegates');
}

return (
Expand Down

0 comments on commit e7c6357

Please sign in to comment.