-
+
{bannerMessage}
diff --git a/apps/token/src/components/app-footer/app-footer.tsx b/apps/token/src/components/app-footer/app-footer.tsx
index 80d0e7469..3618b77c6 100644
--- a/apps/token/src/components/app-footer/app-footer.tsx
+++ b/apps/token/src/components/app-footer/app-footer.tsx
@@ -1,3 +1,4 @@
+import { Link } from '@vegaprotocol/ui-toolkit';
import { Trans } from 'react-i18next';
import { Links } from '../../config';
@@ -13,8 +14,12 @@ export const AppFooter = () => {
i18nKey="footerLinksText"
components={{
/* eslint-disable */
- feedbackLink: ,
- githubLink: ,
+ feedbackLink: (
+
+ ),
+ githubLink: (
+
+ ),
/* eslint-enable */
}}
/>
diff --git a/apps/token/src/components/balance-manager/balance-manager.tsx b/apps/token/src/components/balance-manager/balance-manager.tsx
index 4f7e57dee..69ebe1964 100644
--- a/apps/token/src/components/balance-manager/balance-manager.tsx
+++ b/apps/token/src/components/balance-manager/balance-manager.tsx
@@ -1,8 +1,9 @@
import * as Sentry from '@sentry/react';
+import { toBigNum } from '@vegaprotocol/react-helpers';
+import { useEthereumConfig } from '@vegaprotocol/web3';
import { useWeb3React } from '@web3-react/core';
import React from 'react';
-import { useEnvironment } from '@vegaprotocol/react-helpers';
import {
AppStateActionType,
useAppState,
@@ -10,17 +11,19 @@ import {
import { useContracts } from '../../contexts/contracts/contracts-context';
import { useGetAssociationBreakdown } from '../../hooks/use-get-association-breakdown';
import { useGetUserTrancheBalances } from '../../hooks/use-get-user-tranche-balances';
-import { BigNumber } from '../../lib/bignumber';
interface BalanceManagerProps {
children: React.ReactElement;
}
export const BalanceManager = ({ children }: BalanceManagerProps) => {
- const { ADDRESSES } = useEnvironment();
const contracts = useContracts();
const { account } = useWeb3React();
- const { appDispatch } = useAppState();
+ const {
+ appState: { decimals },
+ appDispatch,
+ } = useAppState();
+ const { config } = useEthereumConfig();
const getUserTrancheBalances = useGetUserTrancheBalances(
account || '',
@@ -35,17 +38,26 @@ export const BalanceManager = ({ children }: BalanceManagerProps) => {
// update balances on connect to Ethereum
React.useEffect(() => {
const updateBalances = async () => {
- if (!account) return;
+ if (!account || !config) return;
try {
- const [balance, walletBalance, lien, allowance] = await Promise.all([
- contracts.vesting.getUserBalanceAllTranches(account),
+ const [b, w, stats, a] = await Promise.all([
+ contracts.vesting.userTotalAllTranches(account),
contracts.token.balanceOf(account),
- contracts.vesting.getLien(account),
- contracts.token.allowance(account, ADDRESSES.stakingBridge),
+ contracts.vesting.userStats(account),
+ contracts.token.allowance(
+ account,
+ config.staking_bridge_contract.address
+ ),
]);
+
+ const balance = toBigNum(b, decimals);
+ const walletBalance = toBigNum(w, decimals);
+ const lien = toBigNum(stats.lien, decimals);
+ const allowance = toBigNum(a, decimals);
+
appDispatch({
type: AppStateActionType.UPDATE_ACCOUNT_BALANCES,
- balance: new BigNumber(balance),
+ balance,
walletBalance,
lien,
allowance,
@@ -57,11 +69,12 @@ export const BalanceManager = ({ children }: BalanceManagerProps) => {
updateBalances();
}, [
+ decimals,
appDispatch,
contracts?.token,
contracts?.vesting,
account,
- ADDRESSES.stakingBridge,
+ config,
]);
// This use effect hook is very expensive and is kept separate to prevent expensive reloading of data.
diff --git a/apps/token/src/components/bullet-header/bullet-header.tsx b/apps/token/src/components/bullet-header/bullet-header.tsx
index eed46c796..9f76c2bb4 100644
--- a/apps/token/src/components/bullet-header/bullet-header.tsx
+++ b/apps/token/src/components/bullet-header/bullet-header.tsx
@@ -9,7 +9,7 @@ interface BulletHeaderProps {
export const BulletHeader = ({ tag, children, style }: BulletHeaderProps) => {
return React.createElement(
tag,
- { className: 'mt-24 pt-8 pb-20 uppercase', style },
+ { className: 'mt-24 pt-8 pb-20 uppercase text-white', style },
<>
{children}
diff --git a/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx b/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx
deleted file mode 100644
index 943c40bdf..000000000
--- a/apps/token/src/components/eth-wallet-container/eth-wallet-container.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { useWeb3React } from '@web3-react/core';
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-
-import {
- AppStateActionType,
- useAppState,
-} from '../../contexts/app-state/app-state-context';
-import { Ethereum } from '../icons';
-import { Button } from '@vegaprotocol/ui-toolkit';
-
-interface EthWalletContainerProps {
- children: (address: string) => React.ReactElement;
-}
-
-export const EthWalletContainer = ({ children }: EthWalletContainerProps) => {
- const { t } = useTranslation();
- const { appDispatch } = useAppState();
- const { account } = useWeb3React();
-
- if (!account) {
- return (
-
- );
- }
-
- return children(account);
-};
diff --git a/apps/token/src/components/eth-wallet-container/index.ts b/apps/token/src/components/eth-wallet-container/index.ts
deleted file mode 100644
index 669004a23..000000000
--- a/apps/token/src/components/eth-wallet-container/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './eth-wallet-container';
diff --git a/apps/token/src/components/eth-wallet/eth-wallet.tsx b/apps/token/src/components/eth-wallet/eth-wallet.tsx
index 2605b374c..014ec8f91 100644
--- a/apps/token/src/components/eth-wallet/eth-wallet.tsx
+++ b/apps/token/src/components/eth-wallet/eth-wallet.tsx
@@ -22,7 +22,7 @@ import {
WalletCardHeader,
WalletCardRow,
} from '../wallet-card';
-import { Button, Loader } from '@vegaprotocol/ui-toolkit';
+import { Loader } from '@vegaprotocol/ui-toolkit';
import { theme } from '@vegaprotocol/tailwindcss-config';
const Colors = theme.colors;
@@ -163,15 +163,15 @@ const ConnectedKey = () => {
/>
)}
-
-
+
-
-
+
>
@@ -187,14 +187,14 @@ export const EthWallet = () => {
return (
- {t('ethereumKey')}
+ {t('ethereumKey')}
{account && (
-
-
{truncateMiddle(account)}
+
+
{truncateMiddle(account)}
{pendingTxs && (
-
+
)}
@@ -215,8 +215,8 @@ export const EthWallet = () => {
{account ? (
) : (
-
+
)}
{account && (
diff --git a/apps/token/src/components/graphql-provider/graphql-provider.tsx b/apps/token/src/components/graphql-provider/graphql-provider.tsx
deleted file mode 100644
index 7a4a34995..000000000
--- a/apps/token/src/components/graphql-provider/graphql-provider.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { ApolloProvider } from '@apollo/client';
-import React from 'react';
-
-import { client } from '../../lib/apollo-client';
-
-export const GraphQlProvider = ({
- children,
-}: {
- children: React.ReactNode;
-}) => {
- return {children};
-};
diff --git a/apps/token/src/components/graphql-provider/index.ts b/apps/token/src/components/graphql-provider/index.ts
deleted file mode 100644
index eb5712fd1..000000000
--- a/apps/token/src/components/graphql-provider/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './graphql-provider';
diff --git a/apps/token/src/components/heading/heading.tsx b/apps/token/src/components/heading/heading.tsx
index 31c843164..4c5b91950 100644
--- a/apps/token/src/components/heading/heading.tsx
+++ b/apps/token/src/components/heading/heading.tsx
@@ -7,7 +7,7 @@ export const Heading = ({ title }: HeadingProps) => {
return (
diff --git a/apps/token/src/components/loader/index.ts b/apps/token/src/components/loader/index.ts
deleted file mode 100644
index 3f3b9e663..000000000
--- a/apps/token/src/components/loader/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './loader';
diff --git a/apps/token/src/components/loader/loader.tsx b/apps/token/src/components/loader/loader.tsx
deleted file mode 100644
index b5d53d40c..000000000
--- a/apps/token/src/components/loader/loader.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from 'react';
-
-interface LoaderProps {
- invert?: boolean;
-}
-
-export const Loader = ({ invert = false }: LoaderProps) => {
- const [, forceRender] = React.useState(false);
-
- React.useEffect(() => {
- const interval = setInterval(() => {
- forceRender((x) => !x);
- }, 100);
-
- return () => clearInterval(interval);
- }, []);
-
- return (
-
- {new Array(9).fill(null).map((_, i) => {
- return (
- 0.5 ? 1 : 0,
- }}
- className={`block w-5 h-5 opacity-0 ${
- invert ? 'bg-black' : 'bg-white'
- }`}
- />
- );
- })}
-
- );
-};
diff --git a/apps/token/src/components/locked-progress/locked-progress.tsx b/apps/token/src/components/locked-progress/locked-progress.tsx
index caa264ab5..3c12cb031 100644
--- a/apps/token/src/components/locked-progress/locked-progress.tsx
+++ b/apps/token/src/components/locked-progress/locked-progress.tsx
@@ -15,7 +15,7 @@ const ProgressContents = ({
}) => (
{children}
@@ -72,7 +72,7 @@ export const LockedProgress = ({
unlocked,
leftLabel,
rightLabel,
- leftColor = Colors.pink,
+ leftColor = Colors.vega.pink,
rightColor = Colors.green.DEFAULT,
light = false,
}: LockedProgressProps) => {
diff --git a/apps/token/src/components/nav/nav.tsx b/apps/token/src/components/nav/nav.tsx
index 99e82c981..dda04475e 100644
--- a/apps/token/src/components/nav/nav.tsx
+++ b/apps/token/src/components/nav/nav.tsx
@@ -5,14 +5,13 @@ import debounce from 'lodash/debounce';
import React from 'react';
import * as Dialog from '@radix-ui/react-dialog';
import { useTranslation } from 'react-i18next';
-import { Link, NavLink } from 'react-router-dom';
+import { NavLink } from 'react-router-dom';
import { Flags } from '../../config';
import {
AppStateActionType,
useAppState,
} from '../../contexts/app-state/app-state-context';
-import vegaWhite from '../../images/vega_white.png';
import { Routes } from '../../routes/router-config';
import { EthWallet } from '../eth-wallet';
import { VegaWallet } from '../vega-wallet';
@@ -36,14 +35,14 @@ export const Nav = () => {
return (
{isDesktop &&
}
-
+
{!isDesktop &&
}
{isDesktop ? (
@@ -61,76 +60,10 @@ const NavHeader = ({ fairground }: { fairground: boolean }) => {
const { t } = useTranslation();
return (
-
-
- {fairground ? (
-
- ) : (
-
- )}
-
+
diff --git a/apps/token/src/components/page-templates/template-sidebar.tsx b/apps/token/src/components/page-templates/template-sidebar.tsx
index c8a959f65..971ce54cc 100644
--- a/apps/token/src/components/page-templates/template-sidebar.tsx
+++ b/apps/token/src/components/page-templates/template-sidebar.tsx
@@ -12,7 +12,7 @@ export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {
{children}
-