Skip to content

Commit 2195161

Browse files
committed
chore: code refactoring
1 parent 99d8a85 commit 2195161

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/Shared/Components/DocLink/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ export type DocLinkProps<T extends boolean = false> = Pick<
2525
*/
2626
openInNewTab?: boolean
2727
}
28+
29+
export interface URLWithUTMSource {
30+
isEnterprise: BaseDocLink<false>['isEnterprise']
31+
link?: string
32+
}

src/Shared/Components/DocLink/utils.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { DOCUMENTATION_HOME_PAGE, DOCUMENTATION_VERSION } from '@Common/Constants'
22

33
import { DOCUMENTATION } from './constants'
4-
import { BaseDocLink } from './types'
4+
import { BaseDocLink, URLWithUTMSource } from './types'
55

6-
export const getUTMPathAppended = ({ isEnterprise, link }: { isEnterprise: boolean; link?: string }) =>
6+
export const getUTMPathAppended = ({ isEnterprise, link = '' }: URLWithUTMSource) =>
77
`${link}?utm_source=product_${isEnterprise ? 'ent' : 'oss'}&utm_medium=product_app&utm_campaign=docs_navigation`
88

99
export const getDocumentationUrl = <T extends boolean = false>({

0 commit comments

Comments
 (0)