import { Loader, TradingAnchorButton, VegaIcon, VegaIconNames, } from '@vegaprotocol/ui-toolkit'; import { LandingBanner } from './landing-banner'; import { TiersContainer } from './tiers'; import { TabLink } from './buttons'; import { Outlet, useMatch } from 'react-router-dom'; import { Routes } from '../../lib/links'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { useReferral } from './hooks/use-referral'; import { REFERRAL_DOCS_LINK } from './constants'; import classNames from 'classnames'; import { useT } from '../../lib/use-t'; import { ErrorBoundary } from '../../components/error-boundary'; import { usePageTitle } from '../../lib/hooks/use-page-title'; const Nav = () => { const t = useT(); const match = useMatch(Routes.REFERRALS_APPLY_CODE); return (
{t('Apply code')} {t('Create code')}
); }; export const Referrals = () => { const t = useT(); const { pubKey } = useVegaWallet(); const { data: referee, loading: refereeLoading, error: refereeError, } = useReferral({ pubKey, role: 'referee', }); const { data: referrer, loading: referrerLoading, error: referrerError, } = useReferral({ pubKey, role: 'referrer', }); const error = refereeError || referrerError; const loading = refereeLoading || referrerLoading; const showNav = !loading && !error && !referrer && !referee; usePageTitle(t('Referrals')); return ( {showNav &&