fix(version): use link instead of click handler (#1931)

Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
Yash Joshi 2022-12-27 23:13:13 +05:30 committed by GitHub
parent 35f5fb6957
commit 895c721b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import { WarningFilled } from '@ant-design/icons'; import { WarningFilled } from '@ant-design/icons';
import { Button, Card, Form, Space, Typography } from 'antd'; import { Button, Card, Form, Space, Typography } from 'antd';
import React, { useCallback } from 'react'; import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux'; import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers'; import { AppState } from 'store/reducers';
@ -14,10 +14,6 @@ function Version(): JSX.Element {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { t } = useTranslation(); const { t } = useTranslation();
const onClickUpgradeHandler = useCallback((link: string) => {
window.open(link, '_blank');
}, []);
const { const {
currentVersion, currentVersion,
latestVersion, latestVersion,
@ -60,9 +56,8 @@ function Version(): JSX.Element {
placeholder={t('latest_version')} placeholder={t('latest_version')}
/> />
<Button <Button
onClick={(): void => href="https://github.com/SigNoz/signoz/releases"
onClickUpgradeHandler('https://github.com/SigNoz/signoz/releases') target="_blank"
}
type="link" type="link"
> >
{t('release_notes')} {t('release_notes')}
@ -94,11 +89,8 @@ function Version(): JSX.Element {
{!isError && !isLatestVersion && ( {!isError && !isLatestVersion && (
<Button <Button
onClick={(): void => href="https://signoz.io/docs/operate/docker-standalone/#upgrade"
onClickUpgradeHandler( target="_blank"
'https://signoz.io/docs/operate/docker-standalone/#upgrade',
)
}
> >
{t('read_how_to_upgrade')} {t('read_how_to_upgrade')}
</Button> </Button>