Skip to content

Commit

Permalink
chore: ran prettier (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjitrosch committed Apr 16, 2022
1 parent 81fc70e commit f46ac7d
Show file tree
Hide file tree
Showing 43 changed files with 580 additions and 407 deletions.
7 changes: 4 additions & 3 deletions src/Artboard/Artboard.tsx
Expand Up @@ -26,10 +26,11 @@ const Artboard = forwardRef<HTMLDivElement, ArtboardProps>(
)

return (
<div
<div
aria-label="Artboard"
{...props} ref={ref}
data-theme={dataTheme}
{...props}
ref={ref}
data-theme={dataTheme}
className={classes}
>
{children}
Expand Down
11 changes: 10 additions & 1 deletion src/Badge/Badge.tsx
Expand Up @@ -14,7 +14,16 @@ export type BadgeProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> &

const Badge = forwardRef<HTMLDivElement, BadgeProps>(
(
{ children, variant, size, color, responsive, dataTheme, className, ...props },
{
children,
variant,
size,
color,
responsive,
dataTheme,
className,
...props
},
ref
): JSX.Element => {
const classes = twMerge(
Expand Down
6 changes: 1 addition & 5 deletions src/Breadcrumbs/BreadcrumbsItem.tsx
Expand Up @@ -7,11 +7,7 @@ export type BreadcrumbsItemProps = React.LiHTMLAttributes<HTMLLIElement> & {
const BreadcrumbsItem = React.forwardRef<HTMLLIElement, BreadcrumbsItemProps>(
({ children, href, ...props }, ref): JSX.Element => {
return (
<li
role="link"
{...props}
ref={ref}
>
<li role="link" {...props} ref={ref}>
{href ? <a href={href}>{children}</a> : <>{children}</>}
</li>
)
Expand Down
8 changes: 3 additions & 5 deletions src/Button/Button.stories.tsx
Expand Up @@ -21,7 +21,7 @@ const Template: Story<ButtonProps> = (args) => {
}
export const Default = Template.bind({})
Default.args = {
children: 'Button'
children: 'Button',
}

export const Colors: Story<ButtonProps> = (args) => {
Expand Down Expand Up @@ -108,14 +108,12 @@ export const AsHref: Story<ButtonProps> = (args) => {
return (
<div className="flex gap-x-2">
<Button
{...args}
{...args}
onClick={() => alert('See, I have an onClick event and no href.')}
>
I'm a {`<button>`}
</Button>
<Button href="https://google.com">
I'm an {`<a>`}
</Button>
<Button href="https://google.com">I'm an {`<a>`}</Button>
</div>
)
}
8 changes: 2 additions & 6 deletions src/Button/Button.test.tsx
Expand Up @@ -31,13 +31,9 @@ describe('Button', () => {
})

it('Renders an anchor tag when an href exists', () => {
const { getByRole } = render(
<Button href="/home">
Home
</Button>
)
const { getByRole } = render(<Button href="/home">Home</Button>)

expect(getByRole("link")).toBeTruthy()
expect(getByRole('link')).toBeTruthy()
expect(getByRole('link')).toHaveAttribute('href', '/home')
})
})
10 changes: 2 additions & 8 deletions src/Button/Button.tsx
Expand Up @@ -55,9 +55,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
const classes = twMerge(
'btn',
className,
clsx(
((startIcon && !loading) || endIcon) && 'gap-2',
{
clsx(((startIcon && !loading) || endIcon) && 'gap-2', {
[`btn-${size}`]: size,
[`btn-${shape}`]: shape,
[`btn-${variant}`]: variant,
Expand All @@ -73,11 +71,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(

if (href) {
return (
<a
className={classes}
style={style}
href={href}
>
<a className={classes} style={style} href={href}>
{startIcon && startIcon}
{children}
{endIcon && endIcon}
Expand Down
6 changes: 3 additions & 3 deletions src/ButtonGroup/ButtonGroup.tsx
Expand Up @@ -17,9 +17,9 @@ const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(
return (
<div
aria-label={`Group of ${children.length} buttons`}
{...props}
data-theme={dataTheme}
className={classes}
{...props}
data-theme={dataTheme}
className={classes}
ref={ref}
>
{children}
Expand Down

0 comments on commit f46ac7d

Please sign in to comment.