Add main menu; add panel fixes

This commit is contained in:
obergodmar
2020-07-01 21:35:19 +03:00
parent 4b1666c584
commit 839355f1de
15 changed files with 194 additions and 78 deletions
@@ -0,0 +1,30 @@
import * as React from 'react'
import { KeyboardEvent } from 'react'
import './menu-item-component.scss'
interface Props {
isActive: boolean
handleClick: () => void
}
export const MenuItemComponent = ({isActive, handleClick}: Props) => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.keyCode !== 13 && e.keyCode !== 32) {
return
}
handleClick()
}
return (
<div
tabIndex={0}
onClick={handleClick}
onKeyDown={handleKeyDown}
className={`menu-item ${isActive ? 'menu-item--active' : ''}`}
/>
)
}
MenuItemComponent.displayName = 'MainMenuComponent'