Skip to content

Commit

Permalink
feat: update esling config following PR feedbacks
Browse files Browse the repository at this point in the history
Update esling config following PR feedbacks
  • Loading branch information
acd02 committed Jun 1, 2023
1 parent dff1331 commit 609e6e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 46 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ module.exports = {
'max-nested-callbacks': [1, 4],
},
},
{
files: ['**/*.tsx'],
rules: {
'max-lines-per-function': [1, { max: 150, skipBlankLines: true, skipComments: true }],
},
},
],
settings: {
react: {
Expand Down
72 changes: 26 additions & 46 deletions packages/components/tabs/src/TabsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,19 @@ export const TabsList = forwardRef<HTMLDivElement, TabsListProps>(
return (
<div className={wrapperStyles({ className })} ref={wrapperRef}>
{arrows.prev !== 'hidden' && (
<Components.Prev handleClick={handlePrevClick} disabled={arrows.prev === 'disabled'} />
<Button
shape="square"
intent="surface"
size="sm"
className={navigationArrowStyles()}
onClick={handlePrevClick}
disabled={arrows.prev === 'disabled'}
aria-label="Scroll left"
>
<Icon>
<ArrowVerticalLeft />
</Icon>
</Button>
)}

<RadixTabs.List
Expand All @@ -147,55 +159,23 @@ export const TabsList = forwardRef<HTMLDivElement, TabsListProps>(
</RadixTabs.List>

{arrows.next !== 'hidden' && (
<Components.Next handleClick={handleNextClick} disabled={arrows.prev === 'disabled'} />
<Button
shape="square"
intent="surface"
size="sm"
className={navigationArrowStyles()}
onClick={handleNextClick}
disabled={arrows.next === 'disabled'}
aria-label="Scroll right"
>
<Icon>
<ArrowVerticalRight />
</Icon>
</Button>
)}
</div>
)
}
)

interface ComponentsProps {
NavigationBtn: {
handleClick: () => void
disabled?: boolean
}
}

const Components = {
Prev: ({ handleClick, disabled }: ComponentsProps['NavigationBtn']) => {
return (
<Button
shape="square"
intent="surface"
size="sm"
className={navigationArrowStyles()}
onClick={handleClick}
disabled={disabled}
aria-label="Scroll left"
>
<Icon>
<ArrowVerticalLeft />
</Icon>
</Button>
)
},
Next: ({ handleClick, disabled }: ComponentsProps['NavigationBtn']) => {
return (
<Button
shape="square"
intent="surface"
size="sm"
className={navigationArrowStyles()}
onClick={handleClick}
disabled={disabled}
aria-label="Scroll right"
>
<Icon>
<ArrowVerticalRight />
</Icon>
</Button>
)
},
}

TabsList.displayName = 'Tabs.List'

0 comments on commit 609e6e4

Please sign in to comment.