mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
removed Unleash from header title + visual tweaks
This commit is contained in:
parent
e8058d426b
commit
7b1bab0fc3
@ -12,11 +12,6 @@ import UserContainer from './user/user-container';
|
|||||||
import ShowUserContainer from './user/show-user-container';
|
import ShowUserContainer from './user/show-user-container';
|
||||||
import { ScrollContainer } from 'react-router-scroll';
|
import { ScrollContainer } from 'react-router-scroll';
|
||||||
|
|
||||||
const base = {
|
|
||||||
name: 'Unleash',
|
|
||||||
link: '/',
|
|
||||||
};
|
|
||||||
|
|
||||||
function replace (input, params) {
|
function replace (input, params) {
|
||||||
if (!params) {
|
if (!params) {
|
||||||
return input;
|
return input;
|
||||||
@ -55,27 +50,27 @@ export default class App extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSections () {
|
getSections () {
|
||||||
if (window.innerWidth < 768) {
|
|
||||||
return [base];
|
|
||||||
}
|
|
||||||
const { routes, params } = this.props;
|
const { routes, params } = this.props;
|
||||||
const unique = {};
|
const unique = {};
|
||||||
let result = [base].concat(routes.splice(1).map((routeEntry) => ({
|
const result = routes.splice(1)
|
||||||
name: replace(routeEntry.pageTitle, params),
|
.map((routeEntry) => ({
|
||||||
link: replace(routeEntry.link || routeEntry.path, params),
|
name: replace(routeEntry.pageTitle, params),
|
||||||
}))).filter(entry => {
|
link: replace(routeEntry.link || routeEntry.path, params),
|
||||||
if (!unique[entry.link]) {
|
}))
|
||||||
unique[entry.link] = true;
|
.filter(entry => {
|
||||||
return true;
|
if (!unique[entry.link]) {
|
||||||
}
|
unique[entry.link] = true;
|
||||||
return false;
|
return true;
|
||||||
});
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
// mutate document.title:
|
// mutate document.title:
|
||||||
document.title = result
|
document.title = result
|
||||||
.map(e => e.name)
|
.map(e => e.name)
|
||||||
.reverse()
|
.reverse()
|
||||||
.join(' - ');
|
.concat('Unleash')
|
||||||
|
.join(' – ');
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -85,9 +80,12 @@ export default class App extends Component {
|
|||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{result.map((entry, index) => (
|
{result.map((entry, index) => (
|
||||||
<span key={entry.link + index}><Link style={{ color: '#f1f1f1', textDecoration: 'none' }} to={entry.link}>
|
<span key={entry.link + index} className={index > 0 ? 'mdl-layout--large-screen-only' : ''}>
|
||||||
{entry.name}
|
{index > 0 ? ' › ' : null}
|
||||||
</Link> {(index + 1) < result.length ? ' / ' : null}</span>
|
<Link className={[styles.headerTitleLink, 'mdl-color-text--primary-contrast'].join(' ')} to={entry.link}>
|
||||||
|
{entry.name}
|
||||||
|
</Link>
|
||||||
|
</span>
|
||||||
))}
|
))}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
@ -125,7 +123,7 @@ export default class App extends Component {
|
|||||||
</Navigation>
|
</Navigation>
|
||||||
</Header>
|
</Header>
|
||||||
<Drawer className="mdl-color--white">
|
<Drawer className="mdl-color--white">
|
||||||
<span className={[styles.title, 'mdl-layout-title'].join(' ')}>Unleash</span>
|
<span className={[styles.drawerTitle, 'mdl-layout-title'].join(' ')}>Unleash</span>
|
||||||
<hr className={commonStyles.divider}/>
|
<hr className={commonStyles.divider}/>
|
||||||
<Navigation className={styles.navigation}>
|
<Navigation className={styles.navigation}>
|
||||||
{createListItem('/features', 'Feature toggles', 'list', true)}
|
{createListItem('/features', 'Feature toggles', 'list', true)}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
.title {
|
.headerTitleLink {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawerTitle {
|
||||||
padding-left: 24px !important;
|
padding-left: 24px !important;
|
||||||
}
|
}
|
||||||
@media screen and (max-width: 1024px) {
|
@media screen and (max-width: 1024px) {
|
||||||
.title {
|
.drawerTitle {
|
||||||
padding-left: 16px !important;
|
padding-left: 16px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ ReactDOM.render(
|
|||||||
<Route path="/" component={App}>
|
<Route path="/" component={App}>
|
||||||
<IndexRedirect to="/features" />
|
<IndexRedirect to="/features" />
|
||||||
|
|
||||||
<Route pageTitle="Features" link="/features">
|
<Route pageTitle="Feature toggles" link="/features">
|
||||||
<Route pageTitle="Features" path="/features" component={Features} />
|
<Route pageTitle="Feature toggles" path="/features" component={Features} />
|
||||||
<Route pageTitle="New" path="/features/create" component={CreateFeatureToggle} />
|
<Route pageTitle="New" path="/features/create" component={CreateFeatureToggle} />
|
||||||
<Route pageTitle=":name" path="/features/:activeTab/:name" component={ViewFeatureToggle} />
|
<Route pageTitle=":name" path="/features/:activeTab/:name" component={ViewFeatureToggle} />
|
||||||
</Route>
|
</Route>
|
||||||
@ -60,12 +60,12 @@ ReactDOM.render(
|
|||||||
<Route pageTitle=":strategyName" path="/strategies/:activeTab/:strategyName" component={StrategyView} />
|
<Route pageTitle=":strategyName" path="/strategies/:activeTab/:strategyName" component={StrategyView} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route pageTitle="History" link="/history">
|
<Route pageTitle="Event history" link="/history">
|
||||||
<Route pageTitle="History" path="/history" component={HistoryPage} />
|
<Route pageTitle="Event history" path="/history" component={HistoryPage} />
|
||||||
<Route pageTitle=":toggleName" path="/history/:toggleName" component={HistoryTogglePage} />
|
<Route pageTitle=":toggleName" path="/history/:toggleName" component={HistoryTogglePage} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route pageTitle="Archive" path="/archive" component={Archive} />
|
<Route pageTitle="Archived toggles" path="/archive" component={Archive} />
|
||||||
<Route pageTitle="Applications" link="/applications">
|
<Route pageTitle="Applications" link="/applications">
|
||||||
<Route pageTitle="Applications" path="/applications" component={Applications} />
|
<Route pageTitle="Applications" path="/applications" component={Applications} />
|
||||||
<Route pageTitle=":name" path="/applications/:name" component={ApplicationView} />
|
<Route pageTitle=":name" path="/applications/:name" component={ApplicationView} />
|
||||||
|
Loading…
Reference in New Issue
Block a user