Add peer management to the Status tab (#5566)
* Add peer management to the Status tab * Fix propTypes issue
This commit is contained in:
committed by
Gav Wood
parent
945c1a9478
commit
0f1a857576
@@ -21,6 +21,12 @@ $bylineMaxHeight: 2.4rem;
|
||||
$titleLineHeight: 2rem;
|
||||
$smallFontSize: 0.75rem;
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.byline,
|
||||
.description {
|
||||
color: $bylineColor;
|
||||
|
||||
@@ -22,22 +22,44 @@ import styles from './title.css';
|
||||
|
||||
export default class Title extends Component {
|
||||
static propTypes = {
|
||||
actions: PropTypes.array,
|
||||
byline: nodeOrStringProptype(),
|
||||
className: PropTypes.string,
|
||||
description: nodeOrStringProptype(),
|
||||
title: nodeOrStringProptype()
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
actions: []
|
||||
};
|
||||
|
||||
render () {
|
||||
const { className, title } = this.props;
|
||||
|
||||
return (
|
||||
<div className={ className }>
|
||||
<h3 className={ styles.title }>
|
||||
{ title }
|
||||
</h3>
|
||||
{ this.renderByline() }
|
||||
{ this.renderDescription() }
|
||||
<div className={ [ className, styles.container ].join(' ') }>
|
||||
<div>
|
||||
<h3 className={ styles.title }>
|
||||
{ title }
|
||||
</h3>
|
||||
{ this.renderByline() }
|
||||
{ this.renderDescription() }
|
||||
</div>
|
||||
{ this.renderActions() }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderActions () {
|
||||
const { actions } = this.props;
|
||||
|
||||
if (actions.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
{ actions }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user