Feat/800: Improved way to pass docs url
This commit is contained in:
@@ -8,4 +8,4 @@ NX_ETHEREUM_PROVIDER_URL=https://ropsten.infura.io/v3/4f846e79e13f44d1b51bbd7ed9
|
||||
NX_ETHERSCAN_URL=https://ropsten.etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_VEGA_EXPLORER_URL=https://dev.explorer.vega.xyz
|
||||
NX_DOCS_URL=https://docs.vega.xyz/docs/testnet
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet
|
||||
|
||||
@@ -8,4 +8,4 @@ NX_ETHERSCAN_URL=https://etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_VEGA_REST=https://api.token.vega.xyz/
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz
|
||||
NX_DOCS_URL=https://docs.vega.xyz/docs/mainnet
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/mainnet
|
||||
|
||||
@@ -8,7 +8,7 @@ NX_VEGA_REST=https://api.n01.stagnet3.vega.xyz
|
||||
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
|
||||
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
|
||||
NX_VEGA_EXPLORER_URL=https://staging3.explorer.vega.xyz
|
||||
NX_DOCS_URL=https://docs.vega.xyz/docs/mainnet
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/mainnet
|
||||
|
||||
# App flags
|
||||
NX_EXPLORER_ASSETS=1
|
||||
|
||||
@@ -8,4 +8,4 @@ NX_ETHERSCAN_URL=https://ropsten.etherscan.io
|
||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||
NX_VEGA_REST=https://api.n11.testnet.vega.xyz
|
||||
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
|
||||
NX_DOCS_URL=https://docs.vega.xyz/docs/testnet
|
||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet
|
||||
|
||||
@@ -52,8 +52,9 @@ export const ENV = {
|
||||
branch: windowOrDefault('NX_BRANCH'),
|
||||
vegaUrl: windowOrDefault('NX_VEGA_URL'),
|
||||
restUrl: windowOrDefault('NX_VEGA_REST'),
|
||||
explorerUrl: windowOrDefault('NX_VEGA_EXPLORER'),
|
||||
urlConnect: TRUTHY.includes(windowOrDefault('NX_ETH_URL_CONNECT')),
|
||||
docsUrl: windowOrDefault('NX_DOCS_URL'),
|
||||
docsUrl: windowOrDefault('NX_VEGA_DOCS_URL'),
|
||||
ethWalletMnemonic: windowOrDefault('NX_ETH_WALLET_MNEMONIC'),
|
||||
localProviderUrl: windowOrDefault('NX_LOCAL_PROVIDER_URL'),
|
||||
flags: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FormGroup, InputError, TextArea } from '@vegaprotocol/ui-toolkit';
|
||||
import { ENV } from '../../../../config';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import { ProposalDocsLink } from './proposal-docs-link';
|
||||
import type { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
@@ -15,6 +15,7 @@ export const ProposalFormTerms = function ({
|
||||
errorMessage,
|
||||
labelOverride,
|
||||
}: ProposalFormTermsProps) {
|
||||
const { VEGA_DOCS_URL } = useEnvironment();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<FormGroup
|
||||
@@ -22,7 +23,7 @@ export const ProposalFormTerms = function ({
|
||||
labelFor="proposal-terms"
|
||||
>
|
||||
<div className="mt-[-4px] mb-2 text-sm font-light">
|
||||
<ProposalDocsLink url={ENV.docsUrl} />
|
||||
{VEGA_DOCS_URL && <ProposalDocsLink url={VEGA_DOCS_URL} />}
|
||||
</div>
|
||||
<TextArea
|
||||
id="proposal-terms"
|
||||
|
||||
@@ -2,11 +2,12 @@ import Routes from '../../routes';
|
||||
import classnames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ENV } from '../../../config';
|
||||
import { useEnvironment } from '@vegaprotocol/environment';
|
||||
import { Heading } from '../../../components/heading';
|
||||
import { ProposalDocsLink } from '../components/propose';
|
||||
|
||||
export const Propose = () => {
|
||||
const { VEGA_DOCS_URL } = useEnvironment();
|
||||
const { t } = useTranslation();
|
||||
const linkStyles = classnames('block underline mb-2');
|
||||
|
||||
@@ -14,7 +15,7 @@ export const Propose = () => {
|
||||
<>
|
||||
<section className="pb-6">
|
||||
<Heading title={t('NewProposal')} />
|
||||
<ProposalDocsLink url={ENV.docsUrl} />
|
||||
{VEGA_DOCS_URL && <ProposalDocsLink url={VEGA_DOCS_URL} />}
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
@@ -72,6 +72,8 @@ const getBundledEnvironmentValue = (key: EnvKey) => {
|
||||
return process.env['NX_VEGA_WALLET_URL'];
|
||||
case 'VEGA_TOKEN_URL':
|
||||
return process.env['NX_VEGA_TOKEN_URL'];
|
||||
case 'VEGA_DOCS_URL':
|
||||
return process.env['NX_VEGA_DOCS_URL'];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ const schemaObject = {
|
||||
VEGA_ENV: z.nativeEnum(Networks),
|
||||
VEGA_EXPLORER_URL: z.optional(z.string()),
|
||||
VEGA_TOKEN_URL: z.optional(z.string()),
|
||||
VEGA_DOCS_URL: z.optional(z.string()),
|
||||
VEGA_NETWORKS: z
|
||||
.object(
|
||||
Object.keys(Networks).reduce(
|
||||
|
||||
Reference in New Issue
Block a user