mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 15:47:08 +00:00
Add E2E tests using Cypress
This commit is contained in:
@@ -3,17 +3,18 @@ import type { Octicon } from '.'
|
||||
import { Btn } from '.'
|
||||
import { useFocus } from '../hooks'
|
||||
|
||||
type BtnMenuProps = {
|
||||
interface BtnMenuProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
||||
icon?: keyof typeof Octicon,
|
||||
label?: string,
|
||||
relative?: boolean,
|
||||
tooltip?: string,
|
||||
children: ComponentChildren,
|
||||
}
|
||||
export function BtnMenu({ icon, label, relative, tooltip, children }: BtnMenuProps) {
|
||||
export function BtnMenu(props: BtnMenuProps) {
|
||||
const { icon, label, relative, tooltip, children } = props
|
||||
const [active, setActive] = useFocus()
|
||||
|
||||
return <div class={`btn-menu${relative === false ? ' no-relative' : ''}`}>
|
||||
return <div class={`btn-menu${relative === false ? ' no-relative' : ''}`} {...props}>
|
||||
<Btn {...{icon, label, tooltip}} onClick={setActive} />
|
||||
{active && <div class="btn-group">
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user