mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-14 00:19:16 +01:00
add pageTitle
This commit is contained in:
parent
c512345f71
commit
597ed58fe1
@ -25,6 +25,16 @@ export default class App extends Component {
|
|||||||
router: React.PropTypes.object,
|
router: React.PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
document.title = `${this.getCurrentSection()} - Unleash Admin`;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurrentSection () {
|
||||||
|
const { routes } = this.props;
|
||||||
|
const lastRoute = routes[routes.length - 1];
|
||||||
|
return lastRoute ? lastRoute.pageTitle : '';
|
||||||
|
}
|
||||||
|
|
||||||
onOverlayClick = () => this.setState({ drawerActive: false });
|
onOverlayClick = () => this.setState({ drawerActive: false });
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
@ -39,7 +49,7 @@ export default class App extends Component {
|
|||||||
<div style={{}}>
|
<div style={{}}>
|
||||||
<UserContainer />
|
<UserContainer />
|
||||||
<Layout fixedHeader>
|
<Layout fixedHeader>
|
||||||
<Header title={<span><span style={{ color: '#ddd' }}>Unleash Admin / </span><strong>The Title</strong></span>}>
|
<Header title={<span><span style={{ color: '#ddd' }}>Unleash Admin / </span><strong>{this.getCurrentSection()}</strong></span>}>
|
||||||
<Navigation>
|
<Navigation>
|
||||||
<a href="https://github.com/Unleash" target="_blank">Github</a>
|
<a href="https://github.com/Unleash" target="_blank">Github</a>
|
||||||
<ShowUserContainer />
|
<ShowUserContainer />
|
||||||
|
@ -32,16 +32,16 @@ ReactDOM.render(
|
|||||||
<Router history={hashHistory}>
|
<Router history={hashHistory}>
|
||||||
<Route path="/" component={App}>
|
<Route path="/" component={App}>
|
||||||
<IndexRedirect to="/features" />
|
<IndexRedirect to="/features" />
|
||||||
<Route path="/features" component={Features} />
|
<Route pageTitle="Features" path="/features" component={Features} />
|
||||||
<Route path="/features/create" component={CreateFeatureToggle} />
|
<Route pageTitle="Features" path="/features/create" component={CreateFeatureToggle} />
|
||||||
<Route path="/features/edit/:name" component={EditFeatureToggle} />
|
<Route pageTitle="Features" path="/features/edit/:name" component={EditFeatureToggle} />
|
||||||
<Route path="/strategies" component={Strategies} />
|
<Route pageTitle="Strategies" path="/strategies" component={Strategies} />
|
||||||
<Route path="/strategies/create" component={CreateStrategies} />
|
<Route pageTitle="Strategies" path="/strategies/create" component={CreateStrategies} />
|
||||||
<Route path="/history" component={HistoryPage} />
|
<Route pageTitle="History" path="/history" component={HistoryPage} />
|
||||||
<Route path="/history/:toggleName" component={HistoryTogglePage} />
|
<Route pageTitle="History" path="/history/:toggleName" component={HistoryTogglePage} />
|
||||||
<Route path="/archive" component={Archive} />
|
<Route pageTitle="Archive" path="/archive" component={Archive} />
|
||||||
<Route path="/applications" component={Applications} />
|
<Route pageTitle="Applications" path="/applications" component={Applications} />
|
||||||
<Route path="/client-strategies" component={ClientStrategies} />
|
<Route pageTitle="Client strategies" ppath="/client-strategies" component={ClientStrategies} />
|
||||||
</Route>
|
</Route>
|
||||||
</Router>
|
</Router>
|
||||||
</Provider>, document.getElementById('app'));
|
</Provider>, document.getElementById('app'));
|
||||||
|
Loading…
Reference in New Issue
Block a user