-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from SmaatoUI/feature/BT-151-app-header
[BT-151] AppHeader
- Loading branch information
Showing
25 changed files
with
593 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
import React, { | ||
PropTypes, | ||
} from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import AccountPicture from './AccountPicture.jsx'; | ||
|
||
const AccountNav = props => { | ||
const dropdownClass = classNames('accountDropdownArrow', { | ||
'is-account-dropdown-arrow-open': props.isOpen, | ||
}); | ||
|
||
return ( | ||
<a | ||
className="accountNav" | ||
onClick={props.onClick} | ||
> | ||
<AccountPicture | ||
url={props.pictureUrl} | ||
title={props.email} | ||
/> | ||
<span className="accountNav__email"> | ||
{props.email} | ||
</span> | ||
<span className={dropdownClass} /> | ||
</a> | ||
); | ||
}; | ||
|
||
AccountNav.propTypes = { | ||
email: PropTypes.string.isRequired, | ||
pictureUrl: AccountPicture.propTypes.url, | ||
isOpen: PropTypes.bool, | ||
onClick: PropTypes.func, | ||
}; | ||
|
||
AccountNav.defaultProps = { | ||
isOpen: false, | ||
}; | ||
|
||
export default AccountNav; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
import React, { | ||
PropTypes, | ||
} from 'react'; | ||
|
||
const AccountPicture = props => { | ||
const picture = props.url ? <img src={props.url} /> : null; | ||
|
||
return ( | ||
<span className="icon glyphicons-user accountPicture"> | ||
{picture} | ||
</span> | ||
); | ||
}; | ||
|
||
AccountPicture.propTypes = { | ||
url: PropTypes.string, | ||
title: PropTypes.string, | ||
}; | ||
|
||
export default AccountPicture; |
Oops, something went wrong.