Skip to content

Commit 5f94082

Browse files
committed
feat: update button components to use anchor type for external links
1 parent e992132 commit 5f94082

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/Pages/License/ActivateLicense.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import {
55
ActivateLicenseDialog,
66
API_STATUS_CODES,
77
Button,
8+
ButtonComponentType,
89
ButtonVariantType,
910
CONTACT_SUPPORT_LINK,
1011
DevtronLicenseCard,
1112
DevtronProgressing,
1213
ENTERPRISE_SUPPORT_LINK,
1314
ErrorScreenManager,
14-
getHandleOpenURL,
1515
ICDevtronWithBorder,
1616
Icon,
1717
InfoBlock,
@@ -93,9 +93,10 @@ const ActivateLicense = () => {
9393
buttonProps={{
9494
text: 'Contact Support',
9595
variant: ButtonVariantType.text,
96-
onClick: getHandleOpenURL(CONTACT_SUPPORT_LINK),
96+
component: ButtonComponentType.anchor,
9797
dataTestId: 'contact-support',
9898
startIcon: <Icon name="ic-chat-circle-dots" color="B500" size={16} />,
99+
anchorProps: { href: CONTACT_SUPPORT_LINK },
99100
}}
100101
layout="column"
101102
/>

src/components/externalLinks/ExternalLinks.component.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ const ExternalLinkIframeModal = ({ selectedExternalLink, handleCloseModal }) =>
168168
icon={<ICArrowOut />}
169169
variant={ButtonVariantType.borderLess}
170170
size={ComponentSizeType.xs}
171-
component={ButtonComponentType.button}
171+
component={ButtonComponentType.anchor}
172172
style={ButtonStyleType.neutral}
173-
onClick={getHandleOpenURL(selectedExternalLink.externalLinkURL)}
173+
anchorProps={{
174+
href: selectedExternalLink.externalLinkURL,
175+
}}
174176
showAriaLabelInTippy={false}
175177
/>
176178
<Button

src/components/externalLinks/ExternalLinksCRUD/AddExternalLink.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import {
2828
ComponentSizeType,
2929
getHandleOpenURL,
3030
OptionType,
31-
getDocumentationUrl
31+
getDocumentationUrl,
32+
ButtonComponentType
3233
} from '@devtron-labs/devtron-fe-common-lib'
3334
import { DEVTRON_IFRAME_PRIMARY } from '@Config/constants'
3435
import { createGroupedItemsByKey } from '../../common'
@@ -321,7 +322,8 @@ export default function AddExternalLink({
321322
style={ButtonStyleType.neutral}
322323
variant={ButtonVariantType.borderLess}
323324
size={ComponentSizeType.small}
324-
onClick={getHandleOpenURL(getDocumentationUrl({docLinkKey : "EXTERNAL_LINKS"}))}
325+
component={ButtonComponentType.anchor}
326+
anchorProps={{href: getDocumentationUrl({docLinkKey : "EXTERNAL_LINKS"}) }}
325327
showAriaLabelInTippy={false}
326328
showTooltip
327329
tooltipProps={{

0 commit comments

Comments
 (0)