mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 06:55:58 +08:00
fix(version): use link instead of click handler (#1931)
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
35f5fb6957
commit
895c721b37
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user