Skip to content

Commit

Permalink
fix: missing props
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Jun 17, 2024
1 parent 510c2e6 commit fe06d63
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import React, { useState, useRef } from 'react';
import { Button, Layer, Popper, FlyoutMenu, MenuItem, ButtonProps, IconMore16 } from '@dhis2/ui';
import { Button, Layer, Popper, FlyoutMenu, IconMore16, MenuItem } from '@dhis2/ui';

type Props = ButtonProps & {
label?: string;
icon?: React.ReactElement;
onClick: () => void;
type Props = {
label?: string,
primary?: boolean,
secondary?: boolean,
icon?: React.ReactElement,
onClick?: () => void,
dataTest?: string,
small?: boolean,
large?: boolean,
};

export const EllipsisButton = ({
label,
primary,
secondary,
small,
large,
onClick: handleClick,
icon,
onClick,
...buttonProps
dataTest,
}: Props) => {
const anchorRef = useRef<HTMLDivElement>(null);
const anchorRef = useRef(null);
const [actionsIsOpen, setActionsIsOpen] = useState(false);

const toggle = () => {
Expand All @@ -23,8 +32,13 @@ export const EllipsisButton = ({
return (
<>
<div ref={anchorRef}>
{/* @ts-ignore */}
<Button
{...buttonProps}
primary={primary}
secondary={secondary}
dataTest={dataTest}
small={small}
large={large}
onClick={toggle}
icon={<IconMore16 />}
/>
Expand All @@ -35,7 +49,7 @@ export const EllipsisButton = ({
<FlyoutMenu dense>
<MenuItem
label={label}
onClick={onClick}
onClick={handleClick}
icon={icon}
/>
</FlyoutMenu>
Expand Down

0 comments on commit fe06d63

Please sign in to comment.