Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Wilson committed Nov 7, 2023
1 parent a14ee04 commit 94c7b34
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
21 changes: 13 additions & 8 deletions packages/components/src/atoms/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ const Icon = lazy(() =>
import('../../primal').then(module => ({ default: module.Icon }))
);

import { ComponentPropsWithRef, ReactNode } from 'react';

import { InteractableProps, Text, IconProps } from '../../primal';

import { StyledInteractable, iconOrientations, iconMargins } from './styled';
import {ComponentPropsWithRef, ReactNode} from "react";

export interface Props
extends Omit<InteractableProps, 'size'>, Omit<ComponentPropsWithRef<'button'>, 'onDoubleClick' | 'onClick' | 'color'> {
extends Omit<InteractableProps, 'size'>,
Omit<
ComponentPropsWithRef<'button'>,
'onDoubleClick' | 'onClick' | 'color'
> {
iconName?: IconProps['name'];
iconPosition?: 'left' | 'top' | 'right' | 'bottom';
variant?: string;
Expand All @@ -30,10 +35,10 @@ const Button = ({
variant = 'default',
type = 'button',
size = 'md',
onDragStart,
onDrag,
onDragEnd,
onDrop,
onDragStart,
onDrag,
onDragEnd,
onDrop,
...rest
}: Props): ReactNode => {
const hasChildren = useMemo(
Expand All @@ -52,8 +57,8 @@ const Button = ({
size={size}
onDragStart={onDragStart}
onDrag={onDrag}
onDragEnd={onDragEnd}
onDrop={onDrop}
onDragEnd={onDragEnd}
onDrop={onDrop}
{...rest}
{...iconOrientations[iconPosition]}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {act, screen, waitFor} from '@testing-library/react';
import { act, screen, waitFor } from '@testing-library/react';

import { mountWithTheme } from '../../../test-tools';
import { Button } from '../index';
Expand Down
8 changes: 7 additions & 1 deletion packages/components/src/atoms/button/story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ export const IconButtons = () => (
);

export const IconOnly = () => <Button iconName='github' />;
export const Draggable = () => <Button iconName='github' draggable onDragStart={() => console.log("START DRAG")} />;
export const Draggable = () => (
<Button
iconName='github'
draggable
onDragStart={() => console.log('START DRAG')}
/>
);

0 comments on commit 94c7b34

Please sign in to comment.