switch to TextLink
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { featureEnabled } from '@grafana/runtime';
|
||||
import { Badge, Button, PluginSignatureBadge, Stack, useStyles2 } from '@grafana/ui';
|
||||
import { Badge, PluginSignatureBadge, Stack, TextLink, useStyles2 } from '@grafana/ui';
|
||||
|
||||
import { CatalogPlugin } from '../../types';
|
||||
|
||||
@@ -11,14 +11,6 @@ type Props = { plugin: CatalogPlugin };
|
||||
|
||||
export function PluginEnterpriseBadge({ plugin }: Props): React.ReactElement {
|
||||
const customBadgeStyles = useStyles2(getBadgeColor);
|
||||
const onClick = (ev: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
||||
ev.preventDefault();
|
||||
window.open(
|
||||
`https://grafana.com/grafana/plugins/${plugin.id}?utm_source=grafana_catalog_learn_more`,
|
||||
'_blank',
|
||||
'noopener,noreferrer'
|
||||
);
|
||||
};
|
||||
|
||||
if (featureEnabled('enterprise.plugins')) {
|
||||
return <Badge text="Enterprise" color="blue" />;
|
||||
@@ -35,9 +27,13 @@ export function PluginEnterpriseBadge({ plugin }: Props): React.ReactElement {
|
||||
color="blue"
|
||||
className={customBadgeStyles}
|
||||
/>
|
||||
<Button size="sm" fill="text" icon="external-link-alt" onClick={onClick}>
|
||||
<TextLink
|
||||
external={true}
|
||||
inline={false}
|
||||
href={`https://grafana.com/grafana/plugins/${plugin.id}?utm_source=grafana_catalog_learn_more`}
|
||||
>
|
||||
Learn more
|
||||
</Button>
|
||||
</TextLink>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user