Skip to content

Commit 3f1ebc0

Browse files
committed
feat: add type for unique tab group id prop
1 parent 98335a8 commit 3f1ebc0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/Shared/Components/TabGroup/TabGroup.component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Tooltip } from '@Common/Tooltip'
2121
import { ComponentSizeType } from '@Shared/constants'
2222

2323
import { getPathnameToMatch, getTabBadge, getTabDescription, getTabIcon, getTabIndicator } from './TabGroup.helpers'
24-
import { TabGroupProps, TabProps } from './TabGroup.types'
24+
import { AdditionalTabProps, TabGroupProps, TabProps } from './TabGroup.types'
2525
import { getClassNameBySizeMap, tabGroupClassMap } from './TabGroup.utils'
2626

2727
import './TabGroup.scss'
@@ -60,7 +60,8 @@ const Tab = ({
6060
tooltipProps,
6161
uniqueGroupId,
6262
}: TabProps &
63-
Pick<TabGroupProps, 'size' | 'alignActiveBorderWithContainer' | 'hideTopPadding'> & { uniqueGroupId: string }) => {
63+
Pick<TabGroupProps, 'size' | 'alignActiveBorderWithContainer' | 'hideTopPadding'> &
64+
AdditionalTabProps) => {
6465
const { path } = useRouteMatch()
6566
const pathToMatch = tabType === 'navLink' || tabType === 'link' ? getPathnameToMatch(props.to, path) : ''
6667
const match = useRouteMatch(pathToMatch)

src/Shared/Components/TabGroup/TabGroup.types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,7 @@ export interface TabGroupProps {
163163
*/
164164
hideTopPadding?: boolean
165165
}
166+
167+
export type AdditionalTabProps = {
168+
uniqueGroupId: string
169+
}

0 commit comments

Comments
 (0)