Skip to content

Commit

Permalink
fix: update button interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyzif committed Sep 27, 2024
1 parent 4ff5f32 commit 442e0ec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/general/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { IIconProps } from 'src/components'
import { ConfigProvider } from 'src/components/other/ConfigProvider/ConfigProvider'
import { type ReactNode } from 'react'

export interface IButtonProps extends AntButtonProps {
export interface IButtonProps extends Omit<AntButtonProps, 'variant'> {
/**
* @deprecated This variant is a temporary fix for new icons.
* Use this variant only with new icons to align the icon and text centered.
Expand All @@ -27,12 +27,13 @@ export const Button = (props: IButtonProps) => {
props.icon
)

const extraClass = props.variant === 'with-new-icon' ? classMap['with-new-icon'] : ''

const { variant, ...restProps } = props

return (
<ConfigProvider>
<AntButton
{...props}
icon={buttonIcon}
className={`${props.className}${props.variant ? ` ${classMap[props.variant]}` : ''}`}>
<AntButton {...restProps} icon={buttonIcon} className={`${props.className ?? ''} ${extraClass}`}>
{props.children}
</AntButton>
</ConfigProvider>
Expand Down

0 comments on commit 442e0ec

Please sign in to comment.