Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Pull in dapp-status #7457

Merged
merged 3 commits into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 1 addition & 25 deletions js-old/src/views/Application/TabBar/Tab/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ import { Tab as MUITab } from 'material-ui/Tabs';
import React, { Component, PropTypes } from 'react';
import { FormattedMessage } from 'react-intl';

import { Badge } from '~/ui';

import styles from '../tabBar.css';

const SIGNER_ID = 'signer';

export default class Tab extends Component {
static propTypes = {
pendings: PropTypes.number,
view: PropTypes.object.isRequired
};

Expand All @@ -37,9 +32,7 @@ export default class Tab extends Component {
<MUITab
icon={ view.icon }
label={
view.id === SIGNER_ID
? this.renderSignerLabel()
: this.renderLabel(view.id)
this.renderLabel(view.id)
}
/>
);
Expand All @@ -55,21 +48,4 @@ export default class Tab extends Component {
</div>
);
}

renderSignerLabel () {
const { pendings } = this.props;
let bubble;

if (pendings) {
bubble = (
<Badge
color='red'
className={ styles.labelBubble }
value={ pendings }
/>
);
}

return this.renderLabel(SIGNER_ID, bubble);
}
}
29 changes: 3 additions & 26 deletions js-old/src/views/Application/TabBar/tabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { Link } from 'react-router';
import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar';
import { isEqual } from 'lodash';

import { StatusIndicator } from '~/ui';

import Tab from './Tab';
import styles from './tabBar.css';

Expand All @@ -31,8 +29,6 @@ class TabBar extends Component {
};

static propTypes = {
pending: PropTypes.array,
health: PropTypes.object.isRequired,
views: PropTypes.array.isRequired
};

Expand All @@ -41,29 +37,12 @@ class TabBar extends Component {
};

render () {
const { health } = this.props;

return (
<Toolbar className={ styles.toolbar }>
<ToolbarGroup className={ styles.first }>
<div />
</ToolbarGroup>
<div className={ styles.tabs }>
<Link
activeClassName={ styles.tabactive }
className={ `${styles.tabLink} ${styles.indicatorTab}` }
key='status'
to='/status'
>
<div className={ styles.indicator }>
<StatusIndicator
type='signal'
id='topbar.health'
status={ health.overall.status }
title={ health.overall.message }
/>
</div>
</Link>
{ this.renderTabItems() }
</div>
<ToolbarGroup className={ styles.last }>
Expand All @@ -74,7 +53,7 @@ class TabBar extends Component {
}

renderTabItems () {
const { views, pending } = this.props;
const { views } = this.props;

return views.map((view, index) => {
return (
Expand All @@ -85,7 +64,6 @@ class TabBar extends Component {
to={ view.route }
>
<Tab
pendings={ pending.length }
view={ view }
/>
</Link>
Expand All @@ -109,7 +87,6 @@ function mapStateToProps (initState) {
return (state) => {
const { availability = 'unknown' } = state.nodeStatus.nodeKind || {};
const { views } = state.settings;
const { health } = state.nodeStatus;

const viewIds = Object
.keys(views)
Expand All @@ -123,7 +100,7 @@ function mapStateToProps (initState) {
});

if (isEqual(viewIds, filteredViewIds)) {
return { views: filteredViews, health };
return { views: filteredViews };
}

filteredViewIds = viewIds;
Expand All @@ -132,7 +109,7 @@ function mapStateToProps (initState) {
id
}));

return { views: filteredViews, health };
return { views: filteredViews };
};
}

Expand Down
86 changes: 82 additions & 4 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@parity/dapp-localtx": "paritytech/dapp-localtx",
"@parity/dapp-registry": "paritytech/dapp-registry",
"@parity/dapp-signaturereg": "paritytech/dapp-signaturereg",
"@parity/dapp-status": "js-dist-paritytech/dapp-status",
"@parity/dapp-tokendeploy": "paritytech/dapp-tokendeploy",
"@parity/dapp-tokenreg": "paritytech/dapp-tokenreg",
"babel-cli": "6.26.0",
Expand Down Expand Up @@ -145,7 +146,7 @@
"@parity/plugin-signer-default": "paritytech/plugin-signer-default",
"@parity/plugin-signer-hardware": "paritytech/plugin-signer-hardware",
"@parity/plugin-signer-qr": "paritytech/plugin-signer-qr",
"@parity/shared": "2.2.18",
"@parity/shared": "2.2.20",
"@parity/ui": "3.0.22",
"keythereum": "1.0.2",
"lodash.flatten": "4.4.0",
Expand Down