diff --git a/apps/web/components/ui/Button.tsx b/apps/web/components/ui/Button.tsx index 5079c7f03f..979b55b369 100644 --- a/apps/web/components/ui/Button.tsx +++ b/apps/web/components/ui/Button.tsx @@ -1,137 +1,3 @@ -import Link, { LinkProps } from "next/link"; -import React, { forwardRef } from "react"; - -import classNames from "@lib/classNames"; -import { SVGComponent } from "@lib/types/SVGComponent"; - -export type ButtonBaseProps = { - color?: "primary" | "secondary" | "minimal" | "warn"; - size?: "base" | "sm" | "lg" | "fab" | "icon"; - loading?: boolean; - disabled?: boolean; - onClick?: (event: React.MouseEvent) => void; - StartIcon?: SVGComponent; - EndIcon?: SVGComponent; - shallow?: boolean; -}; -export type ButtonProps = ButtonBaseProps & - ( - | (Omit & { href: LinkProps["href"] }) - | (JSX.IntrinsicElements["button"] & { href?: never }) - ); - -export const Button = forwardRef(function Button( - props: ButtonProps, - forwardedRef -) { - const { - loading = false, - color = "primary", - size = "base", - StartIcon, - EndIcon, - shallow, - // attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps` - ...passThroughProps - } = props; - // Buttons are **always** disabled if we're in a `loading` state - const disabled = props.disabled || loading; - - // If pass an `href`-attr is passed it's ``, otherwise it's a `