1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix(navigation): signout more visible

This commit is contained in:
Corinne Krych 2018-02-24 18:11:09 +01:00
parent 5a67950c0a
commit 995b232e82

View File

@ -112,7 +112,7 @@ export default class App extends Component {
return [0, 0]; return [0, 0];
} }
}; };
const createListItem = (path, caption, icon, isDrawerNavigation = false) => { const createListItem = (path, caption, icon, isDrawerNavigation = false, isAnchor = false) => {
const linkColor = const linkColor =
isDrawerNavigation && this.context.router.isActive(path) isDrawerNavigation && this.context.router.isActive(path)
? 'mdl-color-text--black' ? 'mdl-color-text--black'
@ -121,17 +121,26 @@ export default class App extends Component {
isDrawerNavigation && this.context.router.isActive(path) isDrawerNavigation && this.context.router.isActive(path)
? 'mdl-color-text--black' ? 'mdl-color-text--black'
: 'mdl-color-text--grey-600'; : 'mdl-color-text--grey-600';
return ( const renderIcon = (
<Icon
name={icon}
className={isDrawerNavigation ? [styles.navigationIcon, iconColor].join(' ') : undefined}
/>
);
return isAnchor ? (
<a
href={path}
className={isDrawerNavigation ? [styles.navigationLink, linkColor].join(' ') : undefined}
>
{icon && renderIcon}
{caption}
</a>
) : (
<Link <Link
to={path} to={path}
className={isDrawerNavigation ? [styles.navigationLink, linkColor].join(' ') : undefined} className={isDrawerNavigation ? [styles.navigationLink, linkColor].join(' ') : undefined}
> >
{icon && ( {icon && renderIcon}
<Icon
name={icon}
className={isDrawerNavigation ? [styles.navigationIcon, iconColor].join(' ') : undefined}
/>
)}
{caption} {caption}
</Link> </Link>
); );
@ -158,6 +167,7 @@ export default class App extends Component {
{createListItem('/history', 'Event History', 'history', true)} {createListItem('/history', 'Event History', 'history', true)}
{createListItem('/archive', 'Archived Toggles', 'archive', true)} {createListItem('/archive', 'Archived Toggles', 'archive', true)}
{createListItem('/applications', 'Applications', 'apps', true)} {createListItem('/applications', 'Applications', 'apps', true)}
{createListItem('/api/admin/user/logout', 'Sign out', 'exit_to_app', true, true)}
</Navigation> </Navigation>
<hr /> <hr />
<Navigation className={styles.navigation}> <Navigation className={styles.navigation}>