Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
✨ add logout for mobile (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetous authored and bpetetot committed Apr 4, 2019
1 parent 3bca5d3 commit 3d3ac1f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
.avatar-dropdown .cc-avatar-image > img {
.avatar-dropdown-button .cc-avatar-image > img {
border: 2px solid var(--primary-color-font);
font-size: 1.5em;
}

.avatar-dropdown .cc-avatar-image > img:hover {
.avatar-dropdown-button .cc-avatar-image > img:hover {
border: 2px solid var(--secondary-color);
cursor: pointer;
}

.avatar-dropdown .cc-avatar-initials {
.avatar-dropdown-button .cc-avatar-initials {
border: 2px solid var(--secondary-color);
}

.avatar-dropdown .cc-avatar-initials:hover {
.avatar-dropdown-button .cc-avatar-initials:hover {
border: 2px solid var(--secondary-color-font);
cursor: pointer;
}

.avatar-dropdown {
z-index: 110;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import './avatarDropdown.css'
const AvatarDropdown = ({
displayName, photoURL, contributorsRoute, signout,
}) => {
const avatar = (
<Avatar src={photoURL} name={displayName} className="avatar-dropdown" />
)
const avatar = <Avatar src={photoURL} name={displayName} className="avatar-dropdown-button" />
return (
<Dropdown action={avatar}>
<Dropdown className="avatar-dropdown" action={avatar}>
<div>{displayName}</div>
<Link code="home">
<IconLabel icon="fa fa-home" label="Conference Hall" />
Expand Down
24 changes: 13 additions & 11 deletions src/layout/brand/brand.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Portal from 'components/portals/portal'
import withTheme from 'styles/themes/withTheme'
import { withSizes } from 'styles/utils'

import AvatarDropdown from '../avatarDropdown'

import styles from './brand.module.css'

const SidebarWrapper = withTheme(({ className, onClick, content }) => (
Expand All @@ -23,19 +25,19 @@ const Brand = ({
title, baseRoute, isTablet, isMobile, sidebar, className,
}) => (
<div className={cn(styles.brand, className)}>
{sidebar
&& (isMobile || isTablet) && (
<OpenTrigger
renderTrigger={({ show, hide, isOpen }) => (
<a onClick={isOpen ? hide : show} role="button" className={styles.burgerLink}>
<i className={`fa ${isOpen ? 'fa-arrow-left' : 'fa-bars'}`} />
</a>
)}
>
{({ hide }) => <SidebarWrapper content={sidebar} onClick={hide} />}
</OpenTrigger>
{sidebar && (isMobile || isTablet) && (
<OpenTrigger
renderTrigger={({ show, hide, isOpen }) => (
<a onClick={isOpen ? hide : show} role="button" className={styles.burgerLink}>
<i className={`fa ${isOpen ? 'fa-arrow-left' : 'fa-bars'}`} />
</a>
)}
>
{({ hide }) => <SidebarWrapper content={sidebar} onClick={hide} />}
</OpenTrigger>
)}
<Link code={baseRoute}>{title}</Link>
{sidebar && (isMobile || isTablet) && <AvatarDropdown classname={styles.avatar} />}
</div>
)

Expand Down
8 changes: 6 additions & 2 deletions src/layout/brand/brand.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
text-decoration: none;
}

.brand > .burgerLink:hover {
.brand > .burgerLink {
width: 40px;
}

.brand > .burgerLink:hover {
color: var(--secondary-color-font);
}

Expand All @@ -31,4 +35,4 @@

.mobileSidebar {
height: calc(100% - var(--layout-navbar-height));
}
}
6 changes: 2 additions & 4 deletions src/layout/navbar/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import cn from 'classnames'
import IconLink from 'components/iconLink'
import IconLabel from 'components/iconLabel'

import AvatarDropdown from './avatarDropdown'
import AvatarDropdown from '../avatarDropdown'

import './navbar.css'

const Navbar = ({ name, className }) => (
<nav className={cn('navbar', className)}>
<div className="navbar-left">
{name && <IconLabel icon="fa fa-caret-right" label={name} />}
</div>
<div className="navbar-left">{name && <IconLabel icon="fa fa-caret-right" label={name} />}</div>
<div className="navbar-right">
<IconLink
icon="fa fa-github"
Expand Down

0 comments on commit 3d3ac1f

Please sign in to comment.