Skip to content

Commit

Permalink
refactor(button): apply component prop to BaseButtonProps interface
Browse files Browse the repository at this point in the history
  • Loading branch information
LTakhyunKim committed Oct 10, 2023
1 parent c323502 commit 7bd03b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/design-system/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { CustomButton } from "./Button.styled";

import type { ButtonProps } from "./Button.types";

const Button = <C extends React.ElementType>(
props: ButtonProps & { component?: C }
) => {
const Button = (props: ButtonProps) => {
const {
size = "small",
color = "primary",
Expand Down
4 changes: 3 additions & 1 deletion packages/design-system/src/components/Button/Button.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { ButtonProps as MuiButtonProps } from "@mui/material";

interface BaseButtonProps extends Omit<MuiButtonProps, "variant"> {
interface BaseButtonProps
extends Omit<MuiButtonProps<React.ElementType>, "variant"> {
icon?: React.ReactNode;
component?: React.ElementType;
}

interface ContainedButtonProps extends BaseButtonProps {
Expand Down

0 comments on commit 7bd03b6

Please sign in to comment.