feat(trading): use i18next (#5238)
Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
This commit is contained in:
parent
090d340364
commit
f377e07996
4
.gitignore
vendored
4
.gitignore
vendored
@ -48,12 +48,12 @@ cypress.env.json
|
|||||||
# Next.js
|
# Next.js
|
||||||
.next
|
.next
|
||||||
|
|
||||||
#cypress
|
# cypress
|
||||||
/apps/**/cypress/reports/
|
/apps/**/cypress/reports/
|
||||||
/apps/**/cypress/downloads/
|
/apps/**/cypress/downloads/
|
||||||
/apps/**/fixtures/wallet/node**
|
/apps/**/fixtures/wallet/node**
|
||||||
|
|
||||||
#console-test
|
# apps/trading/e2e
|
||||||
__pycache__/
|
__pycache__/
|
||||||
apps/trading/e2e/logs/
|
apps/trading/e2e/logs/
|
||||||
apps/trading/e2e/.pytest_cache/
|
apps/trading/e2e/.pytest_cache/
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Add files here to ignore them from prettier formatting
|
# Add files here to ignore them from prettier formatting
|
||||||
|
|
||||||
/dist
|
/dist
|
||||||
|
/dist-result
|
||||||
/coverage
|
/coverage
|
||||||
__generated__
|
__generated__
|
||||||
__generated___
|
__generated___
|
||||||
@ -13,3 +14,10 @@ apps/static/src/assets/testnet-tranches.json
|
|||||||
/apps/**/cypress/downloads/
|
/apps/**/cypress/downloads/
|
||||||
|
|
||||||
/.nx/cache
|
/.nx/cache
|
||||||
|
|
||||||
|
# apps/trading/e2e
|
||||||
|
__pycache__/
|
||||||
|
apps/trading/e2e/logs/
|
||||||
|
apps/trading/e2e/.pytest_cache/
|
||||||
|
apps/trading/e2e/traces/
|
||||||
|
.pytest_cache/
|
||||||
|
@ -34,6 +34,7 @@ i18n
|
|||||||
ns: ['governance'],
|
ns: ['governance'],
|
||||||
defaultNS: 'governance',
|
defaultNS: 'governance',
|
||||||
keySeparator: false, // we use content as keys
|
keySeparator: false, // we use content as keys
|
||||||
|
nsSeparator: false,
|
||||||
backend,
|
backend,
|
||||||
saveMissing: useLocize && !!process.env.NX_LOCIZE_API_KEY,
|
saveMissing: useLocize && !!process.env.NX_LOCIZE_API_KEY,
|
||||||
interpolation: {
|
interpolation: {
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
export const useTranslation = () => ({
|
|
||||||
t: (label: string, replacements?: Record<string, string>) => {
|
|
||||||
let translatedLabel = label;
|
|
||||||
if (typeof replacements === 'object' && replacements !== null) {
|
|
||||||
Object.keys(replacements).forEach((key) => {
|
|
||||||
translatedLabel = translatedLabel.replace(
|
|
||||||
`{{${key}}}`,
|
|
||||||
replacements[key]
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return translatedLabel;
|
|
||||||
},
|
|
||||||
});
|
|
@ -1,9 +1,10 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { NavLink, Outlet } from 'react-router-dom';
|
import { NavLink, Outlet } from 'react-router-dom';
|
||||||
|
|
||||||
export const Assets = () => {
|
export const Assets = () => {
|
||||||
|
const t = useT();
|
||||||
const linkClasses = ({ isActive }: { isActive: boolean }) => {
|
const linkClasses = ({ isActive }: { isActive: boolean }) => {
|
||||||
return classNames('border-b-2 border-transparent', {
|
return classNames('border-b-2 border-transparent', {
|
||||||
'border-vega-yellow': isActive,
|
'border-vega-yellow': isActive,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Intent, TradingAnchorButton } from '@vegaprotocol/ui-toolkit';
|
import { Intent, TradingAnchorButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { GetStartedCheckList } from '../../components/welcome-dialog';
|
import { GetStartedCheckList } from '../../components/welcome-dialog';
|
||||||
import {
|
import {
|
||||||
@ -8,8 +7,10 @@ import {
|
|||||||
} from '../../components/welcome-dialog/use-get-onboarding-step';
|
} from '../../components/welcome-dialog/use-get-onboarding-step';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const DepositGetStarted = () => {
|
export const DepositGetStarted = () => {
|
||||||
|
const t = useT();
|
||||||
const onboardingDismissed = useOnboardingStore((store) => store.dismissed);
|
const onboardingDismissed = useOnboardingStore((store) => store.dismissed);
|
||||||
const dismiss = useOnboardingStore((store) => store.dismiss);
|
const dismiss = useOnboardingStore((store) => store.dismiss);
|
||||||
const step = useGetOnboardingStep();
|
const step = useGetOnboardingStep();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const Disclaimer = () => {
|
export const Disclaimer = () => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h1 className="text-4xl uppercase xl:text-5xl font-alpha calt">
|
<h1 className="text-4xl uppercase xl:text-5xl font-alpha calt">
|
||||||
@ -8,36 +9,43 @@ export const Disclaimer = () => {
|
|||||||
</h1>
|
</h1>
|
||||||
<p className="mt-10 mb-6">
|
<p className="mt-10 mb-6">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P1',
|
||||||
'Vega is a decentralised peer-to-peer protocol that can be used to trade derivatives with cryptoassets. The Vega Protocol is an implementation layer (layer one) protocol made of free, public, open-source or source-available software. Use of the Vega Protocol involves various risks, including but not limited to, losses while digital assets are supplied to the Vega Protocol and losses due to the fluctuation of prices of assets.'
|
'Vega is a decentralised peer-to-peer protocol that can be used to trade derivatives with cryptoassets. The Vega Protocol is an implementation layer (layer one) protocol made of free, public, open-source or source-available software. Use of the Vega Protocol involves various risks, including but not limited to, losses while digital assets are supplied to the Vega Protocol and losses due to the fluctuation of prices of assets.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-6">
|
<p className="mb-6">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P2',
|
||||||
'Before using the Vega Protocol, review the relevant documentation at docs.vega.xyz to make sure that you understand how it works. Conduct your own due diligence and consult your financial advisor before making any investment decisions.'
|
'Before using the Vega Protocol, review the relevant documentation at docs.vega.xyz to make sure that you understand how it works. Conduct your own due diligence and consult your financial advisor before making any investment decisions.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-6">
|
<p className="mb-6">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P3',
|
||||||
'As described in the Vega Protocol core license, the Vega Protocol is provided “as is”, at your own risk, and without warranties of any kind. Although Gobalsky Labs Limited developed much of the initial code for the Vega Protocol, it does not provide or control the Vega Protocol, which is run by third parties deploying it on a bespoke blockchain. Upgrades and modifications to the Vega Protocol are managed in a community-driven way by holders of the VEGA governance token.'
|
'As described in the Vega Protocol core license, the Vega Protocol is provided “as is”, at your own risk, and without warranties of any kind. Although Gobalsky Labs Limited developed much of the initial code for the Vega Protocol, it does not provide or control the Vega Protocol, which is run by third parties deploying it on a bespoke blockchain. Upgrades and modifications to the Vega Protocol are managed in a community-driven way by holders of the VEGA governance token.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-8">
|
<p className="mb-8">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P4',
|
||||||
'No developer or entity involved in creating the Vega Protocol will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Vega Protocol, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or legal costs, or loss of profits, cryptoassets, tokens or anything else of value.'
|
'No developer or entity involved in creating the Vega Protocol will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Vega Protocol, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or legal costs, or loss of profits, cryptoassets, tokens or anything else of value.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-8">
|
<p className="mb-8">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P5',
|
||||||
'This website is hosted on a decentralised network, the Interplanetary File System (“IPFS”). The IPFS decentralised web is made up of all the computers (nodes) connected to it. Data is therefore stored on many different computers.'
|
'This website is hosted on a decentralised network, the Interplanetary File System (“IPFS”). The IPFS decentralised web is made up of all the computers (nodes) connected to it. Data is therefore stored on many different computers.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-8">
|
<p className="mb-8">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P6',
|
||||||
"The information provided on this website does not constitute investment advice, financial advice, trading advice, or any other sort of advice and you should not treat any of the website's content as such. No party recommends that any cryptoasset should be bought, sold, or held by you via this website. No party ensures the accuracy of information listed on this website or holds any responsibility for any missing or wrong information. You understand that you are using any and all information available here at your own risk."
|
"The information provided on this website does not constitute investment advice, financial advice, trading advice, or any other sort of advice and you should not treat any of the website's content as such. No party recommends that any cryptoasset should be bought, sold, or held by you via this website. No party ensures the accuracy of information listed on this website or holds any responsibility for any missing or wrong information. You understand that you are using any and all information available here at your own risk."
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-8">
|
<p className="mb-8">
|
||||||
{t(
|
{t(
|
||||||
|
'DISCLAIMER_P7',
|
||||||
'Additionally, just as you can access email protocols such as SMTP through multiple email clients, you can potentially access the Vega Protocol through many web or mobile interfaces. You are responsible for doing your own diligence on those interfaces to understand the associated risks and any fees.'
|
'Additionally, just as you can access email protocols such as SMTP through multiple email clients, you can potentially access the Vega Protocol through many web or mobile interfaces. You are responsible for doing your own diligence on those interfaces to understand the associated risks and any fees.'
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { FeesContainer } from '../../components/fees-container';
|
import { FeesContainer } from '../../components/fees-container';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const Fees = () => {
|
export const Fees = () => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<div className="container p-4 mx-auto">
|
<div className="container p-4 mx-auto">
|
||||||
<h1 className="px-4 pb-4 text-2xl">{t('Fees')}</h1>
|
<h1 className="px-4 pb-4 text-2xl">{t('Fees')}</h1>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import {
|
import {
|
||||||
SidebarButton,
|
SidebarButton,
|
||||||
@ -6,8 +5,10 @@ import {
|
|||||||
ViewType,
|
ViewType,
|
||||||
} from '../../components/sidebar';
|
} from '../../components/sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const LiquiditySidebar = () => {
|
export const LiquiditySidebar = () => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { matchFilter, lpAggregatedDataProvider } from '@vegaprotocol/liquidity';
|
import { matchFilter, lpAggregatedDataProvider } from '@vegaprotocol/liquidity';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { Tab, Tabs } from '@vegaprotocol/ui-toolkit';
|
import { Tab, Tabs } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { LiquidityContainer } from '../../components/liquidity-container';
|
import { LiquidityContainer } from '../../components/liquidity-container';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const enum LiquidityTabs {
|
const enum LiquidityTabs {
|
||||||
Active = 'active',
|
Active = 'active',
|
||||||
@ -24,6 +24,7 @@ export const LiquidityViewContainer = ({
|
|||||||
}: {
|
}: {
|
||||||
marketId: string | undefined;
|
marketId: string | undefined;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const [tab, setTab] = useState<string | undefined>(undefined);
|
const [tab, setTab] = useState<string | undefined>(undefined);
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
|
|
||||||
export const NO_MARKET = t('No market');
|
|
@ -9,7 +9,6 @@ import {
|
|||||||
getExpiryDate,
|
getExpiryDate,
|
||||||
getMarketExpiryDate,
|
getMarketExpiryDate,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
Last24hPriceChange,
|
Last24hPriceChange,
|
||||||
Last24hVolume,
|
Last24hVolume,
|
||||||
@ -31,12 +30,14 @@ import { MarketLiquiditySupplied } from '../../components/liquidity-supplied';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { PriceCell } from '@vegaprotocol/datagrid';
|
import { PriceCell } from '@vegaprotocol/datagrid';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
interface MarketHeaderStatsProps {
|
interface MarketHeaderStatsProps {
|
||||||
market: Market;
|
market: Market;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MarketHeaderStats = ({ market }: MarketHeaderStatsProps) => {
|
export const MarketHeaderStats = ({ market }: MarketHeaderStatsProps) => {
|
||||||
|
const t = useT();
|
||||||
const { VEGA_EXPLORER_URL } = useEnvironment();
|
const { VEGA_EXPLORER_URL } = useEnvironment();
|
||||||
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
||||||
|
|
||||||
@ -234,6 +235,7 @@ const useFormatCountdown = (
|
|||||||
startTime?: number,
|
startTime?: number,
|
||||||
every?: number
|
every?: number
|
||||||
) => {
|
) => {
|
||||||
|
const t = useT();
|
||||||
if (startTime && every) {
|
if (startTime && every) {
|
||||||
const diff = every - ((now - startTime) % every);
|
const diff = every - ((now - startTime) % every);
|
||||||
const hours = (diff / 3.6e6) | 0;
|
const hours = (diff / 3.6e6) | 0;
|
||||||
@ -276,6 +278,7 @@ const ExpiryTooltipContent = ({
|
|||||||
market,
|
market,
|
||||||
explorerUrl,
|
explorerUrl,
|
||||||
}: ExpiryTooltipContentProps) => {
|
}: ExpiryTooltipContentProps) => {
|
||||||
|
const t = useT();
|
||||||
if (market.marketTimestamps.close === null) {
|
if (market.marketTimestamps.close === null) {
|
||||||
const oracleId =
|
const oracleId =
|
||||||
market.tradableInstrument.instrument.product.__typename === 'Future'
|
market.tradableInstrument.instrument.product.__typename === 'Future'
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import { addDecimalsFormatNumber, titlefy } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber, titlefy } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
||||||
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
import { useThrottledDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { ExternalLink, Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
import { ExternalLink, Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
@ -12,6 +11,8 @@ import { useNavigate, useParams } from 'react-router-dom';
|
|||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
import { ViewType, useSidebar } from '../../components/sidebar';
|
import { ViewType, useSidebar } from '../../components/sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT, ns } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
const calculatePrice = (markPrice?: string, decimalPlaces?: number) => {
|
const calculatePrice = (markPrice?: string, decimalPlaces?: number) => {
|
||||||
return markPrice && decimalPlaces
|
return markPrice && decimalPlaces
|
||||||
@ -57,6 +58,7 @@ const TitleUpdater = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const MarketPage = () => {
|
export const MarketPage = () => {
|
||||||
|
const t = useT();
|
||||||
const { marketId } = useParams();
|
const { marketId } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
@ -111,10 +113,18 @@ export const MarketPage = () => {
|
|||||||
{t('This market URL is not available any more.')}
|
{t('This market URL is not available any more.')}
|
||||||
</p>
|
</p>
|
||||||
<p className="justify-center text-sm">
|
<p className="justify-center text-sm">
|
||||||
{t(`Please choose another market from the`)}{' '}
|
<Trans
|
||||||
<ExternalLink onClick={() => navigate(Links.MARKETS())}>
|
defaults="Please choose another market from the <0>market list<0>"
|
||||||
{t('market list')}
|
ns={ns}
|
||||||
</ExternalLink>
|
components={[
|
||||||
|
<ExternalLink
|
||||||
|
onClick={() => navigate(Links.MARKETS())}
|
||||||
|
key="link"
|
||||||
|
>
|
||||||
|
market list
|
||||||
|
</ExternalLink>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
</span>
|
</span>
|
||||||
</Splash>
|
</Splash>
|
||||||
|
@ -4,10 +4,8 @@ import { LayoutPriority } from 'allotment';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
import type { PinnedAsset } from '@vegaprotocol/accounts';
|
import type { PinnedAsset } from '@vegaprotocol/accounts';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { OracleBanner, useMarket } from '@vegaprotocol/markets';
|
import { OracleBanner, useMarket } from '@vegaprotocol/markets';
|
||||||
import type { Market } from '@vegaprotocol/markets';
|
import type { Market } from '@vegaprotocol/markets';
|
||||||
import { Filter } from '@vegaprotocol/orders';
|
|
||||||
import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit';
|
import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit';
|
||||||
import {
|
import {
|
||||||
ResizableGrid,
|
ResizableGrid,
|
||||||
@ -21,6 +19,7 @@ import {
|
|||||||
MarketTerminationBanner,
|
MarketTerminationBanner,
|
||||||
} from '../../components/market-banner';
|
} from '../../components/market-banner';
|
||||||
import { FLAGS } from '@vegaprotocol/environment';
|
import { FLAGS } from '@vegaprotocol/environment';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
interface TradeGridProps {
|
interface TradeGridProps {
|
||||||
market: Market | null;
|
market: Market | null;
|
||||||
@ -35,6 +34,7 @@ const MainGrid = memo(
|
|||||||
marketId: string;
|
marketId: string;
|
||||||
pinnedAsset?: PinnedAsset;
|
pinnedAsset?: PinnedAsset;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const { data: market } = useMarket(marketId);
|
const { data: market } = useMarket(marketId);
|
||||||
const [sizes, handleOnLayoutChange] = usePaneLayout({ id: 'top' });
|
const [sizes, handleOnLayoutChange] = usePaneLayout({ id: 'top' });
|
||||||
const [sizesMiddle, handleOnMiddleLayoutChange] = usePaneLayout({
|
const [sizesMiddle, handleOnMiddleLayoutChange] = usePaneLayout({
|
||||||
@ -125,13 +125,13 @@ const MainGrid = memo(
|
|||||||
name={t('Open')}
|
name={t('Open')}
|
||||||
menu={<TradingViews.activeOrders.menu />}
|
menu={<TradingViews.activeOrders.menu />}
|
||||||
>
|
>
|
||||||
<TradingViews.orders.component filter={Filter.Open} />
|
<TradingViews.activeOrders.component />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="closed-orders" name={t('Closed')}>
|
<Tab id="closed-orders" name={t('Closed')}>
|
||||||
<TradingViews.orders.component filter={Filter.Closed} />
|
<TradingViews.closedOrders.component />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="rejected-orders" name={t('Rejected')}>
|
<Tab id="rejected-orders" name={t('Rejected')}>
|
||||||
<TradingViews.orders.component filter={Filter.Rejected} />
|
<TradingViews.rejectedOrders.component />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab
|
<Tab
|
||||||
id="orders"
|
id="orders"
|
||||||
|
@ -4,8 +4,6 @@ import { OracleBanner } from '@vegaprotocol/markets';
|
|||||||
import type { TradingView } from './trade-views';
|
import type { TradingView } from './trade-views';
|
||||||
import { TradingViews } from './trade-views';
|
import { TradingViews } from './trade-views';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
|
||||||
import { NO_MARKET } from './constants';
|
|
||||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import {
|
import {
|
||||||
@ -14,6 +12,8 @@ import {
|
|||||||
MarketTerminationBanner,
|
MarketTerminationBanner,
|
||||||
} from '../../components/market-banner';
|
} from '../../components/market-banner';
|
||||||
import { FLAGS } from '@vegaprotocol/environment';
|
import { FLAGS } from '@vegaprotocol/environment';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
interface TradePanelsProps {
|
interface TradePanelsProps {
|
||||||
market: Market | null;
|
market: Market | null;
|
||||||
@ -30,8 +30,10 @@ export const TradePanels = ({ market, pinnedAsset }: TradePanelsProps) => {
|
|||||||
throw new Error(`No component for view: ${view}`);
|
throw new Error(`No component for view: ${view}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!market) return <Splash>{NO_MARKET}</Splash>;
|
if (!market) return <NoMarketSplash />;
|
||||||
|
|
||||||
|
// Watch out here, we don't know what component is being rendered
|
||||||
|
// so watch out for clashes in props
|
||||||
return <Component marketId={market?.id} pinnedAsset={pinnedAsset} />;
|
return <Component marketId={market?.id} pinnedAsset={pinnedAsset} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -74,33 +76,89 @@ export const TradePanels = ({ market, pinnedAsset }: TradePanelsProps) => {
|
|||||||
</AutoSizer>
|
</AutoSizer>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-nowrap overflow-x-auto max-w-full border-t border-default">
|
<div className="flex flex-nowrap overflow-x-auto max-w-full border-t border-default">
|
||||||
{Object.keys(TradingViews).map((key) => {
|
{Object.keys(TradingViews)
|
||||||
const isActive = view === key;
|
// filter to control available views for the current market
|
||||||
const className = classNames(
|
// eg only perps should get the funding views
|
||||||
'py-2 px-4 min-w-[100px] capitalize text-sm',
|
.filter((_key) => {
|
||||||
{
|
const key = _key as TradingView;
|
||||||
'bg-vega-clight-500 dark:bg-vega-cdark-500': isActive,
|
const perpOnlyViews = ['funding', 'fundingPayments'];
|
||||||
}
|
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
market?.tradableInstrument.instrument.product.__typename !==
|
market?.tradableInstrument.instrument.product.__typename ===
|
||||||
'Perpetual' &&
|
'Perpetual'
|
||||||
(key === 'funding' || key === 'fundingPayments')
|
|
||||||
) {
|
) {
|
||||||
return null;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (perpOnlyViews.includes(key)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.map((_key) => {
|
||||||
|
const key = _key as TradingView;
|
||||||
|
const isActive = view === key;
|
||||||
return (
|
return (
|
||||||
<button
|
<ViewButton
|
||||||
data-testid={key}
|
|
||||||
onClick={() => setView(key as TradingView)}
|
|
||||||
className={className}
|
|
||||||
key={key}
|
key={key}
|
||||||
>
|
view={key}
|
||||||
{TradingViews[key as keyof typeof TradingViews].label}
|
isActive={isActive}
|
||||||
</button>
|
onClick={() => setView(key)}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const NoMarketSplash = () => {
|
||||||
|
const t = useT();
|
||||||
|
return <Splash>{t('No market')}</Splash>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const ViewButton = ({
|
||||||
|
view,
|
||||||
|
isActive,
|
||||||
|
onClick,
|
||||||
|
}: {
|
||||||
|
view: TradingView;
|
||||||
|
isActive: boolean;
|
||||||
|
onClick: () => void;
|
||||||
|
}) => {
|
||||||
|
const label = useViewLabel(view);
|
||||||
|
const className = classNames('py-2 px-4 min-w-[100px] capitalize text-sm', {
|
||||||
|
'bg-vega-clight-500 dark:bg-vega-cdark-500': isActive,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button data-testid={view} onClick={onClick} className={className}>
|
||||||
|
{label}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const useViewLabel = (view: TradingView) => {
|
||||||
|
const t = useT();
|
||||||
|
|
||||||
|
const labels = {
|
||||||
|
candles: t('Candles'),
|
||||||
|
depth: t('Depth'),
|
||||||
|
liquidity: t('Liquidity'),
|
||||||
|
funding: t('Funding'),
|
||||||
|
fundingPayments: t('Funding Payments'),
|
||||||
|
orderbook: t('Orderbook'),
|
||||||
|
trades: t('Trades'),
|
||||||
|
positions: t('Positions'),
|
||||||
|
activeOrders: t('Active'),
|
||||||
|
closedOrders: t('Closed'),
|
||||||
|
rejectedOrders: t('Rejected'),
|
||||||
|
orders: t('All'),
|
||||||
|
stopOrders: t('Stop'),
|
||||||
|
collateral: t('Collateral'),
|
||||||
|
fills: t('Fills'),
|
||||||
|
};
|
||||||
|
|
||||||
|
return labels[view];
|
||||||
|
};
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
import type { ComponentProps } from 'react';
|
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
|
||||||
import { DepthChartContainer } from '@vegaprotocol/market-depth';
|
import { DepthChartContainer } from '@vegaprotocol/market-depth';
|
||||||
import {
|
import {
|
||||||
CandlesChartContainer,
|
CandlesChartContainer,
|
||||||
CandlesMenu,
|
CandlesMenu,
|
||||||
} from '@vegaprotocol/candles-chart';
|
} from '@vegaprotocol/candles-chart';
|
||||||
import { Filter, OpenOrdersMenu } from '@vegaprotocol/orders';
|
import { Filter, OpenOrdersMenu } from '@vegaprotocol/orders';
|
||||||
import { NO_MARKET } from './constants';
|
|
||||||
import { TradesContainer } from '../../components/trades-container';
|
import { TradesContainer } from '../../components/trades-container';
|
||||||
import { OrderbookContainer } from '../../components/orderbook-container';
|
import { OrderbookContainer } from '../../components/orderbook-container';
|
||||||
import { FillsContainer } from '../../components/fills-container';
|
import { FillsContainer } from '../../components/fills-container';
|
||||||
@ -15,96 +12,60 @@ import { AccountsContainer } from '../../components/accounts-container';
|
|||||||
import { LiquidityContainer } from '../../components/liquidity-container';
|
import { LiquidityContainer } from '../../components/liquidity-container';
|
||||||
import { FundingContainer } from '../../components/funding-container';
|
import { FundingContainer } from '../../components/funding-container';
|
||||||
import { FundingPaymentsContainer } from '../../components/funding-payments-container';
|
import { FundingPaymentsContainer } from '../../components/funding-payments-container';
|
||||||
import type { OrderContainerProps } from '../../components/orders-container';
|
|
||||||
import { OrdersContainer } from '../../components/orders-container';
|
import { OrdersContainer } from '../../components/orders-container';
|
||||||
import { StopOrdersContainer } from '../../components/stop-orders-container';
|
import { StopOrdersContainer } from '../../components/stop-orders-container';
|
||||||
import { AccountsMenu } from '../../components/accounts-menu';
|
import { AccountsMenu } from '../../components/accounts-menu';
|
||||||
import { PositionsMenu } from '../../components/positions-menu';
|
import { PositionsMenu } from '../../components/positions-menu';
|
||||||
|
|
||||||
type MarketDependantView =
|
|
||||||
| typeof CandlesChartContainer
|
|
||||||
| typeof DepthChartContainer
|
|
||||||
| typeof OrderbookContainer
|
|
||||||
| typeof TradesContainer;
|
|
||||||
|
|
||||||
type MarketDependantViewProps = ComponentProps<MarketDependantView>;
|
|
||||||
|
|
||||||
const requiresMarket = (View: MarketDependantView) => {
|
|
||||||
const WrappedComponent = (props: MarketDependantViewProps) =>
|
|
||||||
props.marketId ? <View {...props} /> : <Splash>{NO_MARKET}</Splash>;
|
|
||||||
WrappedComponent.displayName = `RequiresMarket(${View.name})`;
|
|
||||||
return WrappedComponent;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TradingView = keyof typeof TradingViews;
|
export type TradingView = keyof typeof TradingViews;
|
||||||
|
|
||||||
export const TradingViews = {
|
export const TradingViews = {
|
||||||
candles: {
|
candles: {
|
||||||
label: 'Candles',
|
component: CandlesChartContainer,
|
||||||
component: requiresMarket(CandlesChartContainer),
|
|
||||||
menu: CandlesMenu,
|
menu: CandlesMenu,
|
||||||
},
|
},
|
||||||
depth: {
|
depth: {
|
||||||
label: 'Depth',
|
component: DepthChartContainer,
|
||||||
component: requiresMarket(DepthChartContainer),
|
|
||||||
},
|
},
|
||||||
liquidity: {
|
liquidity: {
|
||||||
label: 'Liquidity',
|
component: LiquidityContainer,
|
||||||
component: requiresMarket(LiquidityContainer),
|
|
||||||
},
|
},
|
||||||
funding: {
|
funding: {
|
||||||
label: 'Funding',
|
component: FundingContainer,
|
||||||
component: requiresMarket(FundingContainer),
|
|
||||||
},
|
},
|
||||||
fundingPayments: {
|
fundingPayments: {
|
||||||
label: 'Funding Payments',
|
|
||||||
component: FundingPaymentsContainer,
|
component: FundingPaymentsContainer,
|
||||||
},
|
},
|
||||||
orderbook: {
|
orderbook: {
|
||||||
label: 'Orderbook',
|
component: OrderbookContainer,
|
||||||
component: requiresMarket(OrderbookContainer),
|
|
||||||
},
|
},
|
||||||
trades: {
|
trades: {
|
||||||
label: 'Trades',
|
component: TradesContainer,
|
||||||
component: requiresMarket(TradesContainer),
|
|
||||||
},
|
},
|
||||||
positions: {
|
positions: {
|
||||||
label: 'Positions',
|
|
||||||
component: PositionsContainer,
|
component: PositionsContainer,
|
||||||
menu: PositionsMenu,
|
menu: PositionsMenu,
|
||||||
},
|
},
|
||||||
activeOrders: {
|
activeOrders: {
|
||||||
label: 'Active',
|
component: () => <OrdersContainer filter={Filter.Open} />,
|
||||||
component: (props: OrderContainerProps) => (
|
|
||||||
<OrdersContainer {...props} filter={Filter.Open} />
|
|
||||||
),
|
|
||||||
menu: OpenOrdersMenu,
|
menu: OpenOrdersMenu,
|
||||||
},
|
},
|
||||||
closedOrders: {
|
closedOrders: {
|
||||||
label: 'Closed',
|
component: () => <OrdersContainer filter={Filter.Closed} />,
|
||||||
component: (props: OrderContainerProps) => (
|
|
||||||
<OrdersContainer {...props} filter={Filter.Closed} />
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
rejectedOrders: {
|
rejectedOrders: {
|
||||||
label: 'Rejected',
|
component: () => <OrdersContainer filter={Filter.Rejected} />,
|
||||||
component: (props: OrderContainerProps) => (
|
|
||||||
<OrdersContainer {...props} filter={Filter.Rejected} />
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
orders: {
|
orders: {
|
||||||
label: 'All',
|
|
||||||
component: OrdersContainer,
|
component: OrdersContainer,
|
||||||
menu: OpenOrdersMenu,
|
menu: OpenOrdersMenu,
|
||||||
},
|
},
|
||||||
stopOrders: {
|
stopOrders: {
|
||||||
label: 'Stop',
|
|
||||||
component: StopOrdersContainer,
|
component: StopOrdersContainer,
|
||||||
},
|
},
|
||||||
collateral: {
|
collateral: {
|
||||||
label: 'Collateral',
|
|
||||||
component: AccountsContainer,
|
component: AccountsContainer,
|
||||||
menu: AccountsMenu,
|
menu: AccountsMenu,
|
||||||
},
|
},
|
||||||
fills: { label: 'Fills', component: FillsContainer },
|
fills: { component: FillsContainer },
|
||||||
};
|
} as const;
|
||||||
|
@ -8,7 +8,6 @@ import type {
|
|||||||
import { AgGrid, COL_DEFS } from '@vegaprotocol/datagrid';
|
import { AgGrid, COL_DEFS } from '@vegaprotocol/datagrid';
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import type { Asset } from '@vegaprotocol/types';
|
import type { Asset } from '@vegaprotocol/types';
|
||||||
import type { ProductType } from '@vegaprotocol/types';
|
import type { ProductType } from '@vegaprotocol/types';
|
||||||
import { MarketState, MarketStateMapping } from '@vegaprotocol/types';
|
import { MarketState, MarketStateMapping } from '@vegaprotocol/types';
|
||||||
@ -24,6 +23,7 @@ import { SettlementDateCell } from './settlement-date-cell';
|
|||||||
import { SettlementPriceCell } from './settlement-price-cell';
|
import { SettlementPriceCell } from './settlement-price-cell';
|
||||||
import { MarketCodeCell } from './market-code-cell';
|
import { MarketCodeCell } from './market-code-cell';
|
||||||
import { MarketActionsDropdown } from './market-table-actions';
|
import { MarketActionsDropdown } from './market-table-actions';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
type SettlementAsset = Pick<
|
type SettlementAsset = Pick<
|
||||||
Asset,
|
Asset,
|
||||||
@ -127,6 +127,7 @@ const ClosedMarketsDataGrid = ({
|
|||||||
rowData: Row[];
|
rowData: Row[];
|
||||||
error: Error | undefined;
|
error: Error | undefined;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const handleOnSelect = useMarketClickHandler();
|
const handleOnSelect = useMarketClickHandler();
|
||||||
const openAssetDialog = useAssetDetailsDialogStore((store) => store.open);
|
const openAssetDialog = useAssetDetailsDialogStore((store) => store.open);
|
||||||
|
|
||||||
@ -274,7 +275,7 @@ const ClosedMarketsDataGrid = ({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [openAssetDialog]);
|
}, [openAssetDialog, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AgGrid
|
<AgGrid
|
||||||
|
@ -2,7 +2,7 @@ import compact from 'lodash/compact';
|
|||||||
import type { ProductType } from '@vegaprotocol/types';
|
import type { ProductType } from '@vegaprotocol/types';
|
||||||
import { ProductTypeMapping, ProductTypeShortName } from '@vegaprotocol/types';
|
import { ProductTypeMapping, ProductTypeShortName } from '@vegaprotocol/types';
|
||||||
import { StackedCell } from '@vegaprotocol/datagrid';
|
import { StackedCell } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export interface MarketCodeCellProps {
|
export interface MarketCodeCellProps {
|
||||||
value: string | undefined; // market code
|
value: string | undefined; // market code
|
||||||
@ -14,6 +14,7 @@ export interface MarketCodeCellProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MarketCodeCell = ({ value, data }: MarketCodeCellProps) => {
|
export const MarketCodeCell = ({ value, data }: MarketCodeCellProps) => {
|
||||||
|
const t = useT();
|
||||||
if (!value || !data || !data.productType) return null;
|
if (!value || !data || !data.productType) return null;
|
||||||
|
|
||||||
const infoSpanClasses =
|
const infoSpanClasses =
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
TradingDropdownItem,
|
TradingDropdownItem,
|
||||||
TradingDropdownCopyItem,
|
TradingDropdownCopyItem,
|
||||||
@ -11,6 +10,7 @@ import { DApp, EXPLORER_MARKET, useLinks } from '@vegaprotocol/environment';
|
|||||||
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketActionsDropdown = ({
|
export const MarketActionsDropdown = ({
|
||||||
marketId,
|
marketId,
|
||||||
@ -23,6 +23,7 @@ export const MarketActionsDropdown = ({
|
|||||||
successorMarketID: string | null | undefined;
|
successorMarketID: string | null | undefined;
|
||||||
parentMarketID: string | null | undefined;
|
parentMarketID: string | null | undefined;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const open = useAssetDetailsDialogStore((store) => store.open);
|
const open = useAssetDetailsDialogStore((store) => store.open);
|
||||||
const linkCreator = useLinks(DApp.Explorer);
|
const linkCreator = useLinks(DApp.Explorer);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { titlefy } from '@vegaprotocol/utils';
|
import { titlefy } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
LocalStoragePersistTabs as Tabs,
|
LocalStoragePersistTabs as Tabs,
|
||||||
Tab,
|
Tab,
|
||||||
@ -15,8 +14,10 @@ import {
|
|||||||
TOKEN_NEW_MARKET_PROPOSAL,
|
TOKEN_NEW_MARKET_PROPOSAL,
|
||||||
useLinks,
|
useLinks,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketsPage = () => {
|
export const MarketsPage = () => {
|
||||||
|
const t = useT();
|
||||||
const { updateTitle } = usePageTitleStore((store) => ({
|
const { updateTitle } = usePageTitleStore((store) => ({
|
||||||
updateTitle: store.updateTitle,
|
updateTitle: store.updateTitle,
|
||||||
}));
|
}));
|
||||||
@ -25,8 +26,8 @@ export const MarketsPage = () => {
|
|||||||
const externalLink = governanceLink(TOKEN_NEW_MARKET_PROPOSAL);
|
const externalLink = governanceLink(TOKEN_NEW_MARKET_PROPOSAL);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateTitle(titlefy(['Markets']));
|
updateTitle(titlefy([t('Markets')]));
|
||||||
}, [updateTitle]);
|
}, [updateTitle, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full pt-0.5 pb-3 px-1.5">
|
<div className="h-full pt-0.5 pb-3 px-1.5">
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Route, Routes, useParams } from 'react-router-dom';
|
import { Route, Routes, useParams } from 'react-router-dom';
|
||||||
import { MarketState } from '@vegaprotocol/types';
|
import { MarketState } from '@vegaprotocol/types';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useMarket } from '@vegaprotocol/markets';
|
import { useMarket } from '@vegaprotocol/markets';
|
||||||
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import {
|
import {
|
||||||
@ -9,8 +8,10 @@ import {
|
|||||||
ViewType,
|
ViewType,
|
||||||
} from '../../components/sidebar';
|
} from '../../components/sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketsSidebar = () => {
|
export const MarketsSidebar = () => {
|
||||||
|
const t = useT();
|
||||||
const { marketId } = useParams();
|
const { marketId } = useParams();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const { data } = useMarket(marketId);
|
const { data } = useMarket(marketId);
|
||||||
|
@ -2,16 +2,17 @@ import { useDataProvider } from '@vegaprotocol/data-provider';
|
|||||||
import type { MarketMaybeWithData } from '@vegaprotocol/markets';
|
import type { MarketMaybeWithData } from '@vegaprotocol/markets';
|
||||||
import { marketListProvider } from '@vegaprotocol/markets';
|
import { marketListProvider } from '@vegaprotocol/markets';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import type { CellClickedEvent } from 'ag-grid-community';
|
import type { CellClickedEvent } from 'ag-grid-community';
|
||||||
import MarketListTable from './market-list-table';
|
import MarketListTable from './market-list-table';
|
||||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||||
import { Interval } from '@vegaprotocol/types';
|
import { Interval } from '@vegaprotocol/types';
|
||||||
import { useYesterday } from '@vegaprotocol/react-helpers';
|
import { useYesterday } from '@vegaprotocol/react-helpers';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const POLLING_TIME = 2000;
|
const POLLING_TIME = 2000;
|
||||||
|
|
||||||
export const OpenMarkets = () => {
|
export const OpenMarkets = () => {
|
||||||
|
const t = useT();
|
||||||
const handleOnSelect = useMarketClickHandler();
|
const handleOnSelect = useMarketClickHandler();
|
||||||
const yesterday = useYesterday();
|
const yesterday = useYesterday();
|
||||||
const { data, error, reload } = useDataProvider({
|
const { data, error, reload } = useDataProvider({
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { DApp, EXPLORER_ORACLE, useLinks } from '@vegaprotocol/environment';
|
import { DApp, EXPLORER_ORACLE, useLinks } from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { MarketState } from '@vegaprotocol/types';
|
import { MarketState } from '@vegaprotocol/types';
|
||||||
import { Link } from '@vegaprotocol/ui-toolkit';
|
import { Link } from '@vegaprotocol/ui-toolkit';
|
||||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
import { formatDistanceToNowStrict, isAfter } from 'date-fns';
|
import { formatDistanceToNowStrict, isAfter } from 'date-fns';
|
||||||
|
|
||||||
export interface SettlementDataCellProps {
|
export interface SettlementDataCellProps {
|
||||||
@ -18,6 +18,7 @@ export const SettlementDateCell = ({
|
|||||||
closeTimestamp,
|
closeTimestamp,
|
||||||
marketState,
|
marketState,
|
||||||
}: SettlementDataCellProps) => {
|
}: SettlementDataCellProps) => {
|
||||||
|
const t = useT();
|
||||||
const linkCreator = useLinks(DApp.Explorer);
|
const linkCreator = useLinks(DApp.Explorer);
|
||||||
const date = closeTimestamp ? new Date(closeTimestamp) : metaDate;
|
const date = closeTimestamp ? new Date(closeTimestamp) : metaDate;
|
||||||
|
|
||||||
@ -31,12 +32,12 @@ export const SettlementDateCell = ({
|
|||||||
|
|
||||||
if (expiryHasPassed) {
|
if (expiryHasPassed) {
|
||||||
if (marketState !== MarketState.STATE_SETTLED) {
|
if (marketState !== MarketState.STATE_SETTLED) {
|
||||||
text = t('Expected %s ago', distance);
|
text = t('Expected {{distance}} ago', { distance });
|
||||||
} else {
|
} else {
|
||||||
text = t('%s ago', distance);
|
text = t('{{distance}} ago', { distance });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
text = t('Expected in %s', distance);
|
text = t('Expected in {{distance}}', { distance });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { DApp, EXPLORER_ORACLE, useLinks } from '@vegaprotocol/environment';
|
import { DApp, EXPLORER_ORACLE, useLinks } from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import type { DataSourceFilterFragment } from '@vegaprotocol/markets';
|
import type { DataSourceFilterFragment } from '@vegaprotocol/markets';
|
||||||
import { useOracleSpecBindingData } from '@vegaprotocol/markets';
|
import { useOracleSpecBindingData } from '@vegaprotocol/markets';
|
||||||
import { PropertyKeyType } from '@vegaprotocol/types';
|
import { PropertyKeyType } from '@vegaprotocol/types';
|
||||||
import { Link } from '@vegaprotocol/ui-toolkit';
|
import { Link } from '@vegaprotocol/ui-toolkit';
|
||||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export interface SettlementPriceCellProps {
|
export interface SettlementPriceCellProps {
|
||||||
oracleSpecId: string | undefined;
|
oracleSpecId: string | undefined;
|
||||||
@ -17,6 +17,7 @@ export const SettlementPriceCell = ({
|
|||||||
settlementDataSpecBinding,
|
settlementDataSpecBinding,
|
||||||
filter,
|
filter,
|
||||||
}: SettlementPriceCellProps) => {
|
}: SettlementPriceCellProps) => {
|
||||||
|
const t = useT();
|
||||||
const linkCreator = useLinks(DApp.Explorer);
|
const linkCreator = useLinks(DApp.Explorer);
|
||||||
const { property, loading } = useOracleSpecBindingData(
|
const { property, loading } = useOracleSpecBindingData(
|
||||||
oracleSpecId,
|
oracleSpecId,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import type { ColDef, ValueFormatterParams } from 'ag-grid-community';
|
import type { ColDef, ValueFormatterParams } from 'ag-grid-community';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import type {
|
import type {
|
||||||
VegaICellRendererParams,
|
VegaICellRendererParams,
|
||||||
VegaValueFormatterParams,
|
VegaValueFormatterParams,
|
||||||
@ -18,10 +17,12 @@ import type {
|
|||||||
import { MarketActionsDropdown } from './market-table-actions';
|
import { MarketActionsDropdown } from './market-table-actions';
|
||||||
import { calcCandleVolume, getAsset } from '@vegaprotocol/markets';
|
import { calcCandleVolume, getAsset } from '@vegaprotocol/markets';
|
||||||
import { MarketCodeCell } from './market-code-cell';
|
import { MarketCodeCell } from './market-code-cell';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const { MarketTradingMode, AuctionTrigger } = Schema;
|
const { MarketTradingMode, AuctionTrigger } = Schema;
|
||||||
|
|
||||||
export const useColumnDefs = () => {
|
export const useColumnDefs = () => {
|
||||||
|
const t = useT();
|
||||||
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
||||||
return useMemo<ColDef[]>(
|
return useMemo<ColDef[]>(
|
||||||
() => [
|
() => [
|
||||||
@ -216,6 +217,6 @@ export const useColumnDefs = () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[openAssetDetailsDialog]
|
[openAssetDetailsDialog, t]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import { SidebarButton, ViewType } from '../../components/sidebar';
|
import { SidebarButton, ViewType } from '../../components/sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const PortfolioSidebar = () => {
|
export const PortfolioSidebar = () => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -2,7 +2,6 @@ import { useEffect } from 'react';
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { LayoutPriority } from 'allotment';
|
import { LayoutPriority } from 'allotment';
|
||||||
import { titlefy } from '@vegaprotocol/utils';
|
import { titlefy } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useIncompleteWithdrawals } from '@vegaprotocol/withdraws';
|
import { useIncompleteWithdrawals } from '@vegaprotocol/withdraws';
|
||||||
import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit';
|
import { Tab, LocalStoragePersistTabs as Tabs } from '@vegaprotocol/ui-toolkit';
|
||||||
import { usePageTitleStore } from '../../stores';
|
import { usePageTitleStore } from '../../stores';
|
||||||
@ -25,6 +24,7 @@ import { AccountsMenu } from '../../components/accounts-menu';
|
|||||||
import { DepositsMenu } from '../../components/deposits-menu';
|
import { DepositsMenu } from '../../components/deposits-menu';
|
||||||
import { WithdrawalsMenu } from '../../components/withdrawals-menu';
|
import { WithdrawalsMenu } from '../../components/withdrawals-menu';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const WithdrawalsIndicator = () => {
|
const WithdrawalsIndicator = () => {
|
||||||
const { ready } = useIncompleteWithdrawals();
|
const { ready } = useIncompleteWithdrawals();
|
||||||
@ -39,6 +39,7 @@ const WithdrawalsIndicator = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Portfolio = () => {
|
export const Portfolio = () => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const { getView, setViews } = useSidebar();
|
const { getView, setViews } = useSidebar();
|
||||||
const view = getView(currentRouteId);
|
const view = getView(currentRouteId);
|
||||||
@ -49,7 +50,7 @@ export const Portfolio = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateTitle(titlefy([t('Portfolio')]));
|
updateTitle(titlefy([t('Portfolio')]));
|
||||||
}, [updateTitle]);
|
}, [updateTitle, t]);
|
||||||
|
|
||||||
// Make transfer sidebar open by default
|
// Make transfer sidebar open by default
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -16,13 +16,13 @@ import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
|
|||||||
import { useReferral } from './hooks/use-referral';
|
import { useReferral } from './hooks/use-referral';
|
||||||
import { Routes } from '../../lib/links';
|
import { Routes } from '../../lib/links';
|
||||||
import { useTransactionEventSubscription } from '@vegaprotocol/web3';
|
import { useTransactionEventSubscription } from '@vegaprotocol/web3';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Statistics, useStats } from './referral-statistics';
|
import { Statistics, useStats } from './referral-statistics';
|
||||||
import { useReferralProgram } from './hooks/use-referral-program';
|
import { useReferralProgram } from './hooks/use-referral-program';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const RELOAD_DELAY = 3000;
|
const RELOAD_DELAY = 3000;
|
||||||
|
|
||||||
const validateCode = (value: string) => {
|
const validateCode = (value: string, t: ReturnType<typeof useT>) => {
|
||||||
const number = +`0x${value}`;
|
const number = +`0x${value}`;
|
||||||
if (!value || value.length !== 64) {
|
if (!value || value.length !== 64) {
|
||||||
return t('Code must be 64 characters in length');
|
return t('Code must be 64 characters in length');
|
||||||
@ -33,6 +33,7 @@ const validateCode = (value: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const ApplyCodeForm = () => {
|
export const ApplyCodeForm = () => {
|
||||||
|
const t = useT();
|
||||||
const program = useReferralProgram();
|
const program = useReferralProgram();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const openWalletDialog = useVegaWalletDialogStore(
|
const openWalletDialog = useVegaWalletDialogStore(
|
||||||
@ -59,7 +60,7 @@ export const ApplyCodeForm = () => {
|
|||||||
|
|
||||||
const codeField = watch('code');
|
const codeField = watch('code');
|
||||||
const { data: previewData, loading: previewLoading } = useReferral({
|
const { data: previewData, loading: previewLoading } = useReferral({
|
||||||
code: validateCode(codeField) ? codeField : undefined,
|
code: validateCode(codeField, t) ? codeField : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -223,7 +224,7 @@ export const ApplyCodeForm = () => {
|
|||||||
hasError={Boolean(errors.code)}
|
hasError={Boolean(errors.code)}
|
||||||
{...register('code', {
|
{...register('code', {
|
||||||
required: t('You have to provide a code to apply it.'),
|
required: t('You have to provide a code to apply it.'),
|
||||||
validate: validateCode,
|
validate: (value) => validateCode(value, t),
|
||||||
})}
|
})}
|
||||||
placeholder="Enter a code"
|
placeholder="Enter a code"
|
||||||
className="mb-2 bg-vega-clight-900 dark:bg-vega-cdark-700"
|
className="mb-2 bg-vega-clight-900 dark:bg-vega-cdark-700"
|
||||||
|
@ -24,13 +24,14 @@ import {
|
|||||||
DISCLAIMER_REFERRAL_DOCS_LINK,
|
DISCLAIMER_REFERRAL_DOCS_LINK,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
import { useReferral } from './hooks/use-referral';
|
import { useReferral } from './hooks/use-referral';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const CreateCodeContainer = () => {
|
export const CreateCodeContainer = () => {
|
||||||
return <CreateCodeForm />;
|
return <CreateCodeForm />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CreateCodeForm = () => {
|
export const CreateCodeForm = () => {
|
||||||
|
const t = useT();
|
||||||
const [dialogOpen, setDialogOpen] = useState(false);
|
const [dialogOpen, setDialogOpen] = useState(false);
|
||||||
const openWalletDialog = useVegaWalletDialogStore(
|
const openWalletDialog = useVegaWalletDialogStore(
|
||||||
(store) => store.openVegaWalletDialog
|
(store) => store.openVegaWalletDialog
|
||||||
@ -81,6 +82,7 @@ const CreateCodeDialog = ({
|
|||||||
}: {
|
}: {
|
||||||
setDialogOpen: (open: boolean) => void;
|
setDialogOpen: (open: boolean) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const createLink = useLinks(DApp.Governance);
|
const createLink = useLinks(DApp.Governance);
|
||||||
const { isReadOnly, pubKey, sendTx } = useVegaWallet();
|
const { isReadOnly, pubKey, sendTx } = useVegaWallet();
|
||||||
const { refetch } = useReferral({ pubKey, role: 'referrer' });
|
const { refetch } = useReferral({ pubKey, role: 'referrer' });
|
||||||
@ -170,10 +172,14 @@ const CreateCodeDialog = ({
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<p>
|
<p>
|
||||||
{t('You need at least')}{' '}
|
|
||||||
{addDecimalsFormatNumber(requiredStake.toString(), 18)}{' '}
|
|
||||||
{t(
|
{t(
|
||||||
'VEGA staked to generate a referral code and participate in the referral program.'
|
'You need at least {{requiredStake}} VEGA staked to generate a referral code and participate in the referral program.',
|
||||||
|
{
|
||||||
|
requiredStake: addDecimalsFormatNumber(
|
||||||
|
requiredStake.toString(),
|
||||||
|
18
|
||||||
|
),
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<TradingAnchorButton
|
<TradingAnchorButton
|
||||||
|
@ -3,21 +3,22 @@ import { RainbowButton } from './buttons';
|
|||||||
import { AnimatedDudeWithWire } from './graphics/dude';
|
import { AnimatedDudeWithWire } from './graphics/dude';
|
||||||
import { LayoutWithSky } from './layout';
|
import { LayoutWithSky } from './layout';
|
||||||
import { Routes } from '../../lib/links';
|
import { Routes } from '../../lib/links';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const ErrorBoundary = () => {
|
export const ErrorBoundary = () => {
|
||||||
|
const t = useT();
|
||||||
const error = useRouteError();
|
const error = useRouteError();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const title = isRouteErrorResponse(error)
|
const title = isRouteErrorResponse(error)
|
||||||
? `${error.status} ${error.statusText}`
|
? `${error.status} ${error.statusText}`
|
||||||
: 'Something went wrong';
|
: t('Something went wrong');
|
||||||
|
|
||||||
const code = isRouteErrorResponse(error) ? error.status : 0;
|
const code = isRouteErrorResponse(error) ? error.status : 0;
|
||||||
|
|
||||||
const messages: Record<number, string> = {
|
const messages: Record<number, string> = {
|
||||||
0: 'An unknown error occurred.',
|
0: t('An unknown error occurred.'),
|
||||||
404: "The page you're looking for doesn't exists.",
|
404: t("The page you're looking for doesn't exists."),
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -48,6 +49,7 @@ export const ErrorBoundary = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const NotFound = () => {
|
export const NotFound = () => {
|
||||||
|
const t = useT();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
import { Table } from './table';
|
import { Table } from './table';
|
||||||
|
|
||||||
export const HowItWorksTable = () => (
|
export const HowItWorksTable = () => {
|
||||||
|
const t = useT();
|
||||||
|
return (
|
||||||
<Table
|
<Table
|
||||||
className="bg-none bg-vega-clight-800 dark:bg-vega-cdark-800"
|
className="bg-none bg-vega-clight-800 dark:bg-vega-cdark-800"
|
||||||
noHeader
|
noHeader
|
||||||
@ -60,4 +62,5 @@ export const HowItWorksTable = () => (
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
></Table>
|
></Table>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { AnimatedDudeWithWire } from './graphics/dude';
|
import { AnimatedDudeWithWire } from './graphics/dude';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const LandingBanner = () => {
|
export const LandingBanner = () => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<div className={classNames('relative mb-20')}>
|
<div className={classNames('relative mb-20')}>
|
||||||
<div className="">
|
<div className="">
|
||||||
|
@ -28,9 +28,10 @@ import sortBy from 'lodash/sortBy';
|
|||||||
import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { useCurrentEpochInfoQuery } from './hooks/__generated__/Epoch';
|
import { useCurrentEpochInfoQuery } from './hooks/__generated__/Epoch';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import maxBy from 'lodash/maxBy';
|
import maxBy from 'lodash/maxBy';
|
||||||
import { DocsLinks } from '@vegaprotocol/environment';
|
import { DocsLinks } from '@vegaprotocol/environment';
|
||||||
|
import { useT, ns } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
export const ReferralStatistics = () => {
|
export const ReferralStatistics = () => {
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
@ -152,6 +153,7 @@ export const Statistics = ({
|
|||||||
program: ReturnType<typeof useReferralProgram>;
|
program: ReturnType<typeof useReferralProgram>;
|
||||||
as: 'referrer' | 'referee';
|
as: 'referrer' | 'referee';
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const {
|
const {
|
||||||
baseCommissionValue,
|
baseCommissionValue,
|
||||||
runningVolumeValue,
|
runningVolumeValue,
|
||||||
@ -185,10 +187,15 @@ export const Statistics = ({
|
|||||||
const baseCommissionTile = (
|
const baseCommissionTile = (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t('Base commission rate')}
|
title={t('Base commission rate')}
|
||||||
description={t('(Combined set volume %s over last %s epochs)', [
|
description={t(
|
||||||
compactNumFormat.format(runningVolumeValue),
|
'(Combined set volume {{runningVolume}} over last {{epochs}} epochs)',
|
||||||
(details?.windowLength || DEFAULT_AGGREGATION_DAYS).toString(),
|
{
|
||||||
])}
|
runningVolume: compactNumFormat.format(runningVolumeValue),
|
||||||
|
epochs: (
|
||||||
|
details?.windowLength || DEFAULT_AGGREGATION_DAYS
|
||||||
|
).toString(),
|
||||||
|
}
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
{baseCommissionValue * 100}%
|
{baseCommissionValue * 100}%
|
||||||
</StatTile>
|
</StatTile>
|
||||||
@ -196,10 +203,9 @@ export const Statistics = ({
|
|||||||
const stakingMultiplierTile = (
|
const stakingMultiplierTile = (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t('Staking multiplier')}
|
title={t('Staking multiplier')}
|
||||||
description={`(${addDecimalsFormatNumber(
|
description={t('{{amount}} $VEGA staked', {
|
||||||
stakeAvailable?.toString() || 0,
|
amount: addDecimalsFormatNumber(stakeAvailable?.toString() || 0, 18),
|
||||||
18
|
})}
|
||||||
)} $VEGA staked)`}
|
|
||||||
>
|
>
|
||||||
{multiplier || t('None')}
|
{multiplier || t('None')}
|
||||||
</StatTile>
|
</StatTile>
|
||||||
@ -232,10 +238,9 @@ export const Statistics = ({
|
|||||||
|
|
||||||
const referrerVolumeTile = (
|
const referrerVolumeTile = (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t(
|
title={t('My volume (last {{count}} epochs)', {
|
||||||
'My volume (last %s epochs)',
|
count: details?.windowLength || DEFAULT_AGGREGATION_DAYS,
|
||||||
(details?.windowLength || DEFAULT_AGGREGATION_DAYS).toString()
|
})}
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{compactNumFormat.format(referrerVolumeValue)}
|
{compactNumFormat.format(referrerVolumeValue)}
|
||||||
</StatTile>
|
</StatTile>
|
||||||
@ -246,10 +251,9 @@ export const Statistics = ({
|
|||||||
.reduce((all, r) => all.plus(r), new BigNumber(0));
|
.reduce((all, r) => all.plus(r), new BigNumber(0));
|
||||||
const totalCommissionTile = (
|
const totalCommissionTile = (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t(
|
title={t('Total commission (last {{count}}} epochs)', {
|
||||||
'Total commission (last %s epochs)',
|
count: details?.windowLength || DEFAULT_AGGREGATION_DAYS,
|
||||||
(details?.windowLength || DEFAULT_AGGREGATION_DAYS).toString()
|
})}
|
||||||
)}
|
|
||||||
description={<QUSDTooltip />}
|
description={<QUSDTooltip />}
|
||||||
>
|
>
|
||||||
{getNumberFormat(0).format(Number(totalCommissionValue))}
|
{getNumberFormat(0).format(Number(totalCommissionValue))}
|
||||||
@ -290,10 +294,9 @@ export const Statistics = ({
|
|||||||
);
|
);
|
||||||
const runningVolumeTile = (
|
const runningVolumeTile = (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t(
|
title={t('Combined volume (last {{count}} epochs)', {
|
||||||
'Combined volume (last %s epochs)',
|
count: details?.windowLength,
|
||||||
details?.windowLength.toString()
|
})}
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{compactNumFormat.format(runningVolumeValue)}
|
{compactNumFormat.format(runningVolumeValue)}
|
||||||
</StatTile>
|
</StatTile>
|
||||||
@ -381,25 +384,22 @@ export const Statistics = ({
|
|||||||
{ name: 'joined', displayName: t('Date Joined') },
|
{ name: 'joined', displayName: t('Date Joined') },
|
||||||
{
|
{
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
displayName: t(
|
displayName: t('Volume (last {{count}} epochs)', {
|
||||||
'Volume (last %s epochs)',
|
count: details?.windowLength || DEFAULT_AGGREGATION_DAYS,
|
||||||
(
|
}),
|
||||||
details?.windowLength || DEFAULT_AGGREGATION_DAYS
|
|
||||||
).toString()
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'commission',
|
name: 'commission',
|
||||||
displayName: (
|
displayName: (
|
||||||
<>
|
<Trans
|
||||||
{t('Commission earned in')} <QUSDTooltip />{' '}
|
i18nKey="referral-statistics-commission"
|
||||||
{t(
|
defaults="Commission earned in <0>qUSD</0> (last {{count}} epochs)"
|
||||||
'(last %s epochs)',
|
values={{
|
||||||
(
|
count:
|
||||||
details?.windowLength || DEFAULT_AGGREGATION_DAYS
|
details?.windowLength || DEFAULT_AGGREGATION_DAYS,
|
||||||
).toString()
|
}}
|
||||||
)}
|
ns={ns}
|
||||||
</>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@ -430,7 +430,9 @@ export const Statistics = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const QUSDTooltip = () => (
|
export const QUSDTooltip = () => {
|
||||||
|
const t = useT();
|
||||||
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
description={
|
description={
|
||||||
<>
|
<>
|
||||||
@ -450,4 +452,5 @@ export const QUSDTooltip = () => (
|
|||||||
>
|
>
|
||||||
<span>{t('qUSD')}</span>
|
<span>{t('qUSD')}</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
@ -17,18 +17,22 @@ import classNames from 'classnames';
|
|||||||
import { usePageTitleStore } from '../../stores';
|
import { usePageTitleStore } from '../../stores';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { titlefy } from '@vegaprotocol/utils';
|
import { titlefy } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const Nav = () => (
|
const Nav = () => {
|
||||||
|
const t = useT();
|
||||||
|
return (
|
||||||
<div className="flex justify-center border-b border-vega-cdark-500">
|
<div className="flex justify-center border-b border-vega-cdark-500">
|
||||||
<TabLink end to={Routes.REFERRALS}>
|
<TabLink end to={Routes.REFERRALS}>
|
||||||
{t('I want a code')}
|
{t('I want a code')}
|
||||||
</TabLink>
|
</TabLink>
|
||||||
<TabLink to={Routes.REFERRALS_APPLY_CODE}>{t('I have a code')}</TabLink>
|
<TabLink to={Routes.REFERRALS_APPLY_CODE}>{t('I have a code')}</TabLink>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const Referrals = () => {
|
export const Referrals = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -58,7 +62,7 @@ export const Referrals = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateTitle(titlefy([t('Referrals')]));
|
updateTitle(titlefy([t('Referrals')]));
|
||||||
}, [updateTitle]);
|
}, [updateTitle, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -7,7 +7,8 @@ import { Tag } from './tag';
|
|||||||
import type { ComponentProps, ReactNode } from 'react';
|
import type { ComponentProps, ReactNode } from 'react';
|
||||||
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import { DApp, TOKEN_PROPOSALS, useLinks } from '@vegaprotocol/environment';
|
import { DApp, TOKEN_PROPOSALS, useLinks } from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT, ns } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
const Loading = ({ variant }: { variant: 'large' | 'inline' }) => (
|
const Loading = ({ variant }: { variant: 'large' | 'inline' }) => (
|
||||||
<div
|
<div
|
||||||
@ -31,6 +32,7 @@ const StakingTier = ({
|
|||||||
referralRewardMultiplier: string;
|
referralRewardMultiplier: string;
|
||||||
minimumStakedTokens: string;
|
minimumStakedTokens: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const color: Record<number, ComponentProps<typeof Tag>['color']> = {
|
const color: Record<number, ComponentProps<typeof Tag>['color']> = {
|
||||||
1: 'green',
|
1: 'green',
|
||||||
2: 'blue',
|
2: 'blue',
|
||||||
@ -62,7 +64,9 @@ const StakingTier = ({
|
|||||||
<Tag color={color[tier]}>Multiplier {referralRewardMultiplier}x</Tag>
|
<Tag color={color[tier]}>Multiplier {referralRewardMultiplier}x</Tag>
|
||||||
<h3 className="mt-1 mb-1 text-base">{label}</h3>
|
<h3 className="mt-1 mb-1 text-base">{label}</h3>
|
||||||
<p className="text-sm text-vega-clight-100 dark:text-vega-cdark-100">
|
<p className="text-sm text-vega-clight-100 dark:text-vega-cdark-100">
|
||||||
{t('Stake a minimum of')} {minimumStakedTokens} {t('$VEGA tokens')}
|
{t('Stake a minimum of {{minimumStakedTokens}} $VEGA tokens', {
|
||||||
|
minimumStakedTokens,
|
||||||
|
})}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -70,6 +74,7 @@ const StakingTier = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const TiersContainer = () => {
|
export const TiersContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { benefitTiers, stakingTiers, details, loading, error } =
|
const { benefitTiers, stakingTiers, details, loading, error } =
|
||||||
useReferralProgram();
|
useReferralProgram();
|
||||||
|
|
||||||
@ -82,13 +87,15 @@ export const TiersContainer = () => {
|
|||||||
if ((!loading && !details) || error) {
|
if ((!loading && !details) || error) {
|
||||||
return (
|
return (
|
||||||
<div className="text-base px-5 py-10 text-center">
|
<div className="text-base px-5 py-10 text-center">
|
||||||
{t(
|
<Trans
|
||||||
"We're sorry but we don't have an active referral programme currently running. You can propose a new programme"
|
defaults="We're sorry but we don't have an active referral programme currently running. You can propose a new programme <0>here</0>."
|
||||||
)}{' '}
|
components={[
|
||||||
<ExternalLink href={governanceLink(TOKEN_PROPOSALS)}>
|
<ExternalLink href={governanceLink(TOKEN_PROPOSALS)} key="link">
|
||||||
{t('here')}
|
{t('here')}
|
||||||
</ExternalLink>
|
</ExternalLink>,
|
||||||
.
|
]}
|
||||||
|
ns={ns}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -174,6 +181,7 @@ const TiersTable = ({
|
|||||||
}>;
|
}>;
|
||||||
windowLength?: number;
|
windowLength?: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<Table
|
<Table
|
||||||
columns={[
|
columns={[
|
||||||
@ -186,12 +194,9 @@ const TiersTable = ({
|
|||||||
{ name: 'discount', displayName: t('Referrer trading discount') },
|
{ name: 'discount', displayName: t('Referrer trading discount') },
|
||||||
{
|
{
|
||||||
name: 'volume',
|
name: 'volume',
|
||||||
displayName: t(
|
displayName: t('Min. trading volume (last {{count}} epochs)', {
|
||||||
'Min. trading volume %s',
|
count: windowLength,
|
||||||
windowLength
|
}),
|
||||||
? t('(last %s epochs)', windowLength.toString())
|
|
||||||
: undefined
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{ name: 'epochs', displayName: t('Min. epochs') },
|
{ name: 'epochs', displayName: t('Min. epochs') },
|
||||||
]}
|
]}
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { HTMLAttributes, ReactNode } from 'react';
|
import type { HTMLAttributes, ReactNode } from 'react';
|
||||||
import { Button } from './buttons';
|
import { Button } from './buttons';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const Tile = ({
|
export const Tile = ({
|
||||||
className,
|
className,
|
||||||
@ -62,10 +62,13 @@ export const CodeTile = ({
|
|||||||
createdAt?: string;
|
createdAt?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<StatTile
|
<StatTile
|
||||||
title={t('Your referral code')}
|
title={t('Your referral code')}
|
||||||
description={createdAt ? t('(Created at: %s)', createdAt) : undefined}
|
description={
|
||||||
|
createdAt ? t('(Created at: {{createdAt}})', { createdAt }) : undefined
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex items-center justify-between gap-2">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
@ -13,12 +12,14 @@ import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
|||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const AccountsContainer = ({
|
export const AccountsContainer = ({
|
||||||
pinnedAsset,
|
pinnedAsset,
|
||||||
}: {
|
}: {
|
||||||
pinnedAsset?: PinnedAsset;
|
pinnedAsset?: PinnedAsset;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const onMarketClick = useMarketClickHandler(true);
|
const onMarketClick = useMarketClickHandler(true);
|
||||||
const { pubKey, isReadOnly } = useVegaWallet();
|
const { pubKey, isReadOnly } = useVegaWallet();
|
||||||
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const AccountsMenu = () => {
|
export const AccountsMenu = () => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const setViews = useSidebar((store) => store.setViews);
|
const setViews = useSidebar((store) => store.setViews);
|
||||||
|
|
||||||
|
@ -8,12 +8,13 @@ import {
|
|||||||
NodeGuard,
|
NodeGuard,
|
||||||
useEnvironment,
|
useEnvironment,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { VegaWalletProvider } from '@vegaprotocol/wallet';
|
import { VegaWalletProvider } from '@vegaprotocol/wallet';
|
||||||
import { Suspense, type ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { Web3Provider } from './web3-provider';
|
import { Web3Provider } from './web3-provider';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const Bootstrapper = ({ children }: { children: ReactNode }) => {
|
export const Bootstrapper = ({ children }: { children: ReactNode }) => {
|
||||||
|
const t = useT();
|
||||||
const {
|
const {
|
||||||
error,
|
error,
|
||||||
VEGA_URL,
|
VEGA_URL,
|
||||||
@ -36,7 +37,6 @@ export const Bootstrapper = ({ children }: { children: ReactNode }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<AppLoader />}>
|
|
||||||
<NetworkLoader
|
<NetworkLoader
|
||||||
cache={cacheConfig}
|
cache={cacheConfig}
|
||||||
skeleton={<AppLoader />}
|
skeleton={<AppLoader />}
|
||||||
@ -46,12 +46,16 @@ export const Bootstrapper = ({ children }: { children: ReactNode }) => {
|
|||||||
>
|
>
|
||||||
<NodeGuard
|
<NodeGuard
|
||||||
skeleton={<AppLoader />}
|
skeleton={<AppLoader />}
|
||||||
failure={<NodeFailure title={t(`Node: ${VEGA_URL} is unsuitable`)} />}
|
failure={
|
||||||
|
<NodeFailure
|
||||||
|
title={t('Node: {{VEGA_URL}} is unsuitable', { VEGA_URL })}
|
||||||
|
/>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Web3Provider
|
<Web3Provider
|
||||||
skeleton={<AppLoader />}
|
skeleton={<AppLoader />}
|
||||||
failure={
|
failure={
|
||||||
<AppFailure title={t(`Could not configure web3 provider`)} />
|
<AppFailure title={t('Could not configure web3 provider')} />
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<VegaWalletProvider
|
<VegaWalletProvider
|
||||||
@ -72,7 +76,6 @@ export const Bootstrapper = ({ children }: { children: ReactNode }) => {
|
|||||||
</Web3Provider>
|
</Web3Provider>
|
||||||
</NodeGuard>
|
</NodeGuard>
|
||||||
</NetworkLoader>
|
</NetworkLoader>
|
||||||
</Suspense>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { DepositsTable } from '@vegaprotocol/deposits';
|
import { DepositsTable } from '@vegaprotocol/deposits';
|
||||||
import { depositsProvider } from '@vegaprotocol/deposits';
|
import { depositsProvider } from '@vegaprotocol/deposits';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const DepositsContainer = () => {
|
export const DepositsContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { data, error } = useDataProvider({
|
const { data, error } = useDataProvider({
|
||||||
dataProvider: depositsProvider,
|
dataProvider: depositsProvider,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const DepositsMenu = () => {
|
export const DepositsMenu = () => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const setViews = useSidebar((store) => store.setViews);
|
const setViews = useSidebar((store) => store.setViews);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import maxBy from 'lodash/maxBy';
|
import maxBy from 'lodash/maxBy';
|
||||||
import minBy from 'lodash/minBy';
|
import minBy from 'lodash/minBy';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import {
|
import {
|
||||||
useNetworkParams,
|
useNetworkParams,
|
||||||
@ -24,8 +23,10 @@ import {
|
|||||||
VegaIconNames,
|
VegaIconNames,
|
||||||
truncateMiddle,
|
truncateMiddle,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const FeesContainer = () => {
|
export const FeesContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { params, loading: paramsLoading } = useNetworkParams([
|
const { params, loading: paramsLoading } = useNetworkParams([
|
||||||
NetworkParams.market_fee_factors_makerFee,
|
NetworkParams.market_fee_factors_makerFee,
|
||||||
@ -202,6 +203,7 @@ export const TradingFees = ({
|
|||||||
referralDiscount: number;
|
referralDiscount: number;
|
||||||
volumeDiscount: number;
|
volumeDiscount: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const referralDiscountBigNum = new BigNumber(referralDiscount);
|
const referralDiscountBigNum = new BigNumber(referralDiscount);
|
||||||
const volumeDiscountBigNum = new BigNumber(volumeDiscount);
|
const volumeDiscountBigNum = new BigNumber(volumeDiscount);
|
||||||
|
|
||||||
@ -305,6 +307,7 @@ export const CurrentVolume = ({
|
|||||||
windowLengthVolume: number;
|
windowLengthVolume: number;
|
||||||
windowLength: number;
|
windowLength: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const nextTier = tiers[tierIndex + 1];
|
const nextTier = tiers[tierIndex + 1];
|
||||||
const requiredForNextTier = nextTier
|
const requiredForNextTier = nextTier
|
||||||
? Number(nextTier.minimumRunningNotionalTakerVolume) - windowLengthVolume
|
? Number(nextTier.minimumRunningNotionalTakerVolume) - windowLengthVolume
|
||||||
@ -314,7 +317,7 @@ export const CurrentVolume = ({
|
|||||||
<div className="flex flex-col gap-3 pt-4">
|
<div className="flex flex-col gap-3 pt-4">
|
||||||
<CardStat
|
<CardStat
|
||||||
value={formatNumberRounded(new BigNumber(windowLengthVolume))}
|
value={formatNumberRounded(new BigNumber(windowLengthVolume))}
|
||||||
text={t('Past %s epochs', windowLength.toString())}
|
text={t('Past {{count}} epochs', { count: windowLength })}
|
||||||
/>
|
/>
|
||||||
{requiredForNextTier > 0 && (
|
{requiredForNextTier > 0 && (
|
||||||
<CardStat
|
<CardStat
|
||||||
@ -335,15 +338,15 @@ const ReferralBenefits = ({
|
|||||||
setRunningNotionalTakerVolume: number;
|
setRunningNotionalTakerVolume: number;
|
||||||
epochs: number;
|
epochs: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-3 pt-4">
|
<div className="flex flex-col gap-3 pt-4">
|
||||||
<CardStat
|
<CardStat
|
||||||
// all sets volume (not just current party)
|
// all sets volume (not just current party)
|
||||||
value={formatNumber(setRunningNotionalTakerVolume)}
|
value={formatNumber(setRunningNotionalTakerVolume)}
|
||||||
text={t(
|
text={t('Combined running notional over the {{count}} epochs', {
|
||||||
'Combined running notional over the %s epochs',
|
count: epochs,
|
||||||
epochs.toString()
|
})}
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
<CardStat value={epochsInSet} text={t('epochs in referral set')} />
|
<CardStat value={epochsInSet} text={t('epochs in referral set')} />
|
||||||
</div>
|
</div>
|
||||||
@ -361,6 +364,7 @@ const TotalDiscount = ({
|
|||||||
isReferralProgramRunning: boolean;
|
isReferralProgramRunning: boolean;
|
||||||
isVolumeDiscountProgramRunning: boolean;
|
isVolumeDiscountProgramRunning: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const totalDiscount = 1 - (1 - volumeDiscount) * (1 - referralDiscount);
|
const totalDiscount = 1 - (1 - volumeDiscount) * (1 - referralDiscount);
|
||||||
const totalDiscountDescription = t(
|
const totalDiscountDescription = t(
|
||||||
'The total discount is calculated according to the following formula: '
|
'The total discount is calculated according to the following formula: '
|
||||||
@ -431,6 +435,7 @@ const VolumeTiers = ({
|
|||||||
lastEpochVolume: number;
|
lastEpochVolume: number;
|
||||||
windowLength: number;
|
windowLength: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
if (!tiers.length) {
|
if (!tiers.length) {
|
||||||
return (
|
return (
|
||||||
<p className="text-muted text-sm">
|
<p className="text-muted text-sm">
|
||||||
@ -447,7 +452,9 @@ const VolumeTiers = ({
|
|||||||
<Th>{t('Tier')}</Th>
|
<Th>{t('Tier')}</Th>
|
||||||
<Th>{t('Discount')}</Th>
|
<Th>{t('Discount')}</Th>
|
||||||
<Th>{t('Min. trading volume')}</Th>
|
<Th>{t('Min. trading volume')}</Th>
|
||||||
<Th>{t('My volume (last %s epochs)', windowLength.toString())}</Th>
|
<Th>
|
||||||
|
{t('My volume (last {{count}} epochs)', { count: windowLength })}
|
||||||
|
</Th>
|
||||||
<Th />
|
<Th />
|
||||||
</tr>
|
</tr>
|
||||||
</THead>
|
</THead>
|
||||||
@ -492,6 +499,8 @@ const ReferralTiers = ({
|
|||||||
epochsInSet: number;
|
epochsInSet: number;
|
||||||
referralVolumeInWindow: number;
|
referralVolumeInWindow: number;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
|
|
||||||
if (!tiers.length) {
|
if (!tiers.length) {
|
||||||
return (
|
return (
|
||||||
<p className="text-muted text-sm">{t('No referral program active')}</p>
|
<p className="text-muted text-sm">{t('No referral program active')}</p>
|
||||||
@ -549,6 +558,8 @@ const ReferralTiers = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const YourTier = () => {
|
const YourTier = () => {
|
||||||
|
const t = useT();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="bg-rainbow whitespace-nowrap rounded-xl px-4 py-1.5 text-white">
|
<span className="bg-rainbow whitespace-nowrap rounded-xl px-4 py-1.5 text-white">
|
||||||
{t('Your tier')}
|
{t('Your tier')}
|
||||||
@ -556,7 +567,10 @@ const YourTier = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ReferrerInfo = ({ code }: { code?: string }) => (
|
const ReferrerInfo = ({ code }: { code?: string }) => {
|
||||||
|
const t = useT();
|
||||||
|
|
||||||
|
return (
|
||||||
<div className="text-vega-clight-200 dark:vega-cdark-200 pt-3 text-sm">
|
<div className="text-vega-clight-200 dark:vega-cdark-200 pt-3 text-sm">
|
||||||
<p className="mb-1">
|
<p className="mb-1">
|
||||||
{t('Connected key is owner of the referral set')}
|
{t('Connected key is owner of the referral set')}
|
||||||
@ -582,4 +596,5 @@ const ReferrerInfo = ({ code }: { code?: string }) => (
|
|||||||
{t('for more information.')}
|
{t('for more information.')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
import compact from 'lodash/compact';
|
import compact from 'lodash/compact';
|
||||||
import type { MarketMaybeWithDataAndCandles } from '@vegaprotocol/markets';
|
import type { MarketMaybeWithDataAndCandles } from '@vegaprotocol/markets';
|
||||||
import { AgGrid } from '@vegaprotocol/datagrid';
|
import { AgGrid } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { formatPercentage, getAdjustedFee } from './utils';
|
import { formatPercentage, getAdjustedFee } from './utils';
|
||||||
import { MarketCodeCell } from '../../client-pages/markets/market-code-cell';
|
import { MarketCodeCell } from '../../client-pages/markets/market-code-cell';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { useNavigateWithMeta } from '../../lib/hooks/use-market-click-handler';
|
import { useNavigateWithMeta } from '../../lib/hooks/use-market-click-handler';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
const feesTableColumnDefs = [
|
const useFeesTableColumnDefs = () => {
|
||||||
|
const t = useT();
|
||||||
|
return useMemo(
|
||||||
|
() => [
|
||||||
{ field: 'code', cellRenderer: 'MarketCodeCell' },
|
{ field: 'code', cellRenderer: 'MarketCodeCell' },
|
||||||
{
|
{
|
||||||
field: 'feeAfterDiscount',
|
field: 'feeAfterDiscount',
|
||||||
@ -32,7 +36,10 @@ const feesTableColumnDefs = [
|
|||||||
headerName: t('Total fee before discount'),
|
headerName: t('Total fee before discount'),
|
||||||
valueFormatter: ({ value }: { value: number }) => value + '%',
|
valueFormatter: ({ value }: { value: number }) => value + '%',
|
||||||
},
|
},
|
||||||
];
|
],
|
||||||
|
[t]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const feesTableDefaultColDef = {
|
const feesTableDefaultColDef = {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -83,7 +90,7 @@ export const MarketFees = ({
|
|||||||
return (
|
return (
|
||||||
<div className="border rounded-sm border-default">
|
<div className="border rounded-sm border-default">
|
||||||
<AgGrid
|
<AgGrid
|
||||||
columnDefs={feesTableColumnDefs}
|
columnDefs={useFeesTableColumnDefs()}
|
||||||
rowData={rows}
|
rowData={rows}
|
||||||
getRowId={({ data }) => data.id}
|
getRowId={({ data }) => data.id}
|
||||||
defaultColDef={feesTableDefaultColDef}
|
defaultColDef={feesTableDefaultColDef}
|
||||||
|
@ -3,13 +3,14 @@ import { FillsManager } from '@vegaprotocol/fills';
|
|||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const FillsContainer = () => {
|
export const FillsContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const onMarketClick = useMarketClickHandler(true);
|
const onMarketClick = useMarketClickHandler(true);
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ import 'pennant/dist/style.css';
|
|||||||
import { useFundingPeriodsQuery } from '@vegaprotocol/markets';
|
import { useFundingPeriodsQuery } from '@vegaprotocol/markets';
|
||||||
import { LineChart } from 'pennant';
|
import { LineChart } from 'pennant';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const calculateStartDate = (range: string): string | undefined => {
|
const calculateStartDate = (range: string): string | undefined => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
@ -41,6 +41,7 @@ const DateRange = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
||||||
|
const t = useT();
|
||||||
const { theme } = useThemeSwitcher();
|
const { theme } = useThemeSwitcher();
|
||||||
const variables = useMemo(
|
const variables = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
@ -73,7 +74,7 @@ export const FundingContainer = ({ marketId }: { marketId: string }) => {
|
|||||||
cols: ['Date', t('Funding rate')],
|
cols: ['Date', t('Funding rate')],
|
||||||
rows: sortBy(rows, 'endTime').map((d) => [d.endTime, d.fundingRate]),
|
rows: sortBy(rows, 'endTime').map((d) => [d.endTime, d.fundingRate]),
|
||||||
};
|
};
|
||||||
}, [data?.fundingPeriods.edges]);
|
}, [data?.fundingPeriods.edges, t]);
|
||||||
if (!data || !values?.rows.length) {
|
if (!data || !values?.rows.length) {
|
||||||
return <Splash> {t('No funding history data')}</Splash>;
|
return <Splash> {t('No funding history data')}</Splash>;
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,18 @@ import { FundingPaymentsManager } from '@vegaprotocol/funding-payments';
|
|||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const FundingPaymentsContainer = ({
|
export const FundingPaymentsContainer = ({
|
||||||
marketId,
|
marketId,
|
||||||
}: {
|
}: {
|
||||||
marketId?: string;
|
marketId?: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const onMarketClick = useMarketClickHandler(true);
|
const onMarketClick = useMarketClickHandler(true);
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { LedgerExportForm } from '@vegaprotocol/ledger';
|
import { LedgerExportForm } from '@vegaprotocol/ledger';
|
||||||
import { Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
import { Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import type { PartyAssetFieldsFragment } from '@vegaprotocol/assets';
|
import type { PartyAssetFieldsFragment } from '@vegaprotocol/assets';
|
||||||
import { usePartyAssetsQuery } from '@vegaprotocol/assets';
|
import { usePartyAssetsQuery } from '@vegaprotocol/assets';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const LedgerContainer = () => {
|
export const LedgerContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const VEGA_URL = useEnvironment((store) => store.VEGA_URL);
|
const VEGA_URL = useEnvironment((store) => store.VEGA_URL);
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { data, loading } = usePartyAssetsQuery({
|
const { data, loading } = usePartyAssetsQuery({
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
lpAggregatedDataProvider,
|
lpAggregatedDataProvider,
|
||||||
type Filter,
|
type Filter,
|
||||||
@ -17,6 +16,7 @@ import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const LiquidityContainer = ({
|
export const LiquidityContainer = ({
|
||||||
marketId,
|
marketId,
|
||||||
@ -25,6 +25,7 @@ export const LiquidityContainer = ({
|
|||||||
marketId: string | undefined;
|
marketId: string | undefined;
|
||||||
filter?: Filter;
|
filter?: Filter;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const gridStore = useLiquidityStore((store) => store.gridStore);
|
const gridStore = useLiquidityStore((store) => store.gridStore);
|
||||||
const updateGridStore = useLiquidityStore((store) => store.updateGridStore);
|
const updateGridStore = useLiquidityStore((store) => store.updateGridStore);
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
addDecimalsFormatNumber,
|
addDecimalsFormatNumber,
|
||||||
formatNumberPercentage,
|
formatNumberPercentage,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
CopyWithTooltip,
|
CopyWithTooltip,
|
||||||
ExternalLink,
|
ExternalLink,
|
||||||
@ -24,8 +23,10 @@ import {
|
|||||||
usePaidFeesQuery,
|
usePaidFeesQuery,
|
||||||
} from '@vegaprotocol/liquidity';
|
} from '@vegaprotocol/liquidity';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const LiquidityHeader = () => {
|
export const LiquidityHeader = () => {
|
||||||
|
const t = useT();
|
||||||
const { marketId } = useParams();
|
const { marketId } = useParams();
|
||||||
const { data: market } = useMarket(marketId);
|
const { data: market } = useMarket(marketId);
|
||||||
const { data: marketData } = useStaticMarketData(marketId);
|
const { data: marketData } = useStaticMarketData(marketId);
|
||||||
@ -60,10 +61,9 @@ export const LiquidityHeader = () => {
|
|||||||
marketId && (
|
marketId && (
|
||||||
<HeaderTitle>
|
<HeaderTitle>
|
||||||
{market.tradableInstrument.instrument.code &&
|
{market.tradableInstrument.instrument.code &&
|
||||||
t(
|
t('{{instrumentCode}} liquidity provision', {
|
||||||
'%s liquidity provision',
|
instrumentCode: market.tradableInstrument.instrument.code,
|
||||||
market.tradableInstrument.instrument.code
|
})}
|
||||||
)}
|
|
||||||
</HeaderTitle>
|
</HeaderTitle>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -102,8 +102,8 @@ export const LiquidityHeader = () => {
|
|||||||
<HeaderStat
|
<HeaderStat
|
||||||
heading={t('Fees paid')}
|
heading={t('Fees paid')}
|
||||||
description={t(
|
description={t(
|
||||||
'The amount of fees paid to liquidity providers across the whole market during the last epoch %s.',
|
'The amount of fees paid to liquidity providers across the whole market during the last epoch {{epoch}}.',
|
||||||
feesObject?.node.epoch.toString() || '-'
|
{ epoch: feesObject?.node.epoch.toString() || '-' }
|
||||||
)}
|
)}
|
||||||
testId="fees-paid"
|
testId="fees-paid"
|
||||||
>
|
>
|
||||||
|
@ -21,10 +21,10 @@ import {
|
|||||||
addDecimalsFormatNumberQuantum,
|
addDecimalsFormatNumberQuantum,
|
||||||
formatNumberPercentage,
|
formatNumberPercentage,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { DocsLinks } from '@vegaprotocol/environment';
|
import { DocsLinks } from '@vegaprotocol/environment';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
marketId?: string;
|
marketId?: string;
|
||||||
@ -39,6 +39,7 @@ export const MarketLiquiditySupplied = ({
|
|||||||
noUpdate = false,
|
noUpdate = false,
|
||||||
quantum,
|
quantum,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
|
const t = useT();
|
||||||
const [market, setMarket] = useState<MarketData>();
|
const [market, setMarket] = useState<MarketData>();
|
||||||
const { params } = useNetworkParams([
|
const { params } = useNetworkParams([
|
||||||
NetworkParams.market_liquidity_stakeToCcyVolume,
|
NetworkParams.market_liquidity_stakeToCcyVolume,
|
||||||
|
@ -132,7 +132,9 @@ describe('MarketSuccessorBanner', () => {
|
|||||||
wrapper: MockedProvider,
|
wrapper: MockedProvider,
|
||||||
});
|
});
|
||||||
expect(
|
expect(
|
||||||
screen.getByText('has a 24h trading volume of 101.367')
|
screen.getByText('has a 24h trading volume of 101.367', {
|
||||||
|
exact: false,
|
||||||
|
})
|
||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -17,8 +17,9 @@ import {
|
|||||||
getMarketExpiryDate,
|
getMarketExpiryDate,
|
||||||
isNumeric,
|
isNumeric,
|
||||||
} from '@vegaprotocol/utils';
|
} from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import * as Types from '@vegaprotocol/types';
|
import * as Types from '@vegaprotocol/types';
|
||||||
|
import { useT, ns } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
const getExpiryDate = (tags: string[], close?: string): Date | null => {
|
const getExpiryDate = (tags: string[], close?: string): Date | null => {
|
||||||
const expiryDate = getMarketExpiryDate(tags);
|
const expiryDate = getMarketExpiryDate(tags);
|
||||||
@ -30,6 +31,7 @@ export const MarketSuccessorBanner = ({
|
|||||||
}: {
|
}: {
|
||||||
market: Market | null;
|
market: Market | null;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const { data: marketState } = useMarketState(market?.id);
|
const { data: marketState } = useMarketState(market?.id);
|
||||||
const isSettled = marketState === Types.MarketState.STATE_SETTLED;
|
const isSettled = marketState === Types.MarketState.STATE_SETTLED;
|
||||||
const { data: successorData, loading } = useSuccessorMarket(market?.id);
|
const { data: successorData, loading } = useSuccessorMarket(market?.id);
|
||||||
@ -81,8 +83,8 @@ export const MarketSuccessorBanner = ({
|
|||||||
<div className="mt-1">
|
<div className="mt-1">
|
||||||
{duration && (
|
{duration && (
|
||||||
<span>
|
<span>
|
||||||
{t('This market expires in %s.', [
|
{t('This market expires in {{duration}}.', {
|
||||||
formatDuration(duration, {
|
duration: formatDuration(duration, {
|
||||||
format: [
|
format: [
|
||||||
'years',
|
'years',
|
||||||
'months',
|
'months',
|
||||||
@ -92,22 +94,46 @@ export const MarketSuccessorBanner = ({
|
|||||||
'minutes',
|
'minutes',
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
])}
|
})}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{successorData && (
|
{successorData && (
|
||||||
<>
|
<>
|
||||||
{' '}
|
{' '}
|
||||||
{t('The successor market')}
|
{successorVolume ? (
|
||||||
{!successorVolume ? ' is ' : ' '}
|
<Trans
|
||||||
<ExternalLink href={`/#/markets/${successorData?.id}`}>
|
defaults="The successor market <0>{{instrumentName}}</0> has a 24h trading volume of {{successorVolume}}"
|
||||||
{successorData?.tradableInstrument.instrument.name}
|
values={{
|
||||||
</ExternalLink>
|
successorVolume,
|
||||||
{successorVolume && (
|
instrumentName:
|
||||||
<span>
|
successorData?.tradableInstrument.instrument.name,
|
||||||
{' '}
|
}}
|
||||||
{t('has a 24h trading volume of %s', [successorVolume])}
|
components={[
|
||||||
</span>
|
<ExternalLink
|
||||||
|
href={`/#/markets/${successorData?.id}`}
|
||||||
|
key="link"
|
||||||
|
>
|
||||||
|
successor market name
|
||||||
|
</ExternalLink>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Trans
|
||||||
|
defaults="The successor market is <0>{{instrumentName}}</0>"
|
||||||
|
values={{
|
||||||
|
instrumentName:
|
||||||
|
successorData?.tradableInstrument.instrument.name,
|
||||||
|
}}
|
||||||
|
components={[
|
||||||
|
<ExternalLink
|
||||||
|
href={`/#/markets/${successorData?.id}`}
|
||||||
|
key="link"
|
||||||
|
>
|
||||||
|
successor market name
|
||||||
|
</ExternalLink>,
|
||||||
|
]}
|
||||||
|
ns={ns}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
@ -9,16 +9,17 @@ import {
|
|||||||
Intent,
|
Intent,
|
||||||
NotificationBanner,
|
NotificationBanner,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
||||||
import * as Types from '@vegaprotocol/types';
|
import * as Types from '@vegaprotocol/types';
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketSuccessorProposalBanner = ({
|
export const MarketSuccessorProposalBanner = ({
|
||||||
marketId,
|
marketId,
|
||||||
}: {
|
}: {
|
||||||
marketId?: string;
|
marketId?: string;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const { data: proposals } = useDataProvider({
|
const { data: proposals } = useDataProvider({
|
||||||
dataProvider: marketViewProposalsDataProvider,
|
dataProvider: marketViewProposalsDataProvider,
|
||||||
skip: !marketId,
|
skip: !marketId,
|
||||||
@ -57,9 +58,13 @@ export const MarketSuccessorProposalBanner = ({
|
|||||||
: t('Successors to this market have been proposed')}
|
: t('Successors to this market have been proposed')}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{successors.length === 1
|
{t(
|
||||||
? t('Check out the terms of the proposal and vote:')
|
'checkOutProposalsAndVote',
|
||||||
: t('Check out the terms of the proposals and vote:')}{' '}
|
'Check out the terms of the proposals and vote:',
|
||||||
|
{
|
||||||
|
count: successors.length,
|
||||||
|
}
|
||||||
|
)}{' '}
|
||||||
{successors.map((item, i) => {
|
{successors.map((item, i) => {
|
||||||
const externalLink = tokenLink(
|
const externalLink = tokenLink(
|
||||||
TOKEN_PROPOSAL.replace(':id', item.id || '')
|
TOKEN_PROPOSAL.replace(':id', item.id || '')
|
||||||
|
@ -8,7 +8,6 @@ import {
|
|||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import type { MarketViewProposalFieldsFragment } from '@vegaprotocol/proposals';
|
import type { MarketViewProposalFieldsFragment } from '@vegaprotocol/proposals';
|
||||||
import { marketViewProposalsDataProvider } from '@vegaprotocol/proposals';
|
import { marketViewProposalsDataProvider } from '@vegaprotocol/proposals';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import * as Types from '@vegaprotocol/types';
|
import * as Types from '@vegaprotocol/types';
|
||||||
import type { Market } from '@vegaprotocol/markets';
|
import type { Market } from '@vegaprotocol/markets';
|
||||||
import { getQuoteName } from '@vegaprotocol/markets';
|
import { getQuoteName } from '@vegaprotocol/markets';
|
||||||
@ -21,6 +20,7 @@ import {
|
|||||||
useLinks,
|
useLinks,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const filterProposals = (
|
const filterProposals = (
|
||||||
data: MarketViewProposalFieldsFragment[] | null,
|
data: MarketViewProposalFieldsFragment[] | null,
|
||||||
@ -68,6 +68,7 @@ export const MarketTerminationBanner = ({
|
|||||||
}: {
|
}: {
|
||||||
market: Market | null;
|
market: Market | null;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const [visible, setVisible] = useState(true);
|
const [visible, setVisible] = useState(true);
|
||||||
const skip = !market || !visible;
|
const skip = !market || !visible;
|
||||||
const { data: passedProposalsData } = useDataProvider({
|
const { data: passedProposalsData } = useDataProvider({
|
||||||
@ -113,19 +114,22 @@ export const MarketTerminationBanner = ({
|
|||||||
content = (
|
content = (
|
||||||
<>
|
<>
|
||||||
<div className="uppercase mb-1">
|
<div className="uppercase mb-1">
|
||||||
{t('Trading on Market %s will stop on %s', [name, date])}
|
{t('Trading on Market {{name}} will stop on {{date}}', {
|
||||||
|
name,
|
||||||
|
date,
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{t(
|
{t(
|
||||||
'You will no longer be able to hold a position on this market when it closes in %s.',
|
'You will no longer be able to hold a position on this market when it closes in {{duration}}.',
|
||||||
[duration]
|
{ duration }
|
||||||
)}{' '}
|
)}{' '}
|
||||||
{price &&
|
{price &&
|
||||||
assetSymbol &&
|
assetSymbol &&
|
||||||
t('The final price will be %s %s.', [
|
t('The final price will be {{price}} {{assetSymbol}}.', {
|
||||||
addDecimalsFormatNumber(price, market.decimalPlaces),
|
price: addDecimalsFormatNumber(price, market.decimalPlaces),
|
||||||
assetSymbol,
|
assetSymbol,
|
||||||
])}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@ -134,8 +138,8 @@ export const MarketTerminationBanner = ({
|
|||||||
<>
|
<>
|
||||||
<div className="uppercase mb-1">
|
<div className="uppercase mb-1">
|
||||||
{t(
|
{t(
|
||||||
'Trading on Market %s may stop. There are open proposals to close this market',
|
'Trading on Market {{name}} may stop. There are open proposals to close this market',
|
||||||
[name]
|
{ name }
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -151,17 +155,17 @@ export const MarketTerminationBanner = ({
|
|||||||
<>
|
<>
|
||||||
<div className="uppercase mb-1">
|
<div className="uppercase mb-1">
|
||||||
{t(
|
{t(
|
||||||
'Trading on Market %s may stop on %s. There is open proposal to close this market.',
|
'Trading on Market {{name}} may stop on {{date}}. There is open proposal to close this market.',
|
||||||
[name, date]
|
{ name, date }
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{price &&
|
{price &&
|
||||||
assetSymbol &&
|
assetSymbol &&
|
||||||
t('Proposed final price is %s %s.', [
|
t('Proposed final price is {{price}} {{assetSymbol}}.', {
|
||||||
addDecimalsFormatNumber(price, market.decimalPlaces),
|
price: addDecimalsFormatNumber(price, market.decimalPlaces),
|
||||||
assetSymbol,
|
assetSymbol,
|
||||||
])}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ExternalLink href={proposalLink}>{t('View proposal')}</ExternalLink>
|
<ExternalLink href={proposalLink}>{t('View proposal')}</ExternalLink>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
TradingDropdown,
|
TradingDropdown,
|
||||||
TradingDropdownCheckboxItem,
|
TradingDropdownCheckboxItem,
|
||||||
@ -7,6 +6,7 @@ import {
|
|||||||
TradingDropdownTrigger,
|
TradingDropdownTrigger,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { MarketSelectorButton } from './market-selector-button';
|
import { MarketSelectorButton } from './market-selector-button';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
type Assets = Array<{ id: string; symbol: string }>;
|
type Assets = Array<{ id: string; symbol: string }>;
|
||||||
|
|
||||||
@ -19,6 +19,7 @@ export const AssetDropdown = ({
|
|||||||
checkedAssets: string[];
|
checkedAssets: string[];
|
||||||
onSelect: (id: string, checked: boolean) => void;
|
onSelect: (id: string, checked: boolean) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
if (!assets?.length) {
|
if (!assets?.length) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -29,7 +30,7 @@ export const AssetDropdown = ({
|
|||||||
trigger={
|
trigger={
|
||||||
<TradingDropdownTrigger data-testid="asset-trigger">
|
<TradingDropdownTrigger data-testid="asset-trigger">
|
||||||
<MarketSelectorButton>
|
<MarketSelectorButton>
|
||||||
{triggerText({ assets, checkedAssets })}
|
{triggerText({ assets, checkedAssets }, t)}
|
||||||
</MarketSelectorButton>
|
</MarketSelectorButton>
|
||||||
</TradingDropdownTrigger>
|
</TradingDropdownTrigger>
|
||||||
}
|
}
|
||||||
@ -58,13 +59,16 @@ export const AssetDropdown = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const triggerText = ({
|
const triggerText = (
|
||||||
|
{
|
||||||
assets,
|
assets,
|
||||||
checkedAssets,
|
checkedAssets,
|
||||||
}: {
|
}: {
|
||||||
assets: Assets;
|
assets: Assets;
|
||||||
checkedAssets: string[];
|
checkedAssets: string[];
|
||||||
}) => {
|
},
|
||||||
|
t: ReturnType<typeof useT>
|
||||||
|
) => {
|
||||||
let text = t('Assets');
|
let text = t('Assets');
|
||||||
|
|
||||||
if (checkedAssets.length === 1) {
|
if (checkedAssets.length === 1) {
|
||||||
@ -72,7 +76,9 @@ const triggerText = ({
|
|||||||
const asset = assets.find((a) => a.id === assetId);
|
const asset = assets.find((a) => a.id === assetId);
|
||||||
text = asset ? asset.symbol : t('Asset (1)');
|
text = asset ? asset.symbol : t('Asset (1)');
|
||||||
} else if (checkedAssets.length > 1) {
|
} else if (checkedAssets.length > 1) {
|
||||||
text = t(`${checkedAssets.length} Assets`);
|
text = t('{{checkedAssets}} Assets', {
|
||||||
|
checkedAssets: checkedAssets.length,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
|
@ -11,8 +11,8 @@ import {
|
|||||||
MarketTradingMode,
|
MarketTradingMode,
|
||||||
MarketTradingModeMapping,
|
MarketTradingModeMapping,
|
||||||
} from '@vegaprotocol/types';
|
} from '@vegaprotocol/types';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { MarketProductPill } from '@vegaprotocol/datagrid';
|
import { MarketProductPill } from '@vegaprotocol/datagrid';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketSelectorItem = ({
|
export const MarketSelectorItem = ({
|
||||||
market,
|
market,
|
||||||
@ -52,6 +52,7 @@ const MarketData = ({
|
|||||||
market: MarketMaybeWithDataAndCandles;
|
market: MarketMaybeWithDataAndCandles;
|
||||||
allProducts: boolean;
|
allProducts: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const { data } = useMarketDataUpdateSubscription({
|
const { data } = useMarketDataUpdateSubscription({
|
||||||
variables: {
|
variables: {
|
||||||
marketId: market.id,
|
marketId: market.id,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import uniqBy from 'lodash/uniqBy';
|
import uniqBy from 'lodash/uniqBy';
|
||||||
import {
|
import {
|
||||||
getAsset,
|
getAsset,
|
||||||
@ -21,6 +20,7 @@ import type { SortType } from './sort-dropdown';
|
|||||||
import { Sort, SortDropdown } from './sort-dropdown';
|
import { Sort, SortDropdown } from './sort-dropdown';
|
||||||
import { MarketSelectorItem } from './market-selector-item';
|
import { MarketSelectorItem } from './market-selector-item';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export type Filter = {
|
export type Filter = {
|
||||||
searchTerm: string;
|
searchTerm: string;
|
||||||
@ -40,6 +40,7 @@ export const MarketSelector = ({
|
|||||||
currentMarketId?: string;
|
currentMarketId?: string;
|
||||||
onSelect: (marketId: string) => void;
|
onSelect: (marketId: string) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const [filter, setFilter] = useState<Filter>({
|
const [filter, setFilter] = useState<Filter>({
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
product: Product.All,
|
product: Product.All,
|
||||||
@ -158,6 +159,7 @@ const MarketList = ({
|
|||||||
noItems: string;
|
noItems: string;
|
||||||
allProducts: boolean;
|
allProducts: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const itemSize = 45;
|
const itemSize = 45;
|
||||||
const listRef = useRef<HTMLDivElement | null>(null);
|
const listRef = useRef<HTMLDivElement | null>(null);
|
||||||
const rect = listRef.current?.getBoundingClientRect();
|
const rect = listRef.current?.getBoundingClientRect();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
// Make sure these match the available __typename properties on product
|
// Make sure these match the available __typename properties on product
|
||||||
export const Product = {
|
export const Product = {
|
||||||
@ -14,15 +14,6 @@ export const Product = {
|
|||||||
|
|
||||||
export type ProductType = keyof typeof Product;
|
export type ProductType = keyof typeof Product;
|
||||||
|
|
||||||
const ProductTypeMapping: {
|
|
||||||
[key in ProductType]: string;
|
|
||||||
} = {
|
|
||||||
[Product.All]: 'All',
|
|
||||||
[Product.Future]: 'Futures',
|
|
||||||
[Product.Spot]: 'Spot',
|
|
||||||
[Product.Perpetual]: 'Perpetuals',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const ProductSelector = ({
|
export const ProductSelector = ({
|
||||||
product,
|
product,
|
||||||
onSelect,
|
onSelect,
|
||||||
@ -30,6 +21,15 @@ export const ProductSelector = ({
|
|||||||
product: ProductType;
|
product: ProductType;
|
||||||
onSelect: (product: ProductType) => void;
|
onSelect: (product: ProductType) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
|
const ProductTypeMapping: {
|
||||||
|
[key in ProductType]: string;
|
||||||
|
} = {
|
||||||
|
[Product.All]: t('All'),
|
||||||
|
[Product.Future]: t('Futures'),
|
||||||
|
[Product.Spot]: t('Spot'),
|
||||||
|
[Product.Perpetual]: t('Perpetuals'),
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="flex mb-2">
|
<div className="flex mb-2">
|
||||||
{Object.keys(Product).map((t) => {
|
{Object.keys(Product).map((t) => {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import type { MarketData, Market } from '@vegaprotocol/markets';
|
import type { MarketData, Market } from '@vegaprotocol/markets';
|
||||||
import { marketDataProvider } from '@vegaprotocol/markets';
|
import { marketDataProvider } from '@vegaprotocol/markets';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
@ -9,8 +8,10 @@ import { useCallback, useRef, useState } from 'react';
|
|||||||
import * as constants from '../constants';
|
import * as constants from '../constants';
|
||||||
import { DocsLinks } from '@vegaprotocol/environment';
|
import { DocsLinks } from '@vegaprotocol/environment';
|
||||||
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketState = ({ market }: { market: Market | null }) => {
|
export const MarketState = ({ market }: { market: Market | null }) => {
|
||||||
|
const t = useT();
|
||||||
const [marketState, setMarketState] = useState<Schema.MarketState | null>(
|
const [marketState, setMarketState] = useState<Schema.MarketState | null>(
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
@ -41,7 +42,7 @@ export const MarketState = ({ market }: { market: Market | null }) => {
|
|||||||
return (
|
return (
|
||||||
<HeaderStat
|
<HeaderStat
|
||||||
heading={t('Status')}
|
heading={t('Status')}
|
||||||
description={getMarketStateTooltip(marketState)}
|
description={useGetMarketStateTooltip(marketState)}
|
||||||
testId="market-state"
|
testId="market-state"
|
||||||
>
|
>
|
||||||
{marketState ? Schema.MarketStateMapping[marketState] : '-'}
|
{marketState ? Schema.MarketStateMapping[marketState] : '-'}
|
||||||
@ -49,7 +50,8 @@ export const MarketState = ({ market }: { market: Market | null }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getMarketStateTooltip = (state: Schema.MarketState | null) => {
|
const useGetMarketStateTooltip = (state: Schema.MarketState | null) => {
|
||||||
|
const t = useT();
|
||||||
if (state === Schema.MarketState.STATE_ACTIVE) {
|
if (state === Schema.MarketState.STATE_ACTIVE) {
|
||||||
return t('Enactment date reached and usual auction exit checks pass');
|
return t('Enactment date reached and usual auction exit checks pass');
|
||||||
}
|
}
|
||||||
@ -96,7 +98,7 @@ const getMarketStateTooltip = (state: Schema.MarketState | null) => {
|
|||||||
return (
|
return (
|
||||||
<p>
|
<p>
|
||||||
{t(
|
{t(
|
||||||
`This market has been suspended via a governance vote and can be resumed or terminated by further votes.`
|
'This market has been suspended via a governance vote and can be resumed or terminated by further votes.'
|
||||||
)}
|
)}
|
||||||
{DocsLinks && (
|
{DocsLinks && (
|
||||||
<ExternalLink href={DocsLinks.MARKET_LIFECYCLE} className="ml-1">
|
<ExternalLink href={DocsLinks.MARKET_LIFECYCLE} className="ml-1">
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { TradingModeTooltip } from '@vegaprotocol/deal-ticket';
|
import { TradingModeTooltip } from '@vegaprotocol/deal-ticket';
|
||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
import * as Schema from '@vegaprotocol/types';
|
import * as Schema from '@vegaprotocol/types';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useStaticMarketData } from '@vegaprotocol/markets';
|
import { useStaticMarketData } from '@vegaprotocol/markets';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const getTradingModeLabel = (
|
const getTradingModeLabel = (
|
||||||
marketTradingMode?: Schema.MarketTradingMode,
|
marketTradingMode?: Schema.MarketTradingMode,
|
||||||
@ -36,6 +36,7 @@ export const HeaderStatMarketTradingMode = ({
|
|||||||
initialTradingMode,
|
initialTradingMode,
|
||||||
initialTrigger,
|
initialTrigger,
|
||||||
}: HeaderStatMarketTradingModeProps) => {
|
}: HeaderStatMarketTradingModeProps) => {
|
||||||
|
const t = useT();
|
||||||
const { data } = useStaticMarketData(marketId);
|
const { data } = useStaticMarketData(marketId);
|
||||||
const marketTradingMode = data?.marketTradingMode ?? initialTradingMode;
|
const marketTradingMode = data?.marketTradingMode ?? initialTradingMode;
|
||||||
const trigger = data?.trigger ?? initialTrigger;
|
const trigger = data?.trigger ?? initialTrigger;
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
import throttle from 'lodash/throttle';
|
import throttle from 'lodash/throttle';
|
||||||
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
import { addDecimalsFormatNumber } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import type { MarketData } from '@vegaprotocol/markets';
|
import type { MarketData } from '@vegaprotocol/markets';
|
||||||
import { marketDataProvider, marketProvider } from '@vegaprotocol/markets';
|
import { marketDataProvider, marketProvider } from '@vegaprotocol/markets';
|
||||||
import { HeaderStat } from '../header';
|
import { HeaderStat } from '../header';
|
||||||
import * as constants from '../constants';
|
import * as constants from '../constants';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const MarketVolume = ({ marketId }: { marketId: string }) => {
|
export const MarketVolume = ({ marketId }: { marketId: string }) => {
|
||||||
|
const t = useT();
|
||||||
const [marketVolume, setMarketVolume] = useState<string>('-');
|
const [marketVolume, setMarketVolume] = useState<string>('-');
|
||||||
const variables = { marketId };
|
const variables = { marketId };
|
||||||
const { data } = useDataProvider({
|
const { data } = useDataProvider({
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import { MarketSelector } from '../market-selector';
|
import { MarketSelector } from '../market-selector';
|
||||||
import { useMarket, useMarketList } from '@vegaprotocol/markets';
|
import { useMarket, useMarketList } from '@vegaprotocol/markets';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is only rendered for the mobile navigation
|
* This is only rendered for the mobile navigation
|
||||||
*/
|
*/
|
||||||
export const NavHeader = () => {
|
export const NavHeader = () => {
|
||||||
|
const t = useT();
|
||||||
const { marketId } = useParams();
|
const { marketId } = useParams();
|
||||||
const { data } = useMarket(marketId);
|
const { data } = useMarket(marketId);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
@ -7,8 +7,8 @@ import {
|
|||||||
DApp,
|
DApp,
|
||||||
useLinks,
|
useLinks,
|
||||||
FLAGS,
|
FLAGS,
|
||||||
|
useEnvNameMapping,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useGlobalStore } from '../../stores';
|
import { useGlobalStore } from '../../stores';
|
||||||
import { VegaWalletConnectButton } from '../vega-wallet-connect-button';
|
import { VegaWalletConnectButton } from '../vega-wallet-connect-button';
|
||||||
import { VegaIconNames, VegaIcon, VLogo } from '@vegaprotocol/ui-toolkit';
|
import { VegaIconNames, VegaIcon, VLogo } from '@vegaprotocol/ui-toolkit';
|
||||||
@ -22,6 +22,7 @@ import { VegaWalletMenu } from '../vega-wallet';
|
|||||||
import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
|
import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
|
||||||
import { WalletIcon } from '../icons/wallet';
|
import { WalletIcon } from '../icons/wallet';
|
||||||
import { ProtocolUpgradeCountdown } from '@vegaprotocol/proposals';
|
import { ProtocolUpgradeCountdown } from '@vegaprotocol/proposals';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
type MenuState = 'wallet' | 'nav' | null;
|
type MenuState = 'wallet' | 'nav' | null;
|
||||||
type Theme = 'system' | 'yellow';
|
type Theme = 'system' | 'yellow';
|
||||||
@ -33,6 +34,7 @@ export const Navbar = ({
|
|||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
theme?: Theme;
|
theme?: Theme;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
// menu state for small screens
|
// menu state for small screens
|
||||||
const [menu, setMenu] = useState<MenuState>(null);
|
const [menu, setMenu] = useState<MenuState>(null);
|
||||||
|
|
||||||
@ -138,6 +140,8 @@ export const Navbar = ({
|
|||||||
* of the navigation
|
* of the navigation
|
||||||
*/
|
*/
|
||||||
const NavbarMenu = ({ onClick }: { onClick: () => void }) => {
|
const NavbarMenu = ({ onClick }: { onClick: () => void }) => {
|
||||||
|
const t = useT();
|
||||||
|
const envNameMapping = useEnvNameMapping();
|
||||||
const { VEGA_ENV, VEGA_NETWORKS, GITHUB_FEEDBACK_URL } = useEnvironment();
|
const { VEGA_ENV, VEGA_NETWORKS, GITHUB_FEEDBACK_URL } = useEnvironment();
|
||||||
const marketId = useGlobalStore((store) => store.marketId);
|
const marketId = useGlobalStore((store) => store.marketId);
|
||||||
|
|
||||||
@ -412,16 +416,6 @@ const NavbarMobileButton = (props: ButtonHTMLAttributes<HTMLButtonElement>) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const envNameMapping: Record<Networks, string> = {
|
|
||||||
[Networks.VALIDATOR_TESTNET]: t('VALIDATOR_TESTNET'),
|
|
||||||
[Networks.CUSTOM]: t('Custom'),
|
|
||||||
[Networks.DEVNET]: t('Devnet'),
|
|
||||||
[Networks.STAGNET1]: t('Stagnet'),
|
|
||||||
[Networks.TESTNET]: t('Fairground testnet'),
|
|
||||||
[Networks.MAINNET_MIRROR]: t('Mirror'),
|
|
||||||
[Networks.MAINNET]: t('Mainnet'),
|
|
||||||
};
|
|
||||||
|
|
||||||
// https://github.com/radix-ui/primitives/issues/1630
|
// https://github.com/radix-ui/primitives/issues/1630
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const preventHover = (e: any) => {
|
const preventHover = (e: any) => {
|
||||||
|
@ -3,11 +3,12 @@ import {
|
|||||||
useNodeHealth,
|
useNodeHealth,
|
||||||
useNodeSwitcherStore,
|
useNodeSwitcherStore,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Indicator, ExternalLink } from '@vegaprotocol/ui-toolkit';
|
import { Indicator, ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Tooltip } from '../../components/tooltip';
|
import { Tooltip } from '../../components/tooltip';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const NodeHealthContainer = () => {
|
export const NodeHealthContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { VEGA_URL, VEGA_INCIDENT_URL } = useEnvironment();
|
const { VEGA_URL, VEGA_INCIDENT_URL } = useEnvironment();
|
||||||
const setNodeSwitcher = useNodeSwitcherStore((store) => store.setDialogOpen);
|
const setNodeSwitcher = useNodeSwitcherStore((store) => store.setDialogOpen);
|
||||||
const { text, intent, datanodeBlockHeight } = useNodeHealth();
|
const { text, intent, datanodeBlockHeight } = useNodeHealth();
|
||||||
@ -57,6 +58,7 @@ interface NodeUrlProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const NodeUrl = ({ url }: NodeUrlProps) => {
|
export const NodeUrl = ({ url }: NodeUrlProps) => {
|
||||||
|
const t = useT();
|
||||||
const urlObj = new URL(url);
|
const urlObj = new URL(url);
|
||||||
const nodeUrl = urlObj.hostname;
|
const nodeUrl = urlObj.hostname;
|
||||||
return <span title={t('Connected node')}>{nodeUrl}</span>;
|
return <span title={t('Connected node')}>{nodeUrl}</span>;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { Filter, OrderListManager } from '@vegaprotocol/orders';
|
import { Filter, OrderListManager } from '@vegaprotocol/orders';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { useNavigateWithMeta } from '../../lib/hooks/use-market-click-handler';
|
import { useNavigateWithMeta } from '../../lib/hooks/use-market-click-handler';
|
||||||
@ -9,8 +8,12 @@ import { persist } from 'zustand/middleware';
|
|||||||
import type { DataGridStore } from '../../stores/datagrid-store-slice';
|
import type { DataGridStore } from '../../stores/datagrid-store-slice';
|
||||||
import { OrderStatus } from '@vegaprotocol/types';
|
import { OrderStatus } from '@vegaprotocol/types';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const resolveNoRowsMessage = (filter?: Filter) => {
|
const resolveNoRowsMessage = (
|
||||||
|
filter: Filter | undefined,
|
||||||
|
t: ReturnType<typeof useT>
|
||||||
|
) => {
|
||||||
switch (filter) {
|
switch (filter) {
|
||||||
case Filter.Open:
|
case Filter.Open:
|
||||||
return t('No open orders');
|
return t('No open orders');
|
||||||
@ -42,6 +45,7 @@ export interface OrderContainerProps {
|
|||||||
const AUTO_SIZE_COLUMNS = ['instrument-code'];
|
const AUTO_SIZE_COLUMNS = ['instrument-code'];
|
||||||
|
|
||||||
export const OrdersContainer = ({ filter }: OrderContainerProps) => {
|
export const OrdersContainer = ({ filter }: OrderContainerProps) => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey, isReadOnly } = useVegaWallet();
|
const { pubKey, isReadOnly } = useVegaWallet();
|
||||||
const navigate = useNavigateWithMeta();
|
const navigate = useNavigateWithMeta();
|
||||||
const { gridState, updateGridState } = useOrderListGridState(filter);
|
const { gridState, updateGridState } = useOrderListGridState(filter);
|
||||||
@ -56,7 +60,7 @@ export const OrdersContainer = ({ filter }: OrderContainerProps) => {
|
|||||||
if (!pubKey) {
|
if (!pubKey) {
|
||||||
return <Splash>{t('Please connect Vega wallet')}</Splash>;
|
return <Splash>{t('Please connect Vega wallet')}</Splash>;
|
||||||
}
|
}
|
||||||
const noRowsMessage = resolveNoRowsMessage(filter);
|
const noRowsMessage = resolveNoRowsMessage(filter, t);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OrderListManager
|
<OrderListManager
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { PositionsManager } from '@vegaprotocol/positions';
|
import { PositionsManager } from '@vegaprotocol/positions';
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
@ -9,10 +8,12 @@ import type { StateCreator } from 'zustand';
|
|||||||
import { create } from 'zustand';
|
import { create } from 'zustand';
|
||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
import { useMarketClickHandler } from '../../lib/hooks/use-market-click-handler';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const AUTO_SIZE_COLUMNS = ['marketCode'];
|
const AUTO_SIZE_COLUMNS = ['marketCode'];
|
||||||
|
|
||||||
export const PositionsContainer = ({ allKeys }: { allKeys?: boolean }) => {
|
export const PositionsContainer = ({ allKeys }: { allKeys?: boolean }) => {
|
||||||
|
const t = useT();
|
||||||
const onMarketClick = useMarketClickHandler(true);
|
const onMarketClick = useMarketClickHandler(true);
|
||||||
const { pubKey, pubKeys, isReadOnly } = useVegaWallet();
|
const { pubKey, pubKeys, isReadOnly } = useVegaWallet();
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { usePositionsStore } from '../positions-container';
|
import { usePositionsStore } from '../positions-container';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const PositionsMenu = () => {
|
export const PositionsMenu = () => {
|
||||||
|
const t = useT();
|
||||||
const showClosed = usePositionsStore((store) => store.showClosedMarkets);
|
const showClosed = usePositionsStore((store) => store.showClosedMarkets);
|
||||||
const toggle = usePositionsStore((store) => store.toggleClosedMarkets);
|
const toggle = usePositionsStore((store) => store.toggleClosedMarkets);
|
||||||
return (
|
return (
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Switch, ToastPositionSetter } from '@vegaprotocol/ui-toolkit';
|
import { Switch, ToastPositionSetter } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
import { useThemeSwitcher } from '@vegaprotocol/react-helpers';
|
||||||
import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval';
|
import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval';
|
||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const Settings = () => {
|
export const Settings = () => {
|
||||||
|
const t = useT();
|
||||||
const { theme, setTheme } = useThemeSwitcher();
|
const { theme, setTheme } = useThemeSwitcher();
|
||||||
const [isApproved, setIsApproved] = useTelemetryApproval();
|
const [isApproved, setIsApproved] = useTelemetryApproval();
|
||||||
return (
|
return (
|
||||||
|
@ -6,7 +6,6 @@ import { create } from 'zustand';
|
|||||||
import { TransferContainer } from '@vegaprotocol/accounts';
|
import { TransferContainer } from '@vegaprotocol/accounts';
|
||||||
import { DealTicketContainer } from '@vegaprotocol/deal-ticket';
|
import { DealTicketContainer } from '@vegaprotocol/deal-ticket';
|
||||||
import { DepositContainer } from '@vegaprotocol/deposits';
|
import { DepositContainer } from '@vegaprotocol/deposits';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { MarketInfoAccordionContainer } from '@vegaprotocol/markets';
|
import { MarketInfoAccordionContainer } from '@vegaprotocol/markets';
|
||||||
import { TinyScroll, VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { TinyScroll, VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import { NodeHealthContainer } from '../node-health';
|
import { NodeHealthContainer } from '../node-health';
|
||||||
@ -16,6 +15,7 @@ import { WithdrawContainer } from '../withdraw-container';
|
|||||||
import { GetStarted } from '../welcome-dialog';
|
import { GetStarted } from '../welcome-dialog';
|
||||||
import { useVegaWallet, useViewAsDialog } from '@vegaprotocol/wallet';
|
import { useVegaWallet, useViewAsDialog } from '@vegaprotocol/wallet';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export enum ViewType {
|
export enum ViewType {
|
||||||
Order = 'Order',
|
Order = 'Order',
|
||||||
@ -51,6 +51,7 @@ type SidebarView =
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Sidebar = ({ options }: { options?: ReactNode }) => {
|
export const Sidebar = ({ options }: { options?: ReactNode }) => {
|
||||||
|
const t = useT();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const navClasses = 'flex lg:flex-col items-center gap-2 lg:gap-4 p-1';
|
const navClasses = 'flex lg:flex-col items-center gap-2 lg:gap-4 p-1';
|
||||||
const setViewAsDialogOpen = useViewAsDialog((state) => state.setOpen);
|
const setViewAsDialogOpen = useViewAsDialog((state) => state.setOpen);
|
||||||
@ -150,6 +151,7 @@ export const SidebarDivider = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const SidebarContent = () => {
|
export const SidebarContent = () => {
|
||||||
|
const t = useT();
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
import { useDataGridEvents } from '@vegaprotocol/datagrid';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { StopOrdersManager } from '@vegaprotocol/orders';
|
import { StopOrdersManager } from '@vegaprotocol/orders';
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
@ -8,8 +7,10 @@ import { create } from 'zustand';
|
|||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
import type { DataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
import { createDataGridSlice } from '../../stores/datagrid-store-slice';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const StopOrdersContainer = () => {
|
export const StopOrdersContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey, isReadOnly } = useVegaWallet();
|
const { pubKey, isReadOnly } = useVegaWallet();
|
||||||
const onMarketClick = useMarketClickHandler(true);
|
const onMarketClick = useMarketClickHandler(true);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import {
|
|||||||
VegaIcon,
|
VegaIcon,
|
||||||
VegaIconNames,
|
VegaIconNames,
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
telemetryValue: string;
|
telemetryValue: string;
|
||||||
@ -15,6 +15,7 @@ export const TelemetryApproval = ({
|
|||||||
telemetryValue,
|
telemetryValue,
|
||||||
setTelemetryValue,
|
setTelemetryValue,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<div className="mr-4" role="form">
|
<div className="mr-4" role="form">
|
||||||
|
@ -3,12 +3,13 @@ import { Intent, useToasts } from '@vegaprotocol/ui-toolkit';
|
|||||||
import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval';
|
import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval';
|
||||||
import { useCallback, useEffect } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
import { TelemetryApproval } from './telemetry-approval';
|
import { TelemetryApproval } from './telemetry-approval';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useOnboardingStore } from '../welcome-dialog/use-get-onboarding-step';
|
import { useOnboardingStore } from '../welcome-dialog/use-get-onboarding-step';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
const TELEMETRY_APPROVAL_TOAST_ID = 'telemetry_toast_id';
|
const TELEMETRY_APPROVAL_TOAST_ID = 'telemetry_toast_id';
|
||||||
|
|
||||||
export const Telemetry = () => {
|
export const Telemetry = () => {
|
||||||
|
const t = useT();
|
||||||
const onboardingDissmissed = useOnboardingStore((store) => store.dismissed);
|
const onboardingDissmissed = useOnboardingStore((store) => store.dismissed);
|
||||||
const [telemetryValue, setTelemetryValue, isTelemetryNeeded, closeTelemetry] =
|
const [telemetryValue, setTelemetryValue, isTelemetryNeeded, closeTelemetry] =
|
||||||
useTelemetryApproval();
|
useTelemetryApproval();
|
||||||
@ -63,6 +64,7 @@ export const Telemetry = () => {
|
|||||||
hasToast,
|
hasToast,
|
||||||
onApprovalClose,
|
onApprovalClose,
|
||||||
setTelemetryApprovalAndClose,
|
setTelemetryApprovalAndClose,
|
||||||
|
t,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -2,7 +2,6 @@ import { useMemo, useState } from 'react';
|
|||||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||||
import { isBrowserWalletInstalled } from '@vegaprotocol/wallet';
|
import { isBrowserWalletInstalled } from '@vegaprotocol/wallet';
|
||||||
import { truncateByChars } from '@vegaprotocol/utils';
|
import { truncateByChars } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
VegaIcon,
|
VegaIcon,
|
||||||
VegaIconNames,
|
VegaIconNames,
|
||||||
@ -23,8 +22,10 @@ import { useCopyTimeout } from '@vegaprotocol/react-helpers';
|
|||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const VegaWalletConnectButton = () => {
|
export const VegaWalletConnectButton = () => {
|
||||||
|
const t = useT();
|
||||||
const [dropdownOpen, setDropdownOpen] = useState(false);
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
||||||
const openVegaWalletDialog = useVegaWalletDialogStore(
|
const openVegaWalletDialog = useVegaWalletDialogStore(
|
||||||
(store) => store.openVegaWalletDialog
|
(store) => store.openVegaWalletDialog
|
||||||
@ -129,6 +130,7 @@ export const VegaWalletConnectButton = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const KeypairItem = ({ pk, active }: { pk: PubKey; active: boolean }) => {
|
const KeypairItem = ({ pk, active }: { pk: PubKey; active: boolean }) => {
|
||||||
|
const t = useT();
|
||||||
const [copied, setCopied] = useCopyTimeout();
|
const [copied, setCopied] = useCopyTimeout();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useCopyTimeout } from '@vegaprotocol/react-helpers';
|
import { useCopyTimeout } from '@vegaprotocol/react-helpers';
|
||||||
import {
|
import {
|
||||||
TradingButton as Button,
|
TradingButton as Button,
|
||||||
@ -11,12 +10,14 @@ import { useCallback, useMemo } from 'react';
|
|||||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const VegaWalletMenu = ({
|
export const VegaWalletMenu = ({
|
||||||
setMenu,
|
setMenu,
|
||||||
}: {
|
}: {
|
||||||
setMenu: (open: 'nav' | 'wallet' | null) => void;
|
setMenu: (open: 'nav' | 'wallet' | null) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey, pubKeys, selectPubKey, disconnect } = useVegaWallet();
|
const { pubKey, pubKeys, selectPubKey, disconnect } = useVegaWallet();
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
const setViews = useSidebar((store) => store.setViews);
|
const setViews = useSidebar((store) => store.setViews);
|
||||||
@ -76,6 +77,7 @@ const KeypairListItem = ({
|
|||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
onSelectItem: (pk: string) => void;
|
onSelectItem: (pk: string) => void;
|
||||||
}) => {
|
}) => {
|
||||||
|
const t = useT();
|
||||||
const [copied, setCopied] = useCopyTimeout();
|
const [copied, setCopied] = useCopyTimeout();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
ExternalLink,
|
ExternalLink,
|
||||||
Intent,
|
Intent,
|
||||||
@ -18,12 +17,15 @@ import {
|
|||||||
import { Links, Routes } from '../../lib/links';
|
import { Links, Routes } from '../../lib/links';
|
||||||
import { useGlobalStore } from '../../stores';
|
import { useGlobalStore } from '../../stores';
|
||||||
import { useSidebar, ViewType } from '../sidebar';
|
import { useSidebar, ViewType } from '../sidebar';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
lead?: string;
|
lead?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GetStartedButton = ({ step }: { step: OnboardingStep }) => {
|
const GetStartedButton = ({ step }: { step: OnboardingStep }) => {
|
||||||
|
const t = useT();
|
||||||
const dismiss = useOnboardingStore((store) => store.dismiss);
|
const dismiss = useOnboardingStore((store) => store.dismiss);
|
||||||
const setDialogOpen = useOnboardingStore((store) => store.setDialogOpen);
|
const setDialogOpen = useOnboardingStore((store) => store.setDialogOpen);
|
||||||
const marketId = useGlobalStore((store) => store.marketId);
|
const marketId = useGlobalStore((store) => store.marketId);
|
||||||
@ -78,6 +80,7 @@ const GetStartedButton = ({ step }: { step: OnboardingStep }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const GetStartedCheckList = () => {
|
export const GetStartedCheckList = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const currentStep = useGetOnboardingStep();
|
const currentStep = useGetOnboardingStep();
|
||||||
return (
|
return (
|
||||||
@ -104,6 +107,7 @@ export const GetStartedCheckList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const GetStarted = ({ lead }: Props) => {
|
export const GetStarted = ({ lead }: Props) => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { VEGA_ENV, VEGA_NETWORKS } = useEnvironment();
|
const { VEGA_ENV, VEGA_NETWORKS } = useEnvironment();
|
||||||
const openVegaWalletDialog = useVegaWalletDialogStore(
|
const openVegaWalletDialog = useVegaWalletDialogStore(
|
||||||
@ -132,18 +136,26 @@ export const GetStarted = ({ lead }: Props) => {
|
|||||||
</div>
|
</div>
|
||||||
{VEGA_ENV === Networks.MAINNET && (
|
{VEGA_ENV === Networks.MAINNET && (
|
||||||
<p className="text-sm">
|
<p className="text-sm">
|
||||||
{t('Experiment for free with virtual assets on')}{' '}
|
<Trans
|
||||||
<ExternalLink href={VEGA_NETWORKS.TESTNET}>
|
defaults="Experiment for free with virtual assets on <0>Fairground Testnet</0>"
|
||||||
{t('Fairground Testnet')}
|
components={[
|
||||||
</ExternalLink>
|
<ExternalLink href={VEGA_NETWORKS.TESTNET} key="link">
|
||||||
|
Fairground Testnet
|
||||||
|
</ExternalLink>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{VEGA_ENV === Networks.TESTNET && (
|
{VEGA_ENV === Networks.TESTNET && (
|
||||||
<p className="text-sm">
|
<p className="text-sm">
|
||||||
{t('Ready to trade with real funds?')}{' '}
|
<Trans
|
||||||
<ExternalLink href={VEGA_NETWORKS.MAINNET}>
|
defaults="Ready to trade with real funds? <0>Switch to Mainnet</0>"
|
||||||
{t('Switch to Mainnet')}
|
components={[
|
||||||
</ExternalLink>
|
<ExternalLink href={VEGA_NETWORKS.MAINNET} key="link">
|
||||||
|
Switch to Mainnet
|
||||||
|
</ExternalLink>,
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -154,11 +166,14 @@ export const GetStarted = ({ lead }: Props) => {
|
|||||||
return (
|
return (
|
||||||
<div className={wrapperClasses}>
|
<div className={wrapperClasses}>
|
||||||
<p className="mb-1 text-sm">
|
<p className="mb-1 text-sm">
|
||||||
You need a{' '}
|
<Trans
|
||||||
<ExternalLink href="https://vega.xyz/wallet">
|
defaults="You need a <0>Vega wallet</0> to start trading in this market."
|
||||||
|
components={[
|
||||||
|
<ExternalLink href="https://vega.xyz/wallet" key="link">
|
||||||
Vega wallet
|
Vega wallet
|
||||||
</ExternalLink>{' '}
|
</ExternalLink>,
|
||||||
to start trading in this market.
|
]}
|
||||||
|
/>
|
||||||
</p>
|
</p>
|
||||||
<TradingButton
|
<TradingButton
|
||||||
onClick={openVegaWalletDialog}
|
onClick={openVegaWalletDialog}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
||||||
import take from 'lodash/take';
|
import take from 'lodash/take';
|
||||||
@ -12,8 +11,10 @@ import {
|
|||||||
TOKEN_PROPOSALS,
|
TOKEN_PROPOSALS,
|
||||||
useLinks,
|
useLinks,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const ProposedMarkets = () => {
|
export const ProposedMarkets = () => {
|
||||||
|
const t = useT();
|
||||||
const variables = useMemo(() => {
|
const variables = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
proposalType: Types.ProposalType.TYPE_NEW_MARKET,
|
proposalType: Types.ProposalType.TYPE_NEW_MARKET,
|
||||||
@ -75,6 +76,6 @@ export const ProposedMarkets = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
[newMarkets, tokenLink]
|
[newMarkets, tokenLink, t]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
import { VegaIcon, VegaIconNames } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
import { Trans } from 'react-i18next';
|
||||||
|
|
||||||
|
const DisclaimerLink = ({ children }: { children?: string[] }) => (
|
||||||
|
<Link className="underline" to={Links.DISCLAIMER()} target="_blank">
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<span>{children}</span>
|
||||||
|
<VegaIcon name={VegaIconNames.OPEN_EXTERNAL} />
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
|
||||||
export const RiskMessage = () => {
|
export const RiskMessage = () => {
|
||||||
|
const t = useT();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="p-6 mb-6 bg-vega-light-100 dark:bg-vega-dark-100">
|
<div className="p-6 mb-6 bg-vega-light-100 dark:bg-vega-dark-100">
|
||||||
@ -24,15 +35,10 @@ export const RiskMessage = () => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<p className="mb-8">
|
<p className="mb-8">
|
||||||
{t(
|
<Trans
|
||||||
'By using the Vega Console, you acknowledge that you have read and understood the'
|
defaults="By using the Vega Console, you acknowledge that you have read and understood the <0>Vega Console Disclaimer</0>"
|
||||||
)}{' '}
|
components={[<DisclaimerLink key="link" />]}
|
||||||
<Link className="underline" to={Links.DISCLAIMER()} target="_blank">
|
/>
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
<span>{t('Vega Console Disclaimer')}</span>
|
|
||||||
<VegaIcon name={VegaIconNames.OPEN_EXTERNAL} />
|
|
||||||
</span>
|
|
||||||
</Link>
|
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { GetStarted } from './get-started';
|
import { GetStarted } from './get-started';
|
||||||
import { TradingAnchorButton } from '@vegaprotocol/ui-toolkit';
|
import { TradingAnchorButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Links } from '../../lib/links';
|
import { Links } from '../../lib/links';
|
||||||
@ -6,8 +5,10 @@ import { Networks, useEnvironment } from '@vegaprotocol/environment';
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode } from 'react';
|
||||||
import { useTopTradedMarkets } from '../../lib/hooks/use-top-traded-markets';
|
import { useTopTradedMarkets } from '../../lib/hooks/use-top-traded-markets';
|
||||||
import { useOnboardingStore } from './use-get-onboarding-step';
|
import { useOnboardingStore } from './use-get-onboarding-step';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const WelcomeDialogContent = () => {
|
export const WelcomeDialogContent = () => {
|
||||||
|
const t = useT();
|
||||||
const { VEGA_ENV } = useEnvironment();
|
const { VEGA_ENV } = useEnvironment();
|
||||||
const setOnboardingDialog = useOnboardingStore(
|
const setOnboardingDialog = useOnboardingStore(
|
||||||
(store) => store.setDialogOpen
|
(store) => store.setDialogOpen
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import { Dialog, Intent } from '@vegaprotocol/ui-toolkit';
|
import { Dialog, Intent } from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { WelcomeDialogContent } from './welcome-dialog-content';
|
import { WelcomeDialogContent } from './welcome-dialog-content';
|
||||||
import { useOnboardingStore } from './use-get-onboarding-step';
|
import { useOnboardingStore } from './use-get-onboarding-step';
|
||||||
import { VegaConnectDialog } from '@vegaprotocol/wallet';
|
import { VegaConnectDialog } from '@vegaprotocol/wallet';
|
||||||
import { Connectors } from '../../lib/vega-connectors';
|
import { Connectors } from '../../lib/vega-connectors';
|
||||||
import { RiskMessage } from './risk-message';
|
import { RiskMessage } from './risk-message';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const WelcomeDialog = () => {
|
export const WelcomeDialog = () => {
|
||||||
|
const t = useT();
|
||||||
const { VEGA_ENV } = useEnvironment();
|
const { VEGA_ENV } = useEnvironment();
|
||||||
const dismissed = useOnboardingStore((store) => store.dismissed);
|
const dismissed = useOnboardingStore((store) => store.dismissed);
|
||||||
const dialogOpen = useOnboardingStore((store) => store.dialogOpen);
|
const dialogOpen = useOnboardingStore((store) => store.dialogOpen);
|
||||||
|
@ -5,10 +5,11 @@ import {
|
|||||||
useIncompleteWithdrawals,
|
useIncompleteWithdrawals,
|
||||||
} from '@vegaprotocol/withdraws';
|
} from '@vegaprotocol/withdraws';
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
import { useVegaWallet } from '@vegaprotocol/wallet';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const WithdrawalsContainer = () => {
|
export const WithdrawalsContainer = () => {
|
||||||
|
const t = useT();
|
||||||
const { pubKey } = useVegaWallet();
|
const { pubKey } = useVegaWallet();
|
||||||
const { data, error } = useDataProvider({
|
const { data, error } = useDataProvider({
|
||||||
dataProvider: withdrawalProvider,
|
dataProvider: withdrawalProvider,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
import { TradingButton } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ViewType, useSidebar } from '../sidebar';
|
import { ViewType, useSidebar } from '../sidebar';
|
||||||
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
import { useGetCurrentRouteId } from '../../lib/hooks/use-get-current-route-id';
|
||||||
|
import { useT } from '../../lib/use-t';
|
||||||
|
|
||||||
export const WithdrawalsMenu = () => {
|
export const WithdrawalsMenu = () => {
|
||||||
|
const t = useT();
|
||||||
const setViews = useSidebar((store) => store.setViews);
|
const setViews = useSidebar((store) => store.setViews);
|
||||||
const currentRouteId = useGetCurrentRouteId();
|
const currentRouteId = useGetCurrentRouteId();
|
||||||
return (
|
return (
|
||||||
|
@ -69,6 +69,7 @@ i18n
|
|||||||
'trading',
|
'trading',
|
||||||
],
|
],
|
||||||
defaultNS: 'trading',
|
defaultNS: 'trading',
|
||||||
|
nsSeparator: false,
|
||||||
keySeparator: false, // we use content as keys
|
keySeparator: false, // we use content as keys
|
||||||
backend,
|
backend,
|
||||||
debug: isInDev,
|
debug: isInDev,
|
||||||
|
3
apps/trading/lib/use-t.ts
Normal file
3
apps/trading/lib/use-t.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
export const ns = 'trading';
|
||||||
|
export const useT = () => useTranslation('trading').t;
|
@ -1,7 +1,6 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo, Suspense } from 'react';
|
||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import type { AppProps } from 'next/app';
|
import type { AppProps } from 'next/app';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import {
|
import {
|
||||||
useEnvTriggerMapping,
|
useEnvTriggerMapping,
|
||||||
Networks,
|
Networks,
|
||||||
@ -9,6 +8,7 @@ import {
|
|||||||
useEnvironment,
|
useEnvironment,
|
||||||
useInitializeEnv,
|
useInitializeEnv,
|
||||||
useNodeSwitcherStore,
|
useNodeSwitcherStore,
|
||||||
|
AppLoader,
|
||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import './styles.css';
|
import './styles.css';
|
||||||
import { usePageTitleStore } from '../stores';
|
import { usePageTitleStore } from '../stores';
|
||||||
@ -33,10 +33,11 @@ import { PartyActiveOrdersHandler } from './party-active-orders-handler';
|
|||||||
import { MaybeConnectEagerly } from './maybe-connect-eagerly';
|
import { MaybeConnectEagerly } from './maybe-connect-eagerly';
|
||||||
import { TransactionHandlers } from './transaction-handlers';
|
import { TransactionHandlers } from './transaction-handlers';
|
||||||
import '../lib/i18n';
|
import '../lib/i18n';
|
||||||
|
import { useT } from '../lib/use-t';
|
||||||
const DEFAULT_TITLE = t('Welcome to Vega trading!');
|
|
||||||
|
|
||||||
const Title = () => {
|
const Title = () => {
|
||||||
|
const t = useT();
|
||||||
|
const DEFAULT_TITLE = t('Welcome to Vega trading!');
|
||||||
const { pageTitle } = usePageTitleStore((store) => ({
|
const { pageTitle } = usePageTitleStore((store) => ({
|
||||||
pageTitle: store.pageTitle,
|
pageTitle: store.pageTitle,
|
||||||
}));
|
}));
|
||||||
@ -48,7 +49,7 @@ const Title = () => {
|
|||||||
if (!pageTitle) return DEFAULT_TITLE;
|
if (!pageTitle) return DEFAULT_TITLE;
|
||||||
if (networkName) return `${pageTitle} [${networkName}]`;
|
if (networkName) return `${pageTitle} [${networkName}]`;
|
||||||
return pageTitle;
|
return pageTitle;
|
||||||
}, [pageTitle, networkName]);
|
}, [pageTitle, networkName, DEFAULT_TITLE]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Head>
|
<Head>
|
||||||
@ -124,12 +125,14 @@ function VegaTradingApp(props: AppProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<Suspense fallback={<AppLoader />}>
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Bootstrapper>
|
<Bootstrapper>
|
||||||
<AppBody {...props} />
|
<AppBody {...props} />
|
||||||
</Bootstrapper>
|
</Bootstrapper>
|
||||||
<NodeSwitcherDialog open={nodeSwitcherOpen} setOpen={setNodeSwitcher} />
|
<NodeSwitcherDialog open={nodeSwitcherOpen} setOpen={setNodeSwitcher} />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
|
</Suspense>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import type { RouteObject } from 'react-router-dom';
|
import type { RouteObject } from 'react-router-dom';
|
||||||
import { Navigate, useRoutes } from 'react-router-dom';
|
import { Navigate, useRoutes } from 'react-router-dom';
|
||||||
import { lazy, Suspense } from 'react';
|
import { lazy, Suspense } from 'react';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
import { Loader, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { LayoutWithSidebar } from '../components/layouts';
|
import { LayoutWithSidebar } from '../components/layouts';
|
||||||
import { LayoutCentered } from '../components/layouts/layout-centered';
|
import { LayoutCentered } from '../components/layouts/layout-centered';
|
||||||
@ -29,17 +28,21 @@ import { MarketHeader } from '../components/market-header';
|
|||||||
import { PortfolioSidebar } from '../client-pages/portfolio/portfolio-sidebar';
|
import { PortfolioSidebar } from '../client-pages/portfolio/portfolio-sidebar';
|
||||||
import { LiquiditySidebar } from '../client-pages/liquidity/liquidity-sidebar';
|
import { LiquiditySidebar } from '../client-pages/liquidity/liquidity-sidebar';
|
||||||
import { MarketsSidebar } from '../client-pages/markets/markets-sidebar';
|
import { MarketsSidebar } from '../client-pages/markets/markets-sidebar';
|
||||||
|
import { useT } from '../lib/use-t';
|
||||||
|
|
||||||
// These must remain dynamically imported as pennant cannot be compiled by nextjs due to ESM
|
// These must remain dynamically imported as pennant cannot be compiled by nextjs due to ESM
|
||||||
// Using dynamic imports is a workaround for this until pennant is published as ESM
|
// Using dynamic imports is a workaround for this until pennant is published as ESM
|
||||||
const MarketPage = lazy(() => import('../client-pages/market'));
|
const MarketPage = lazy(() => import('../client-pages/market'));
|
||||||
const Portfolio = lazy(() => import('../client-pages/portfolio'));
|
const Portfolio = lazy(() => import('../client-pages/portfolio'));
|
||||||
|
|
||||||
const NotFound = () => (
|
const NotFound = () => {
|
||||||
|
const t = useT();
|
||||||
|
return (
|
||||||
<Splash>
|
<Splash>
|
||||||
<p>{t('Page not found')}</p>
|
<p>{t('Page not found')}</p>
|
||||||
</Splash>
|
</Splash>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const routerConfig: RouteObject[] = compact([
|
export const routerConfig: RouteObject[] = compact([
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,19 @@ import '@testing-library/jest-dom';
|
|||||||
import 'jest-canvas-mock';
|
import 'jest-canvas-mock';
|
||||||
import ResizeObserver from 'resize-observer-polyfill';
|
import ResizeObserver from 'resize-observer-polyfill';
|
||||||
import { defaultFallbackInView } from 'react-intersection-observer';
|
import { defaultFallbackInView } from 'react-intersection-observer';
|
||||||
|
import { locales } from '@vegaprotocol/i18n';
|
||||||
|
import i18n from 'i18next';
|
||||||
|
import { initReactI18next } from 'react-i18next';
|
||||||
|
|
||||||
|
// Set up i18n instance so that components have the correct default
|
||||||
|
// en translations
|
||||||
|
i18n.use(initReactI18next).init({
|
||||||
|
// we init with resources
|
||||||
|
resources: locales,
|
||||||
|
fallbackLng: 'en',
|
||||||
|
ns: ['trading'],
|
||||||
|
defaultNS: 'trading',
|
||||||
|
});
|
||||||
|
|
||||||
defaultFallbackInView(true);
|
defaultFallbackInView(true);
|
||||||
global.ResizeObserver = ResizeObserver;
|
global.ResizeObserver = ResizeObserver;
|
||||||
|
@ -55,8 +55,7 @@ export const CandlesMenu = () => {
|
|||||||
<TradingDropdownTrigger className={triggerClasses}>
|
<TradingDropdownTrigger className={triggerClasses}>
|
||||||
<TradingButton {...triggerButtonProps}>
|
<TradingButton {...triggerButtonProps}>
|
||||||
{t('Interval: {{interval}}', {
|
{t('Interval: {{interval}}', {
|
||||||
replace: { interval: intervalLabels[interval] },
|
interval: intervalLabels[interval],
|
||||||
nsSeparator: '|',
|
|
||||||
})}
|
})}
|
||||||
</TradingButton>
|
</TradingButton>
|
||||||
</TradingDropdownTrigger>
|
</TradingDropdownTrigger>
|
||||||
|
@ -64,11 +64,8 @@ export const useNodeHealth = () => {
|
|||||||
text = t(
|
text = t(
|
||||||
'Erroneous latency ( >{{errorLatency}} sec): {{blockUpdateLatency}} sec',
|
'Erroneous latency ( >{{errorLatency}} sec): {{blockUpdateLatency}} sec',
|
||||||
{
|
{
|
||||||
nsSeparator: '|',
|
|
||||||
replace: {
|
|
||||||
errorLatency: (ERROR_LATENCY / 1000).toString(),
|
errorLatency: (ERROR_LATENCY / 1000).toString(),
|
||||||
blockUpdateLatency: (blockUpdateMsLatency / 1000).toFixed(2),
|
blockUpdateLatency: (blockUpdateMsLatency / 1000).toFixed(2),
|
||||||
},
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
intent = Intent.Danger;
|
intent = Intent.Danger;
|
||||||
@ -82,11 +79,8 @@ export const useNodeHealth = () => {
|
|||||||
text = t(
|
text = t(
|
||||||
'Warning delay ( >{{warningLatency}} sec): {{blockUpdateLatency}} sec',
|
'Warning delay ( >{{warningLatency}} sec): {{blockUpdateLatency}} sec',
|
||||||
{
|
{
|
||||||
nsSeparator: '|',
|
|
||||||
replace: {
|
|
||||||
warningLatency: (WARNING_LATENCY / 1000).toString(),
|
warningLatency: (WARNING_LATENCY / 1000).toString(),
|
||||||
blockUpdateLatency: (blockUpdateMsLatency / 1000).toFixed(2),
|
blockUpdateLatency: (blockUpdateMsLatency / 1000).toFixed(2),
|
||||||
},
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
intent = Intent.Warning;
|
intent = Intent.Warning;
|
||||||
|
@ -1,9 +1,28 @@
|
|||||||
export * from './lib/i18n';
|
export * from './lib/i18n';
|
||||||
import en_accounts from './locales/en/accounts.json';
|
import en_accounts from './locales/en/accounts.json';
|
||||||
|
import en_assets from './locales/en/assets.json';
|
||||||
|
import en_candles_chart from './locales/en/candles-chart.json';
|
||||||
|
import en_datagrid from './locales/en/datagrid.json';
|
||||||
|
import en_deal_ticket from './locales/en/deal-ticket.json';
|
||||||
|
import en_deposits from './locales/en/deposits.json';
|
||||||
|
import en_environment from './locales/en/environment.json';
|
||||||
|
import en_fills from './locales/en/fills.json';
|
||||||
|
import en_funding_payments from './locales/en/funding-payments.json';
|
||||||
import en_governance from './locales/en/governance.json';
|
import en_governance from './locales/en/governance.json';
|
||||||
|
import en_trading from './locales/en/trading.json';
|
||||||
|
|
||||||
export const locales = {
|
export const locales = {
|
||||||
en: {
|
en: {
|
||||||
accounts: en_accounts,
|
accounts: en_accounts,
|
||||||
|
assets: en_assets,
|
||||||
|
'candles-chart': en_candles_chart,
|
||||||
|
datagrid: en_datagrid,
|
||||||
|
'deal-ticket': en_deal_ticket,
|
||||||
|
deposits: en_deposits,
|
||||||
|
environment: en_environment,
|
||||||
|
fills: en_fills,
|
||||||
|
'funding-payments': en_funding_payments,
|
||||||
governance: en_governance,
|
governance: en_governance,
|
||||||
|
trading: en_trading,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,297 @@
|
|||||||
{
|
{
|
||||||
"k": " "
|
"(Combined set volume {{runningVolume}} over last {{epochs}} epochs)": "(Combined set volume {{runningVolume}} over last {{epochs}} epochs)",
|
||||||
|
"(Created at: {{createdAt}})": "(Created at: {{createdAt}})",
|
||||||
|
"{{amount}} $VEGA staked": "{{amount}} $VEGA staked",
|
||||||
|
"{{checkedAssets}} Assets": "{{checkedAssets}} Assets",
|
||||||
|
"{{distance}} ago": "{{distance}} ago",
|
||||||
|
"{{instrumentCode}} liquidity provision": "{{instrumentCode}} liquidity provision",
|
||||||
|
"24h vol": "24h vol",
|
||||||
|
"24h volume": "24h volume",
|
||||||
|
"A percentage of commission earned by the referrer": "A percentage of commission earned by the referrer",
|
||||||
|
"A successors to this market has been proposed": "A successors to this market has been proposed",
|
||||||
|
"About the referral program": "About the referral program",
|
||||||
|
"Active": "Active",
|
||||||
|
"All": "All",
|
||||||
|
"An unknown error occurred.": "An unknown error occurred.",
|
||||||
|
"Anonymous": "Anonymous",
|
||||||
|
"Anyone with the referral link can apply it to their key(s) of choice via an on chain transaction": "Anyone with the referral link can apply it to their key(s) of choice via an on chain transaction",
|
||||||
|
"Asset (1)": "Asset (1)",
|
||||||
|
"Assets": "Assets",
|
||||||
|
"Base commission rate": "Base commission rate",
|
||||||
|
"Best bid": "Best bid",
|
||||||
|
"Best offer": "Best offer",
|
||||||
|
"Browse": "Browse",
|
||||||
|
"By using the Vega Console, you acknowledge that you have read and understood the <0>Vega Console Disclaimer</0>": "By using the Vega Console, you acknowledge that you have read and understood the <0>Vega Console Disclaimer</0>",
|
||||||
|
"Candles": "Candles",
|
||||||
|
"Change (24h)": "Change (24h)",
|
||||||
|
"Chart": "Chart",
|
||||||
|
"checkOutProposalsAndVote": "Check out the terms of the proposals and vote:",
|
||||||
|
"checkOutProposalsAndVote_one": "Check out the terms of the proposal and vote:",
|
||||||
|
"checkOutProposalsAndVote_other": "Check out the terms of the proposals and vote:",
|
||||||
|
"Close": "Close",
|
||||||
|
"Close menu": "Close menu",
|
||||||
|
"Closed": "Closed",
|
||||||
|
"Closed markets": "Closed markets",
|
||||||
|
"Code must be 64 characters in length": "Code must be 64 characters in length",
|
||||||
|
"Code must be be valid hex": "Code must be be valid hex",
|
||||||
|
"Collateral": "Collateral",
|
||||||
|
"Combined running notional over the {{count}} epochs": "Combined running notional over the {{count}} epochs",
|
||||||
|
"Combined volume (last {{count}} epochs)": "Combined volume (last {{count}} epochs)",
|
||||||
|
"Conduct your own due diligence and consult your financial advisor before making any investment decisions.": "Conduct your own due diligence and consult your financial advisor before making any investment decisions.",
|
||||||
|
"Confirm in wallet...": "Confirm in wallet...",
|
||||||
|
"Connect": "Connect",
|
||||||
|
"Connect wallet": "Connect wallet",
|
||||||
|
"Connected node": "Connected node",
|
||||||
|
"Console": "Console",
|
||||||
|
"Continue sharing data": "Continue sharing data",
|
||||||
|
"Copied": "Copied",
|
||||||
|
"Copy": "Copy",
|
||||||
|
"Copy Market ID": "Copy Market ID",
|
||||||
|
"Could not configure web3 provider": "Could not configure web3 provider",
|
||||||
|
"Could not initialize app": "Could not initialize app",
|
||||||
|
"Countdown": "Countdown",
|
||||||
|
"Create a referral code": "Create a referral code",
|
||||||
|
"Current tier": "Current tier",
|
||||||
|
"Dark mode": "Dark mode",
|
||||||
|
"Date Joined": "Date Joined",
|
||||||
|
"Deposit": "Deposit",
|
||||||
|
"Deposit funds": "Deposit funds",
|
||||||
|
"Depth": "Depth",
|
||||||
|
"Description": "Description",
|
||||||
|
"Disclaimer": "Disclaimer",
|
||||||
|
"DISCLAIMER_P1": "Vega is a decentralised peer-to-peer protocol that can be used to trade derivatives with cryptoassets. The Vega Protocol is an implementation layer (layer one) protocol made of free, public, open-source or source-available software. Use of the Vega Protocol involves various risks, including but not limited to, losses while digital assets are supplied to the Vega Protocol and losses due to the fluctuation of prices of assets.",
|
||||||
|
"DISCLAIMER_P2": "Before using the Vega Protocol, review the relevant documentation at docs.vega.xyz to make sure that you understand how it works. Conduct your own due diligence and consult your financial advisor before making any investment decisions.",
|
||||||
|
"DISCLAIMER_P3": "As described in the Vega Protocol core license, the Vega Protocol is provided “as is”, at your own risk, and without warranties of any kind. Although Gobalsky Labs Limited developed much of the initial code for the Vega Protocol, it does not provide or control the Vega Protocol, which is run by third parties deploying it on a bespoke blockchain. Upgrades and modifications to the Vega Protocol are managed in a community-driven way by holders of the VEGA governance token.",
|
||||||
|
"DISCLAIMER_P4": "No developer or entity involved in creating the Vega Protocol will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the Vega Protocol, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or legal costs, or loss of profits, cryptoassets, tokens or anything else of value.",
|
||||||
|
"DISCLAIMER_P5": "This website is hosted on a decentralised network, the Interplanetary File System (“IPFS”). The IPFS decentralised web is made up of all the computers (nodes) connected to it. Data is therefore stored on many different computers.",
|
||||||
|
"DISCLAIMER_P6": "The information provided on this website does not constitute investment advice, financial advice, trading advice, or any other sort of advice and you should not treat any of the website's content as such. No party recommends that any cryptoasset should be bought, sold, or held by you via this website. No party ensures the accuracy of information listed on this website or holds any responsibility for any missing or wrong information. You understand that you are using any and all information available here at your own risk.",
|
||||||
|
"DISCLAIMER_P7": "Additionally, just as you can access email protocols such as SMTP through multiple email clients, you can potentially access the Vega Protocol through many web or mobile interfaces. You are responsible for doing your own diligence on those interfaces to understand the associated risks and any fees.",
|
||||||
|
"Disconnect": "Disconnect",
|
||||||
|
"Discount": "Discount",
|
||||||
|
"Discounts are applied automatically during trading based on the key(s) used": "Discounts are applied automatically during trading based on the key(s) used",
|
||||||
|
"Docs": "Docs",
|
||||||
|
"Earn commission & stake rewards": "Earn commission & stake rewards",
|
||||||
|
"Enactment date reached and usual auction exit checks pass": "Enactment date reached and usual auction exit checks pass",
|
||||||
|
"Environment not configured": "Environment not configured",
|
||||||
|
"epochs in referral set": "epochs in referral set",
|
||||||
|
"Epochs in set": "Epochs in set",
|
||||||
|
"Epochs to next tier": "Epochs to next tier",
|
||||||
|
"Expected {{distance}} ago": "Expected {{distance}} ago",
|
||||||
|
"Expected in {{distance}}": "Expected in {{distance}}",
|
||||||
|
"Experiment for free with virtual assets on <0>Fairground Testnet</0>": "Experiment for free with virtual assets on <0>Fairground Testnet</0>",
|
||||||
|
"Expiry": "Expiry",
|
||||||
|
"Explore": "Explore",
|
||||||
|
"Fees": "Fees",
|
||||||
|
"Fees paid": "Fees paid",
|
||||||
|
"Fees work like a CEX with no per-transaction gas for orders": "Fees work like a CEX with no per-transaction gas for orders",
|
||||||
|
"Fills": "Fills",
|
||||||
|
"Final commission rate": "Final commission rate",
|
||||||
|
"Find out more": "Find out more",
|
||||||
|
"Free from the risks of real trading, Fairground is a safe and fun place to try out Vega yourself with virtual assets.": "Free from the risks of real trading, Fairground is a safe and fun place to try out Vega yourself with virtual assets.",
|
||||||
|
"Fully decentralised high performance peer-to-network trading.": "Fully decentralised high performance peer-to-network trading.",
|
||||||
|
"Funding": "Funding",
|
||||||
|
"Funding history": "Funding history",
|
||||||
|
"Funding payments": "Funding payments",
|
||||||
|
"Funding Payments": "Funding Payments",
|
||||||
|
"Funding Rate": "Funding Rate",
|
||||||
|
"Funding rate": "Funding rate",
|
||||||
|
"Futures": "Futures",
|
||||||
|
"Generate a referral code to share with your friends and start earning commission.": "Generate a referral code to share with your friends and start earning commission.",
|
||||||
|
"Generate code": "Generate code",
|
||||||
|
"Get started": "Get started",
|
||||||
|
"Give Feedback": "Give Feedback",
|
||||||
|
"Go back and try again": "Go back and try again",
|
||||||
|
"Governance": "Governance",
|
||||||
|
"Governance vote for this market has been rejected": "Governance vote for this market has been rejected",
|
||||||
|
"Governance vote for this market is valid and has been accepted": "Governance vote for this market is valid and has been accepted",
|
||||||
|
"Governance vote has passed and market is awaiting opening auction exit": "Governance vote has passed and market is awaiting opening auction exit",
|
||||||
|
"Governance vote passed to close the market": "Governance vote passed to close the market",
|
||||||
|
"Help identify bugs and improve the service by sharing anonymous usage data.": "Help identify bugs and improve the service by sharing anonymous usage data.",
|
||||||
|
"Help us identify bugs and improve Vega Governance by sharing anonymous usage data.": "Help us identify bugs and improve Vega Governance by sharing anonymous usage data.",
|
||||||
|
"Hide closed markets": "Hide closed markets",
|
||||||
|
"How it works": "How it works",
|
||||||
|
"I want a code": "I want a code",
|
||||||
|
"Improve vega console": "Improve vega console",
|
||||||
|
"Inactive": "Inactive",
|
||||||
|
"Index Price": "Index Price",
|
||||||
|
"Infrastructure": "Infrastructure",
|
||||||
|
"Invite friends and earn rewards from the trading fees they pay. Stake those rewards to earn multipliers on future rewards.": "Invite friends and earn rewards from the trading fees they pay. Stake those rewards to earn multipliers on future rewards.",
|
||||||
|
"Learn about providing liquidity": "Learn about providing liquidity",
|
||||||
|
"Learn more": "Learn more",
|
||||||
|
"Ledger entries": "Ledger entries",
|
||||||
|
"Liquidity": "Liquidity",
|
||||||
|
"Liquidity fees": "Liquidity fees",
|
||||||
|
"Liquidity supplied": "Liquidity supplied",
|
||||||
|
"Low fees and no cost to place orders": "Low fees and no cost to place orders",
|
||||||
|
"Mainnet status & incidents": "Mainnet status & incidents",
|
||||||
|
"Make withdrawal": "Make withdrawal",
|
||||||
|
"Maker": "Maker",
|
||||||
|
"Mark Price": "Mark Price",
|
||||||
|
"Mark price": "Mark price",
|
||||||
|
"Market": "Market",
|
||||||
|
"Market ID": "Market ID",
|
||||||
|
"Market specification": "Market specification",
|
||||||
|
"Market triggers cancellation or governance vote has passed to cancel": "Market triggers cancellation or governance vote has passed to cancel",
|
||||||
|
"Markets": "Markets",
|
||||||
|
"Menu": "Menu",
|
||||||
|
"Min. epochs": "Min. epochs",
|
||||||
|
"Min. trading volume": "Min. trading volume",
|
||||||
|
"Min. trading volume (last {{count}} epochs)": "Min. trading volume (last {{count}} epochs)",
|
||||||
|
"My current volume": "My current volume",
|
||||||
|
"My liquidity provision": "My liquidity provision",
|
||||||
|
"My trading fees": "My trading fees",
|
||||||
|
"My volume (last {{count}} epochs)": "My volume (last {{count}} epochs)",
|
||||||
|
"Name": "Name",
|
||||||
|
"No closed orders": "No closed orders",
|
||||||
|
"No data": "No data",
|
||||||
|
"No deposits": "No deposits",
|
||||||
|
"No funding history data": "No funding history data",
|
||||||
|
"No future markets.": "No future markets.",
|
||||||
|
"No ledger entries to export": "No ledger entries to export",
|
||||||
|
"No market": "No market",
|
||||||
|
"No markets": "No markets",
|
||||||
|
"No markets.": "No markets.",
|
||||||
|
"No open orders": "No open orders",
|
||||||
|
"No orders": "No orders",
|
||||||
|
"No party accepts any liability for any losses whatsoever.": "No party accepts any liability for any losses whatsoever.",
|
||||||
|
"No perpetual markets.": "No perpetual markets.",
|
||||||
|
"No referral program active": "No referral program active",
|
||||||
|
"No rejected orders": "No rejected orders",
|
||||||
|
"No thanks": "No thanks",
|
||||||
|
"No third party has access to your funds.": "No third party has access to your funds.",
|
||||||
|
"No volume discount program active": "No volume discount program active",
|
||||||
|
"No withdrawals": "No withdrawals",
|
||||||
|
"Node: {{VEGA_URL}} is unsuitable": "Node: {{VEGA_URL}} is unsuitable",
|
||||||
|
"Non-custodial and pseudonymous": "Non-custodial and pseudonymous",
|
||||||
|
"None": "None",
|
||||||
|
"Number of traders": "Number of traders",
|
||||||
|
"Open": "Open",
|
||||||
|
"Open a position": "Open a position",
|
||||||
|
"Open markets": "Open markets",
|
||||||
|
"Optional": "Optional",
|
||||||
|
"Order": "Order",
|
||||||
|
"Orderbook": "Orderbook",
|
||||||
|
"Orders": "Orders",
|
||||||
|
"Page not found": "Page not found",
|
||||||
|
"Parent of a market": "Parent of a market",
|
||||||
|
"Past {{count}} epochs": "Past {{count}} epochs",
|
||||||
|
"Perpetuals": "Perpetuals",
|
||||||
|
"Please choose another market from the <0>market list<0>": "Please choose another market from the <0>market list<0>",
|
||||||
|
"Please connect Vega wallet": "Please connect Vega wallet",
|
||||||
|
"Portfolio": "Portfolio",
|
||||||
|
"Positions": "Positions",
|
||||||
|
"Price": "Price",
|
||||||
|
"PRNT": "PRNT",
|
||||||
|
"Program ends:": "Program ends:",
|
||||||
|
"Propose a new market": "Propose a new market",
|
||||||
|
"Proposed final price is {{price}} {{assetSymbol}}.": "Proposed final price is {{price}} {{assetSymbol}}.",
|
||||||
|
"Proposed markets": "Proposed markets",
|
||||||
|
"Providing liquidity": "Providing liquidity",
|
||||||
|
"Purpose built proof of stake blockchain": "Purpose built proof of stake blockchain",
|
||||||
|
"qUSD": "qUSD",
|
||||||
|
"qUSD provides a rough USD equivalent of balances across all assets using the value of \"Quantum\" for that asset": "qUSD provides a rough USD equivalent of balances across all assets using the value of \"Quantum\" for that asset",
|
||||||
|
"Read the terms": "Read the terms",
|
||||||
|
"Ready to trade": "Ready to trade",
|
||||||
|
"Ready to trade with real funds? <0>Switch to Mainnet</0>": "Ready to trade with real funds? <0>Switch to Mainnet</0>",
|
||||||
|
"Referral benefits": "Referral benefits",
|
||||||
|
"Referral discount": "Referral discount",
|
||||||
|
"referral-statistics-commission": "Commission earned in <0>qUSD</0> (last {{count}} epochs)",
|
||||||
|
"Referrals": "Referrals",
|
||||||
|
"Referrer commission": "Referrer commission",
|
||||||
|
"Referrer trading discount": "Referrer trading discount",
|
||||||
|
"Referrers earn commission based on a percentage of the taker fees their referees pay": "Referrers earn commission based on a percentage of the taker fees their referees pay",
|
||||||
|
"Referrers generate a code assigned to their key via an on chain transaction": "Referrers generate a code assigned to their key via an on chain transaction",
|
||||||
|
"Rejected": "Rejected",
|
||||||
|
"Required epochs": "Required epochs",
|
||||||
|
"Required for next tier": "Required for next tier",
|
||||||
|
"Resources": "Resources",
|
||||||
|
"SCCR": "SCCR",
|
||||||
|
"Search": "Search",
|
||||||
|
"See all markets": "See all markets",
|
||||||
|
"Select market": "Select market",
|
||||||
|
"Settings": "Settings",
|
||||||
|
"Settlement asset": "Settlement asset",
|
||||||
|
"Settlement date": "Settlement date",
|
||||||
|
"Settlement defined by product has been triggered and completed": "Settlement defined by product has been triggered and completed",
|
||||||
|
"Settlement price": "Settlement price",
|
||||||
|
"Share data": "Share data",
|
||||||
|
"Share usage data": "Share usage data",
|
||||||
|
"Show closed markets": "Show closed markets",
|
||||||
|
"Something went wrong": "Something went wrong",
|
||||||
|
"Spot": "Spot",
|
||||||
|
"Spot markets coming soon.": "Spot markets coming soon.",
|
||||||
|
"Spread": "Spread",
|
||||||
|
"Stake a minimum of {{minimumStakedTokens}} $VEGA tokens": "Stake a minimum of {{minimumStakedTokens}} $VEGA tokens",
|
||||||
|
"Stake some $VEGA now": "Stake some $VEGA now",
|
||||||
|
"Staking multiplier": "Staking multiplier",
|
||||||
|
"Start trading": "Start trading",
|
||||||
|
"Start trading on the worlds most advanced decentralised exchange.": "Start trading on the worlds most advanced decentralised exchange.",
|
||||||
|
"Status": "Status",
|
||||||
|
"Stop": "Stop",
|
||||||
|
"Stop orders": "Stop orders",
|
||||||
|
"Successor of a market": "Successor of a market",
|
||||||
|
"Successors to this market have been proposed": "Successors to this market have been proposed",
|
||||||
|
"Supplied stake": "Supplied stake",
|
||||||
|
"Suspended due to price or liquidity monitoring trigger": "Suspended due to price or liquidity monitoring trigger",
|
||||||
|
"Target stake": "Target stake",
|
||||||
|
"The amount of fees paid to liquidity providers across the whole market during the last epoch {{epoch}}.": "The amount of fees paid to liquidity providers across the whole market during the last epoch {{epoch}}.",
|
||||||
|
"The commission is taken from the infrastructure fee, maker fee, and liquidity provider fee, not from the referee": "The commission is taken from the infrastructure fee, maker fee, and liquidity provider fee, not from the referee",
|
||||||
|
"The external time weighted average price (TWAP) received from the data source defined in the data sourcing specification.": "The external time weighted average price (TWAP) received from the data source defined in the data sourcing specification.",
|
||||||
|
"The final price will be {{price}} {{assetSymbol}}.": "The final price will be {{price}} {{assetSymbol}}.",
|
||||||
|
"The market has sufficient liquidity but there are not enough priced limit orders in the order book, which are required to deploy liquidity commitment pegged orders.": "The market has sufficient liquidity but there are not enough priced limit orders in the order book, which are required to deploy liquidity commitment pegged orders.",
|
||||||
|
"The page you're looking for doesn't exists.": "The page you're looking for doesn't exists.",
|
||||||
|
"The successor market <0>{{instrumentName}}</0> has a 24h trading volume of {{successorVolume}}": "The successor market <0>{{instrumentName}}</0> has a 24h trading volume of {{successorVolume}}",
|
||||||
|
"The successor market is <0>{{instrumentName}}</0>": "The successor market is <0>{{instrumentName}}</0>",
|
||||||
|
"The transaction could not be sent": "The transaction could not be sent",
|
||||||
|
"This market expires in {{duration}}.": "This market expires in {{duration}}.",
|
||||||
|
"This market expires when triggered by its oracle, not on a set date.": "This market expires when triggered by its oracle, not on a set date.",
|
||||||
|
"This market has been settled": "This market has been settled",
|
||||||
|
"This market has been succeeded": "This market has been succeeded",
|
||||||
|
"This market has been suspended via a governance vote and can be resumed or terminated by further votes.": "This market has been suspended via a governance vote and can be resumed or terminated by further votes.",
|
||||||
|
"This market URL is not available any more.": "This market URL is not available any more.",
|
||||||
|
"This timestamp is user curated metadata and does not drive any on-chain functionality.": "This timestamp is user curated metadata and does not drive any on-chain functionality.",
|
||||||
|
"Tier": "Tier",
|
||||||
|
"Toast location": "Toast location",
|
||||||
|
"Total commission (last {{count}}} epochs)": "Total commission (last {{count}}} epochs)",
|
||||||
|
"Total discount": "Total discount",
|
||||||
|
"Total fee after discount": "Total fee after discount",
|
||||||
|
"Total fee before discount": "Total fee before discount",
|
||||||
|
"Trader": "Trader",
|
||||||
|
"Trades": "Trades",
|
||||||
|
"Trading": "Trading",
|
||||||
|
"Trading has been terminated as a result of the product definition": "Trading has been terminated as a result of the product definition",
|
||||||
|
"Trading mode": "Trading mode",
|
||||||
|
"Trading on Market {{name}} may stop on {{date}}. There is open proposal to close this market.": "Trading on Market {{name}} may stop on {{date}}. There is open proposal to close this market.",
|
||||||
|
"Trading on Market {{name}} may stop. There are open proposals to close this market": "Trading on Market {{name}} may stop. There are open proposals to close this market",
|
||||||
|
"Trading on Market {{name}} will stop on {{date}}": "Trading on Market {{name}} will stop on {{date}}",
|
||||||
|
"Transfer": "Transfer",
|
||||||
|
"Unknown": "Unknown",
|
||||||
|
"Unknown settlement date": "Unknown settlement date",
|
||||||
|
"View as party": "View as party",
|
||||||
|
"View liquidity provision table": "View liquidity provision table",
|
||||||
|
"View on Explorer": "View on Explorer",
|
||||||
|
"View oracle specification": "View oracle specification",
|
||||||
|
"View parent market": "View parent market",
|
||||||
|
"View proposals": "View proposals",
|
||||||
|
"View settlement asset details": "View settlement asset details",
|
||||||
|
"View successor market": "View successor market",
|
||||||
|
"Volume": "Volume",
|
||||||
|
"Volume (24h)": "Volume (24h)",
|
||||||
|
"Volume (last {{count}} epochs)": "Volume (last {{count}} epochs)",
|
||||||
|
"Volume discount": "Volume discount",
|
||||||
|
"Volume to next tier": "Volume to next tier",
|
||||||
|
"Wallet": "Wallet",
|
||||||
|
"We're sorry but we don't have an active referral programme currently running. You can propose a new programme <0>here</0>.": "We're sorry but we don't have an active referral programme currently running. You can propose a new programme <0>here</0>.",
|
||||||
|
"Welcome to Vega trading!": "Welcome to Vega trading!",
|
||||||
|
"Withdraw": "Withdraw",
|
||||||
|
"You can opt out any time via settings": "You can opt out any time via settings",
|
||||||
|
"You may encounter bugs, loss of functionality or loss of assets.": "You may encounter bugs, loss of functionality or loss of assets.",
|
||||||
|
"You must be connected to the Vega wallet.": "You must be connected to the Vega wallet.",
|
||||||
|
"You need a <0>Vega wallet</0> to start trading in this market.": "You need a <0>Vega wallet</0> to start trading in this market.",
|
||||||
|
"You need at least {{requiredStake}} VEGA staked to generate a referral code and participate in the referral program.": "You need at least {{requiredStake}} VEGA staked to generate a referral code and participate in the referral program.",
|
||||||
|
"You will no longer be able to hold a position on this market when it closes in {{duration}}.": "You will no longer be able to hold a position on this market when it closes in {{duration}}.",
|
||||||
|
"Your code has been rejected": "Your code has been rejected",
|
||||||
|
"Your identity is always anonymous on Vega": "Your identity is always anonymous on Vega",
|
||||||
|
"Your referral code": "Your referral code",
|
||||||
|
"Your tier": "Your tier"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user