diff --git a/apps/trading-e2e/.env b/apps/trading-e2e/.env index 67273ea3f..f9f44dd56 100644 --- a/apps/trading-e2e/.env +++ b/apps/trading-e2e/.env @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=http://localhost:8545 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL='' NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet diff --git a/apps/trading-e2e/src/integration/navbar.cy.ts b/apps/trading-e2e/src/integration/navbar.cy.ts index b7db6860d..22fa67e95 100644 --- a/apps/trading-e2e/src/integration/navbar.cy.ts +++ b/apps/trading-e2e/src/integration/navbar.cy.ts @@ -25,6 +25,23 @@ describe('Desktop view', { tags: '@smoke' }, () => { }); }); }); + + it('Resources dropdown should be correctly rendered', () => { + const resourceSelector = 'ul li:last-child'; + ['Docs', 'Give Feedback'].forEach((text, index) => { + cy.get('nav').find(resourceSelector).contains('Resources').click(); + cy.get('nav') + .find(resourceSelector) + .find('.navigation-content li') + .eq(index) + .find('a') + .then((element) => { + expect(element.attr('target')).to.eq('_blank'); + expect(element.attr('href')).to.not.be.empty; + expect(element.text()).to.eq(text); + }); + }); + }); }); }); diff --git a/apps/trading/.env b/apps/trading/.env index aac3932ec..4f53160a1 100644 --- a/apps/trading/.env +++ b/apps/trading/.env @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml NX_VEGA_ENV=STAGNET3 diff --git a/apps/trading/.env.capsule b/apps/trading/.env.capsule index 52ba9a61a..6c8469356 100644 --- a/apps/trading/.env.capsule +++ b/apps/trading/.env.capsule @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL='' NX_VEGA_ENV=CUSTOM diff --git a/apps/trading/.env.devnet b/apps/trading/.env.devnet index 0786c55e0..3b6a48bb7 100644 --- a/apps/trading/.env.devnet +++ b/apps/trading/.env.devnet @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml NX_VEGA_ENV=DEVNET diff --git a/apps/trading/.env.mainnet b/apps/trading/.env.mainnet index f80b3e53a..200dcd1b2 100644 --- a/apps/trading/.env.mainnet +++ b/apps/trading/.env.mainnet @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml NX_VEGA_ENV=MAINNET NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz diff --git a/apps/trading/.env.mirror b/apps/trading/.env.mirror index 31fb1e70d..8aed997ec 100644 --- a/apps/trading/.env.mirror +++ b/apps/trading/.env.mirror @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml NX_VEGA_ENV=MIRROR diff --git a/apps/trading/.env.sandbox b/apps/trading/.env.sandbox index f871ccd01..da308f21f 100644 --- a/apps/trading/.env.sandbox +++ b/apps/trading/.env.sandbox @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.sandbox.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/sandbox/vegawallet-sandbox.toml NX_VEGA_ENV=SANDBOX diff --git a/apps/trading/.env.stagnet1 b/apps/trading/.env.stagnet1 index 4f04db569..d3813f894 100644 --- a/apps/trading/.env.stagnet1 +++ b/apps/trading/.env.stagnet1 @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml NX_VEGA_ENV=STAGNET1 diff --git a/apps/trading/.env.stagnet3 b/apps/trading/.env.stagnet3 index 6ebcdc38f..afdc5bbf4 100644 --- a/apps/trading/.env.stagnet3 +++ b/apps/trading/.env.stagnet3 @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml NX_VEGA_ENV=STAGNET3 diff --git a/apps/trading/.env.testnet b/apps/trading/.env.testnet index 96a6d398c..e8dc3796e 100644 --- a/apps/trading/.env.testnet +++ b/apps/trading/.env.testnet @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml NX_VEGA_ENV=TESTNET diff --git a/apps/trading/.env.validator-testnet b/apps/trading/.env.validator-testnet index ad7eb694d..74cd11ae5 100644 --- a/apps/trading/.env.validator-testnet +++ b/apps/trading/.env.validator-testnet @@ -1,5 +1,6 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8 NX_ETHERSCAN_URL=https://sepolia.etherscan.io +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/testnet2/testnet2.toml NX_VEGA_ENV=VALIDATOR_TESTNET diff --git a/apps/trading/components/navbar/navbar.tsx b/apps/trading/components/navbar/navbar.tsx index a78d118ae..2867e1131 100644 --- a/apps/trading/components/navbar/navbar.tsx +++ b/apps/trading/components/navbar/navbar.tsx @@ -1,8 +1,9 @@ -import type { ComponentProps } from 'react'; +import type { ComponentProps, ReactNode } from 'react'; import { DApp, NetworkSwitcher, TOKEN_GOVERNANCE, + useEnvironment, useLinks, } from '@vegaprotocol/environment'; import { t } from '@vegaprotocol/i18n'; @@ -17,6 +18,8 @@ import { ExternalLink, Icon, NavigationBreakpoint, + NavigationTrigger, + NavigationContent, } from '@vegaprotocol/ui-toolkit'; import { Links, Routes } from '../../pages/client-router'; @@ -26,6 +29,7 @@ export const Navbar = ({ }: { theme: ComponentProps['theme']; }) => { + const { VEGA_DOCS_URL, GITHUB_FEEDBACK_URL } = useEnvironment(); const tokenLink = useLinks(DApp.Token); const { marketId } = useGlobalStore((store) => ({ marketId: store.marketId, @@ -75,13 +79,29 @@ export const Navbar = ({ - - - {t('Governance')}{' '} - - - + + {t('Governance')} + + {VEGA_DOCS_URL && GITHUB_FEEDBACK_URL && ( + + {t('Resources')} + + + + + {t('Docs')} + + + + + {t('Give Feedback')} + + + + + + )} ); }; + +const NavExternalLink = ({ + children, + href, +}: { + children: ReactNode; + href: string; +}) => { + return ( + + + {children} + + + + ); +};