feat: keyboard accessibility in navbar

This commit is contained in:
Kyle Gill
2019-03-29 11:35:05 -06:00
parent f3ac895199
commit 7eaa6b6046
5 changed files with 44 additions and 17 deletions

View File

@@ -17,19 +17,24 @@ const IconBase = styled.div`
display: flex;
justify-content: center;
align-items: center;
background-color: none;
background-color: transparent;
border-radius: 12px;
padding: 5px;
transition: 0.1s all ease-in-out;
color: ${props => props.theme.colors.secondary};
&:focus {
outline: none;
box-shadow: 0 0 0 3px ${props => props.theme.colors.bodyBackground},
0 0 0 5px ${props => props.theme.colors.hover};
}
&:hover {
background-color: ${props => !props.disabled && props.theme.colors.hover};
cursor: pointer;
}
`
const Icon = ({ name, ...rest }) => (
<IconBase {...rest}>
const Icon = ({ name, tabindex, ...rest }) => (
<IconBase tabIndex={tabindex} {...rest}>
{name === "Book" && <Book />}
{name === "Calendar" && <Calendar />}
{name === "ChevronLeft" && <ChevronLeft />}