nav title rendered in the nav bar and styled

This commit is contained in:
NikolaBorislavovHristov 2018-06-18 17:25:59 +03:00
parent a8cdf73258
commit 7a0fb1ad2b
2 changed files with 8 additions and 0 deletions

View file

@ -13,6 +13,7 @@ class NavBar extends Component {
return (
<nav className={styles['nav-bar']}>
{this.props.tabs.map(tab => <NavTab key={tab.to} {...tab} />)}
{this.props.title.length > 0 ? <h2 className={styles['nav-title']}>{this.props.title}</h2> : null}
{this.props.searchInput ? <SearchInput /> : null}
</nav>
);
@ -31,11 +32,13 @@ NavBar.propTypes = {
exact: PropTypes.bool,
replace: PropTypes.bool
})).isRequired,
title: PropTypes.string.isRequired,
searchInput: PropTypes.bool.isRequired
};
NavBar.defaultProps = {
tabs: [],
title: '',
searchInput: false
};

View file

@ -5,4 +5,9 @@
flex-direction: row;
align-items: center;
background-color: @colorsecondary;
}
.nav-title {
color: @colorwhite;
font-size: 16px;
padding: 0 10px;
}