src: Add betaPath helper function

This replaces all occurences of `isBeta() ? CONTENT_BETA : CONTENT_STABLE` with `betaPath(CONTENT_URL, isBeta())`.
This commit is contained in:
regexowl 2024-06-27 17:07:56 +02:00 committed by Ondřej Ezr
parent b198768ca6
commit c0508e00ce
8 changed files with 27 additions and 20 deletions

View file

@ -17,13 +17,14 @@ import {
InProgressIcon,
} from '@patternfly/react-icons';
import { CONTENT_BETA, CONTENT_STABLE } from '../../../../constants';
import { CONTENT_URL } from '../../../../constants';
import { ApiRepositoryResponse } from '../../../../store/contentSourcesApi';
import {
convertStringToDate,
timestampToDisplayString,
} from '../../../../Utilities/time';
import { useGetEnvironment } from '../../../../Utilities/useGetEnvironment';
import { betaPath } from '../../utilities/betaPath';
const getLastIntrospection = (
repoIntrospections: RepositoryStatusProps['repoIntrospections']
@ -119,7 +120,7 @@ const RepositoriesStatus = ({
iconPosition="right"
isInline
icon={<ExternalLinkAltIcon />}
href={isBeta() ? CONTENT_BETA : CONTENT_STABLE}
href={betaPath(CONTENT_URL, isBeta())}
>
Go to Repositories
</Button>