Make dashboards index header into component

pull/1655/head
Alex P 2017-06-22 13:47:09 -07:00
parent a21cde8054
commit 93459b7a48
2 changed files with 30 additions and 13 deletions

View File

@ -0,0 +1,28 @@
import React, {PropTypes} from 'react'
import SourceIndicator from 'shared/components/SourceIndicator'
const DashboardsHeader = ({sourceName}) => {
return (
<div className="page-header">
<div className="page-header__container">
<div className="page-header__left">
<h1 className="page-header__title">
Dashboards
</h1>
</div>
<div className="page-header__right">
<SourceIndicator sourceName={sourceName} />
</div>
</div>
</div>
)
}
const {string} = PropTypes
DashboardsHeader.propTypes = {
sourceName: string.isRequired,
}
export default DashboardsHeader

View File

@ -5,7 +5,7 @@ import {bindActionCreators} from 'redux'
import _ from 'lodash'
import SourceIndicator from 'shared/components/SourceIndicator'
import DashboardsHeader from 'src/dashboards/components/DashboardsHeader'
import DeleteConfirmTableCell from 'shared/components/DeleteConfirmTableCell'
import FancyScrollbar from 'shared/components/FancyScrollbar'
@ -63,18 +63,7 @@ const DashboardsPage = React.createClass({
return (
<div className="page">
<div className="page-header">
<div className="page-header__container">
<div className="page-header__left">
<h1 className="page-header__title">
Dashboards
</h1>
</div>
<div className="page-header__right">
<SourceIndicator sourceName={this.props.source.name} />
</div>
</div>
</div>
<DashboardsHeader sourceName={this.props.source.name} />
<FancyScrollbar className="page-contents">
<div className="container-fluid">
<div className="row">