fix(striker-ui): enable atom Button to accept HTML button props

main
Tsu-ba-me 4 years ago
parent a08c2b24ad
commit 14d3627c90
  1. 3
      striker-ui/components/atoms/Button.tsx
  2. 3
      striker-ui/types/ButtonProps.d.ts

@ -63,6 +63,7 @@ const Button: FunctionComponent<ButtonProps> = ({
isSubmit,
labelProps,
linkProps,
onClick,
}) => {
const imageElement: JSX.Element | undefined = getButtonImageElement(
imageProps,
@ -91,7 +92,7 @@ const Button: FunctionComponent<ButtonProps> = ({
);
} else {
resultElement = (
<StyledButton type={isSubmit ? 'submit' : 'button'}>
<StyledButton type={isSubmit ? 'submit' : 'button'} {...{ onClick }}>
{imageElement}
{separatorElement}
{labelElement}

@ -1,3 +1,4 @@
import { ButtonHTMLAttributes } from 'react';
import { LinkProps } from 'next/link';
import { ButtonImageProps } from './ButtonImageProps';
@ -7,4 +8,4 @@ type ButtonProps = {
isSubmit?: boolean;
labelProps?: LabelProps;
linkProps?: LinkProps;
};
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;

Loading…
Cancel
Save