Feat/800: Set up env-specific proposal docs links
This commit is contained in:
@@ -8,3 +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
|
||||
|
||||
@@ -8,3 +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
|
||||
|
||||
@@ -8,6 +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
|
||||
|
||||
# App flags
|
||||
NX_EXPLORER_ASSETS=1
|
||||
|
||||
@@ -8,3 +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
|
||||
|
||||
@@ -53,6 +53,7 @@ export const ENV = {
|
||||
vegaUrl: windowOrDefault('NX_VEGA_URL'),
|
||||
restUrl: windowOrDefault('NX_VEGA_REST'),
|
||||
urlConnect: TRUTHY.includes(windowOrDefault('NX_ETH_URL_CONNECT')),
|
||||
docsUrl: windowOrDefault('NX_DOCS_URL'),
|
||||
ethWalletMnemonic: windowOrDefault('NX_ETH_WALLET_MNEMONIC'),
|
||||
localProviderUrl: windowOrDefault('NX_LOCAL_PROVIDER_URL'),
|
||||
flags: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './flags';
|
||||
export * from './links';
|
||||
export * from './network-params';
|
||||
export * from './env';
|
||||
|
||||
@@ -631,7 +631,7 @@
|
||||
"Freeform proposal": "Freeform proposal",
|
||||
"NewProposal": "New proposal",
|
||||
"ProposalTypeQuestion": "What type of proposal would you like to make?",
|
||||
"NetworkParameterProposal": "Network parameter proposal",
|
||||
"NetworkParameterProposal": "Update network parameter proposal",
|
||||
"NewMarketProposal": "New market proposal",
|
||||
"UpdateMarketProposal": "Update market proposal",
|
||||
"NewAssetProposal": "New asset proposal",
|
||||
@@ -642,14 +642,15 @@
|
||||
"totalSupply": "Total Supply",
|
||||
"viaWallet": "via wallet",
|
||||
"viaContract": "via vesting",
|
||||
"ProposalDocsPrefix": "For guidance on how to make proposals, see",
|
||||
"NetworkParameter": "Network parameter",
|
||||
"NewMarket": "New market",
|
||||
"UpdateMarket": "Update market",
|
||||
"NewAsset": "New asset",
|
||||
"Freeform": "Freeform",
|
||||
"RawProposal": "Let me choose (raw proposal)",
|
||||
"UseMin": "Use min",
|
||||
"UseMax": "Use max",
|
||||
"UseMin": "Use minimum",
|
||||
"UseMax": "Use maximum",
|
||||
"Proposal": "Proposal",
|
||||
"ProposalRationale": "Proposal rationale",
|
||||
"ProposalTitle": "Title",
|
||||
@@ -662,8 +663,8 @@
|
||||
"ProposalReference": "Reference",
|
||||
"ProposalVoteTitle": "Vote deadline",
|
||||
"ProposalVoteAndEnactmentTitle": "Vote deadline and enactment",
|
||||
"ProposalVoteDeadline": "Time till vote deadline",
|
||||
"ProposalEnactmentDeadline": "Time till enactment deadline (after vote close)",
|
||||
"ProposalVoteDeadline": "Time till voting closes",
|
||||
"ProposalEnactmentDeadline": "Time till enactment (after vote close)",
|
||||
"Hours": "hours",
|
||||
"SelectAMarketToChange": "Select a market to change",
|
||||
"MarketName": "Market name",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ENV } from '../config/env';
|
||||
import { ENV } from '../config';
|
||||
|
||||
export function getDataNodeUrl() {
|
||||
const base = ENV.vegaUrl;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './proposal-docs-link';
|
||||
export * from './proposal-form-subheader';
|
||||
export * from './proposal-form-min-requirements';
|
||||
export * from './proposal-form-title';
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import classnames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from '@vegaprotocol/ui-toolkit';
|
||||
|
||||
interface ProposalDocsLinkProps {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export const ProposalDocsLink = ({ url }: ProposalDocsLinkProps) => {
|
||||
const { t } = useTranslation();
|
||||
const docsLink = `${url}/tutorials/proposals`;
|
||||
const linkStyles = classnames('underline mb-2');
|
||||
|
||||
return (
|
||||
<p>
|
||||
{t('ProposalDocsPrefix')}{' '}
|
||||
<Link href={docsLink} target="_blank" className={linkStyles}>
|
||||
{docsLink}
|
||||
</Link>
|
||||
</p>
|
||||
);
|
||||
};
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import { ProposalFormMinRequirements } from './proposal-form-min-requirements';
|
||||
|
||||
describe('ProposalFormMinRequirements', () => {
|
||||
it('should render successfully without value applied', () => {
|
||||
const { baseElement } = render(<ProposalFormMinRequirements />);
|
||||
expect(baseElement).toHaveTextContent(
|
||||
'You must have at least 1 VEGA associated to make a proposal'
|
||||
);
|
||||
});
|
||||
|
||||
it('should render successfully with supplied value', () => {
|
||||
const { baseElement } = render(<ProposalFormMinRequirements value="2" />);
|
||||
expect(baseElement).toBeTruthy();
|
||||
|
||||
expect(baseElement).toHaveTextContent(
|
||||
'You must have at least 2 VEGA associated to make a proposal'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
FormGroup,
|
||||
InputError,
|
||||
Link,
|
||||
TextArea,
|
||||
} from '@vegaprotocol/ui-toolkit';
|
||||
import { Links } from '../../../../config';
|
||||
import { FormGroup, InputError, TextArea } from '@vegaprotocol/ui-toolkit';
|
||||
import { ENV } from '../../../../config';
|
||||
import { ProposalDocsLink } from './proposal-docs-link';
|
||||
import type { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
interface ProposalFormTermsProps {
|
||||
@@ -26,14 +22,7 @@ export const ProposalFormTerms = function ({
|
||||
labelFor="proposal-terms"
|
||||
>
|
||||
<div className="mt-[-4px] mb-2 text-sm font-light">
|
||||
{`${t('ProposalTermsText')} `}
|
||||
<Link
|
||||
href={Links.PROPOSALS_GUIDE}
|
||||
target="_blank"
|
||||
className="underline"
|
||||
>
|
||||
{t('ProposalsGuide')}
|
||||
</Link>
|
||||
<ProposalDocsLink url={ENV.docsUrl} />
|
||||
</div>
|
||||
<TextArea
|
||||
id="proposal-terms"
|
||||
|
||||
@@ -2,8 +2,9 @@ import Routes from '../../routes';
|
||||
import classnames from 'classnames';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ENV } from '../../../config';
|
||||
import { Heading } from '../../../components/heading';
|
||||
import { Links } from '../../../config';
|
||||
import { ProposalDocsLink } from '../components/propose';
|
||||
|
||||
export const Propose = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -13,16 +14,7 @@ export const Propose = () => {
|
||||
<>
|
||||
<section className="pb-6">
|
||||
<Heading title={t('NewProposal')} />
|
||||
<p>
|
||||
{t('words words words read more on')}{' '}
|
||||
<Link
|
||||
to={Links.PROPOSALS_GUIDE}
|
||||
target="_blank"
|
||||
className="underline"
|
||||
>
|
||||
{Links.PROPOSALS_GUIDE}
|
||||
</Link>{' '}
|
||||
</p>
|
||||
<ProposalDocsLink url={ENV.docsUrl} />
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
Reference in New Issue
Block a user