Skip to content

Commit bd7e649

Browse files
committed
feat(styles): add custom className and style support in DualScrollSyncNav component
1 parent 790d88f commit bd7e649

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

lib/components/DualScrollSync/DualScrollSyncNav/DualScrollSyncNav.test.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,17 @@ describe('DualScrollSyncNav', () => {
4444
const navElement = getByTestId('test-nav-id');
4545
expect(navElement).toHaveStyle({ '--menu-nav-visible-count': '3' });
4646
});
47+
48+
it('should apply custom className and style', () => {
49+
const { getByTestId } = render(
50+
<DualScrollSyncNav className="custom-class" style={{ borderWidth: '1px' }}>
51+
<div>Styled Content</div>
52+
</DualScrollSyncNav>
53+
);
54+
55+
const nav = getByTestId('test-nav-id');
56+
57+
expect(nav).toHaveClass('custom-class');
58+
expect(nav).toHaveStyle('border-width: 1px');
59+
});
4760
});

lib/components/DualScrollSync/DualScrollSyncNav/DualScrollSyncNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import type { DualScrollSyncNavProps } from './DualScrollSyncNav.types';
1010
export const DualScrollSyncNav: FC<DualScrollSyncNavProps> = ({
1111
children,
1212
className,
13-
style = {},
14-
maxVisibleItems = 6
13+
maxVisibleItems = 6,
14+
style = {}
1515
}) => {
1616
const { navId, navRef } = useDualScrollSyncContext();
1717
const navItemCount = Children.count(children);

0 commit comments

Comments
 (0)