Skip to content

Commit

Permalink
fix(elements): add missing default className to LinkButton
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Sep 27, 2024
1 parent e99e710 commit 8c7d259
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/elements/LinkButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { Size } from '@constants'
import { type IconProps } from '@types_/definitions'
import classnames from 'classnames'
import { isString } from 'lodash'
import { type ButtonHTMLAttributes, type FunctionComponent, type ReactNode } from 'react'
import styled from 'styled-components'

import { Size } from '../constants'
import { THEME } from '../theme'

export type LinkButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
Icon?: FunctionComponent<IconProps> | undefined
children?: string | ReactNode | undefined
size?: Size | undefined
}
export function LinkButton({ children, Icon, size = Size.NORMAL, ...props }: Readonly<LinkButtonProps>) {
export function LinkButton({ children, className, Icon, size = Size.NORMAL, ...props }: Readonly<LinkButtonProps>) {
const controlledClassName = classnames('Element-LinkButton', className)

return (
<StyledLinkButton $size={size} {...props}>
<StyledLinkButton $size={size} className={controlledClassName} {...props}>
<>
{Icon && <Icon color={THEME.color.slateGray} size={ICON_SIZE[size]} />}
{isString(children) ? <p>{children}</p> : <>{children}</>}
Expand Down

0 comments on commit 8c7d259

Please sign in to comment.