fix: `<Button/>` types of `StartIcon`/`EndIcon` (#562)

pull/566/head^2
Alex Johansson 2021-09-03 17:34:57 +02:00 committed by GitHub
parent adff0d0176
commit ab33cbde4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -2,14 +2,16 @@ import classNames from "@lib/classNames";
import Link, { LinkProps } from "next/link";
import React from "react";
type SVGComponent = React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export type ButtonProps = {
color?: "primary" | "secondary" | "minimal";
size?: "base" | "sm" | "lg" | "fab";
loading?: boolean;
disabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
StartIcon?: JSX.IntrinsicElements["svg"];
EndIcon?: JSX.IntrinsicElements["svg"];
StartIcon?: SVGComponent;
EndIcon?: SVGComponent;
} & (
| (Omit<JSX.IntrinsicElements["a"], "href"> & { href: LinkProps["href"] })
| (JSX.IntrinsicElements["button"] & { href?: never })