import { useEffect, useState, useCallback } from 'react' import PageBodyContainer from '../components/PageBodyContainer' import TopBar from '../components/TopBar' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' import useMangoStore from '../stores/useMangoStore' import { mangoCacheSelector, mangoGroupConfigSelector, mangoGroupSelector, walletSelector, } from '../stores/selectors' import Button, { IconButton } from '../components/Button' import { abbreviateAddress, copyToClipboard } from '../utils' import { notify } from '../utils/notifications' import { getMarketIndexBySymbol, ReferrerIdRecord, } from '@blockworks-foundation/mango-client' import { useTranslation } from 'next-i18next' import EmptyState from '../components/EmptyState' import { CheckIcon, CurrencyDollarIcon, DuplicateIcon, LinkIcon, } from '@heroicons/react/outline' import { MngoMonoIcon } from '../components/icons' import Link from 'next/link' import { Table, Td, Th, TrBody, TrHead } from '../components/TableElements' import dayjs from 'dayjs' import AccountsModal from '../components/AccountsModal' import { useViewport } from '../hooks/useViewport' import { breakpoints } from '../components/TradePageGrid' import { ExpandableRow } from '../components/TableElements' import MobileTableHeader from '../components/mobile/MobileTableHeader' import Input, { Label } from '../components/Input' import InlineNotification from '../components/InlineNotification' import useMangoAccount from '../hooks/useMangoAccount' export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale, ['common', 'referrals'])), // Will be passed to the page component as props }, } } const referralHistory = [] // [ // { // time: '2022-02-09T19:28:59Z', // referralLink: 'test2', // referee: '22JS1jkvkLcdxhHo1LpWXUh6sTErkt54j1YaszYWZoCi', // fee: 0.22, // }, // { // time: '2022-02-08T19:28:59Z', // referralLink: 'test2', // referee: '22JS1jkvkLcdxhHo1LpWXUh6sTErkt54j1YaszYWZoCi', // fee: 0.21, // }, // { // time: '2022-02-07T19:28:59Z', // referralLink: 'test2', // referee: '22JS1jkvkLcdxhHo1LpWXUh6sTErkt54j1YaszYWZoCi', // fee: 0.15, // }, // ] const ProgramDetails = () => { const { t } = useTranslation('referrals') return ( <>
{t('referrals:earn-16')}
{t('referrlals:link')} | {t('referrlals:copy-link')} |
{!isMobile ? (
{isMobile ? abbreviateAddress( mangoAccount.publicKey ) : `https://trade.mango.markets?ref=${mangoAccount.publicKey.toString()}`} |
|
---|
{t('referrals:link')} |
{t('referrals:copy-link')}
|
{!isMobile ? (
{isMobile ? customRefs.referrerId : `https://trade.mango.markets?ref=${customRefs.referrerId}`} |
|
---|
{t('referrals:custom-links-limit')}
{t('date')} | {t('referrals:referral-id')} | {t('referrals:referee')} |
{t('referrals:fee-earned')}
|
{dayjs(ref.time).format('DD MMM YYYY h:mma')} | {ref.referralLink} | {abbreviateAddress(mangoAccount.publicKey)} | ${ref.fee} |
---|