feat(1824): update docs links to new URL structure (remove '/docs') (#2140)
* feat(1824): Update docs links to new URL structure (remove '/docs') * feat(1824): Updated proposals doc links to use new helper * feat(1824): ensuring custom url string added to link in proposal-form-terms.tsx
This commit is contained in:
parent
5922994a26
commit
ba4a5f104c
@ -6,15 +6,15 @@ const LINKS = {
|
||||
testnet: [
|
||||
{
|
||||
label: 'Learn about liquidity fees',
|
||||
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#resources',
|
||||
url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#resources',
|
||||
},
|
||||
{
|
||||
label: 'Provide liquidity',
|
||||
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#overview',
|
||||
url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#overview',
|
||||
},
|
||||
{
|
||||
label: 'View your liquidity provisions',
|
||||
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#viewing-existing-liquidity-provisions',
|
||||
url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#viewing-existing-liquidity-provisions',
|
||||
},
|
||||
{
|
||||
label: 'Amend or remove liquidity',
|
||||
|
@ -7,4 +7,4 @@ NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9
|
||||
NX_ETHERSCAN_URL=https://etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/mainnet
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||
|
@ -5,6 +5,7 @@ import {
|
||||
ExternalLink,
|
||||
TextArea,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import { createDocsLinks } from '@vegaprotocol/react-helpers';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import type { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
@ -32,9 +33,13 @@ export const ProposalFormTerms = ({
|
||||
<div className="mt-[-4px] mb-2 text-sm font-light">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${docsLink}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${docsLink}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${docsLink}`}</ExternalLink>
|
||||
>
|
||||
{`${createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}${docsLink}`}
|
||||
</ExternalLink>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
@ -18,7 +18,11 @@ import { ProposalMinRequirements } from '../../components/shared';
|
||||
import { AsyncRenderer, ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||
import { Heading } from '../../../../components/heading';
|
||||
import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
|
||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
import { ProposalUserAction } from '../../components/shared';
|
||||
|
||||
export interface FreeformProposalFormFields {
|
||||
@ -29,7 +33,7 @@ export interface FreeformProposalFormFields {
|
||||
proposalReference: string;
|
||||
}
|
||||
|
||||
const DOCS_LINK = 'freeform-proposal';
|
||||
const DOCS_LINK = '/freeform-proposal';
|
||||
|
||||
export const ProposeFreeform = () => {
|
||||
const { params, loading, error } = useNetworkParams([
|
||||
@ -96,9 +100,13 @@ export const ProposeFreeform = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals/${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals/${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -2,6 +2,7 @@ import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import {
|
||||
createDocsLinks,
|
||||
suitableForSyntaxHighlighter,
|
||||
useNetworkParams,
|
||||
} from '@vegaprotocol/react-helpers';
|
||||
@ -168,9 +169,13 @@ export const ProposeNetworkParameter = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
} from '@vegaprotocol/governance';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
validateJson,
|
||||
@ -135,9 +136,13 @@ export const ProposeNewAsset = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
} from '@vegaprotocol/governance';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
validateJson,
|
||||
@ -125,9 +126,13 @@ export const ProposeNewMarket = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
|
||||
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import { Heading } from '../../../components/heading';
|
||||
import { createDocsLinks } from '@vegaprotocol/react-helpers';
|
||||
|
||||
export const Propose = () => {
|
||||
const { VEGA_DOCS_URL, VEGA_EXPLORER_URL } = useEnvironment();
|
||||
@ -18,9 +19,11 @@ export const Propose = () => {
|
||||
<p>
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals`}
|
||||
href={createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals`}</ExternalLink>
|
||||
>
|
||||
{createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
|
||||
</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
{VEGA_EXPLORER_URL && (
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
TextArea,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
validateJson,
|
||||
@ -88,9 +89,11 @@ export const ProposeRaw = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals`}
|
||||
href={createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals`}</ExternalLink>
|
||||
>
|
||||
{createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
|
||||
</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
} from '@vegaprotocol/governance';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
validateJson,
|
||||
@ -125,9 +126,13 @@ export const ProposeUpdateAsset = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
} from '@vegaprotocol/governance';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import {
|
||||
createDocsLinks,
|
||||
NetworkParams,
|
||||
useNetworkParams,
|
||||
validateJson,
|
||||
@ -188,9 +189,13 @@ export const ProposeUpdateMarket = () => {
|
||||
<p className="text-sm" data-testid="proposal-docs-link">
|
||||
<span className="mr-1">{t('ProposalTermsText')}</span>
|
||||
<ExternalLink
|
||||
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}
|
||||
href={`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}
|
||||
target="_blank"
|
||||
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink>
|
||||
>{`${
|
||||
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
|
||||
}${DOCS_LINK}`}</ExternalLink>
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import { Schema } from '@vegaprotocol/types';
|
||||
|
||||
// More detail in https://docs.vega.xyz/docs/mainnet/graphql/enums/order-time-in-force
|
||||
// More detail in https://docs.vega.xyz/mainnet/graphql/enums/order-time-in-force
|
||||
export const timeInForceLabel = (tif: string) => {
|
||||
switch (tif) {
|
||||
case Schema.OrderTimeInForce.TIME_IN_FORCE_GTC:
|
||||
|
@ -9,6 +9,7 @@ export const createDocsLinks = (docsUrl: string) => ({
|
||||
AUCTION_TYPE_CLOSING: `${docsUrl}/concepts/trading-on-vega/trading-modes#auction-type-closing`,
|
||||
STAKING_GUIDE: `${docsUrl}/concepts/vega-chain/#staking-on-vega`,
|
||||
VEGA_WALLET_CONCEPTS_URL: `${docsUrl}/concepts/vega-wallet`,
|
||||
PROPOSALS_GUIDE: `${docsUrl}/tutorials/proposals`,
|
||||
});
|
||||
|
||||
export const ExternalLinks = {
|
||||
@ -16,7 +17,6 @@ export const ExternalLinks = {
|
||||
GITHUB: 'https://github.com/vegaprotocol/token-frontend',
|
||||
DISCORD: 'https://vega.xyz/discord',
|
||||
GOVERNANCE_PAGE: 'https://vega.xyz/governance',
|
||||
PROPOSALS_GUIDE: 'https://docs.vega.xyz/docs/mainnet/tutorials/proposals',
|
||||
VALIDATOR_FORUM: 'https://community.vega.xyz/c/mainnet-validator-candidates',
|
||||
MARGIN_CREDIT_RISK:
|
||||
'https://vega.xyz/papers/margins-and-credit-risk.pdf#page=7',
|
||||
|
Loading…
Reference in New Issue
Block a user