-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
App: introduce HamburgerMenu + user image (#311)
- Loading branch information
Showing
10 changed files
with
197 additions
and
64 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
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
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,24 @@ | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import AccountCircleIcon from '@material-ui/icons/AccountCircle'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { useOsmAuthContext } from '../../utils/OsmAuthContext'; | ||
|
||
const StyledUserImg = styled.img` | ||
width: 24px; | ||
height: 24px; | ||
border-radius: 50%; | ||
`; | ||
export const LoginIcon = ({ onClick }) => { | ||
const { osmUser, userImage } = useOsmAuthContext(); | ||
|
||
return ( | ||
<IconButton color="secondary" onClick={onClick}> | ||
{osmUser ? ( | ||
<StyledUserImg src={userImage} alt={osmUser} onClick={onClick} /> | ||
) : ( | ||
<AccountCircleIcon /> | ||
)} | ||
</IconButton> | ||
); | ||
}; |
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,29 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { isDesktop } from '../../helpers'; | ||
import { HamburgerMenu } from './HamburgerMenu'; | ||
|
||
const Wrapper = styled.span` | ||
vertical-align: top; | ||
display: inline-block; | ||
margin-top: -10px; | ||
@media ${isDesktop} { | ||
margin-top: -5px; | ||
} | ||
button:last-child { | ||
margin-left: -10px; | ||
} | ||
svg { | ||
filter: drop-shadow(0 0 2px #ffffff); | ||
} | ||
`; | ||
|
||
export const TopMenu = () => ( | ||
<Wrapper> | ||
<HamburgerMenu /> | ||
</Wrapper> | ||
); |
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
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
Oops, something went wrong.