Skip to content

Commit 6f59577

Browse files
authored
chore: refactor DualScrollSync types and imports for consistency (#19)
1 parent 63bd059 commit 6f59577

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

lib/components/DualScrollSync/DualScrollSync.types.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { type CSSProperties, type PropsWithChildren } from 'react';
1+
import { type CSSProperties, type FC, type PropsWithChildren } from 'react';
22

3-
import type { DualScrollSync } from './DualScrollSync';
4-
import type { DualScrollSyncContent } from './DualScrollSyncContent';
5-
import type { DualScrollSyncContentSection } from './DualScrollSyncContentSection';
6-
import type { DualScrollSyncLabel } from './DualScrollSyncLabel';
7-
import type { DualScrollSyncNav } from './DualScrollSyncNav';
8-
import type { DualScrollSyncNavItem } from './DualScrollSyncNavItem';
3+
import type { DualScrollSyncContentProps } from './DualScrollSyncContent';
4+
import type { DualScrollSyncContentSectionProps } from './DualScrollSyncContentSection';
5+
import type { DualScrollSyncLabelProps } from './DualScrollSyncLabel';
6+
import type { DualScrollSyncNavProps } from './DualScrollSyncNav';
7+
import type { DualScrollSyncNavItemProps } from './DualScrollSyncNavItem';
98

109
export type DualScrollSyncStyleProps = {
1110
className?: string;
@@ -44,10 +43,10 @@ export type DualScrollSyncProps = PropsWithChildren<{
4443
onItemClick?: (activeKey: string) => void;
4544
}>;
4645

47-
export type DualScrollSyncType = typeof DualScrollSync & {
48-
Nav: typeof DualScrollSyncNav;
49-
NavItem: typeof DualScrollSyncNavItem;
50-
Content: typeof DualScrollSyncContent;
51-
ContentSection: typeof DualScrollSyncContentSection;
52-
Label: typeof DualScrollSyncLabel;
46+
export type DualScrollSyncType = FC<DualScrollSyncProps> & {
47+
Nav: FC<DualScrollSyncNavProps>;
48+
NavItem: FC<DualScrollSyncNavItemProps>;
49+
Content: FC<DualScrollSyncContentProps>;
50+
ContentSection: FC<DualScrollSyncContentSectionProps>;
51+
Label: FC<DualScrollSyncLabelProps>;
5352
};

lib/components/DualScrollSync/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DualScrollSync as CompoundDualScrollSync } from './DualScrollSync';
1+
import { DualScrollSync as DualScrollSyncBase } from './DualScrollSync';
22
import type { DualScrollSyncType } from './DualScrollSync.types';
33
import { DualScrollSyncContent } from './DualScrollSyncContent';
44
import { DualScrollSyncContentSection } from './DualScrollSyncContentSection/DualScrollSyncContentSection';
@@ -12,7 +12,7 @@ export type * from './DualScrollSyncContentSection';
1212
export type * from './DualScrollSyncNav';
1313
export type * from './DualScrollSyncNavItem';
1414

15-
export const DualScrollSync: DualScrollSyncType = Object.assign(CompoundDualScrollSync, {
15+
export const DualScrollSync: DualScrollSyncType = Object.assign(DualScrollSyncBase, {
1616
Nav: DualScrollSyncNav,
1717
NavItem: DualScrollSyncNavItem,
1818
Content: DualScrollSyncContent,

0 commit comments

Comments
 (0)