connect empty state icons

This commit is contained in:
saml33 2022-11-25 10:56:31 +11:00
parent 72e6a030b4
commit 39485015c2
9 changed files with 24 additions and 11 deletions

View File

@ -2,8 +2,8 @@ import { Fragment, useState } from 'react'
import { import {
ArrowRightIcon, ArrowRightIcon,
ChevronDownIcon, ChevronDownIcon,
ClockIcon,
LinkIcon, LinkIcon,
NoSymbolIcon,
} from '@heroicons/react/20/solid' } from '@heroicons/react/20/solid'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
@ -24,9 +24,9 @@ import { PREFERRED_EXPLORER_KEY } from 'utils/constants'
import { EXPLORERS } from 'pages/settings' import { EXPLORERS } from 'pages/settings'
import Tooltip from '@components/shared/Tooltip' import Tooltip from '@components/shared/Tooltip'
import { formatTokenSymbol } from 'utils/tokens' import { formatTokenSymbol } from 'utils/tokens'
import useMangoAccount from 'hooks/useMangoAccount'
import useJupiterMints from 'hooks/useJupiterMints' import useJupiterMints from 'hooks/useJupiterMints'
import { Table, Td, Th, TrBody } from '@components/shared/TableElements' import { Table, Td, Th, TrBody } from '@components/shared/TableElements'
import { useWallet } from '@solana/wallet-adapter-react'
const SwapHistoryTable = ({ const SwapHistoryTable = ({
swapHistory, swapHistory,
@ -35,9 +35,9 @@ const SwapHistoryTable = ({
swapHistory: Array<SwapHistoryItem> swapHistory: Array<SwapHistoryItem>
loading: boolean loading: boolean
}) => { }) => {
const { t } = useTranslation(['common', 'settings']) const { t } = useTranslation(['common', 'settings', 'swap'])
const { connected } = useWallet()
const { mangoTokens } = useJupiterMints() const { mangoTokens } = useJupiterMints()
const { mangoAccount } = useMangoAccount()
const [showSwapDetails, setSwapDetails] = useState('') const [showSwapDetails, setSwapDetails] = useState('')
const { width } = useViewport() const { width } = useViewport()
const showTableView = width ? width > breakpoints.md : false const showTableView = width ? width > breakpoints.md : false
@ -50,7 +50,7 @@ const SwapHistoryTable = ({
showSwapDetails ? setSwapDetails('') : setSwapDetails(signature) showSwapDetails ? setSwapDetails('') : setSwapDetails(signature)
} }
return mangoAccount ? ( return connected ? (
!loading ? ( !loading ? (
swapHistory.length ? ( swapHistory.length ? (
showTableView ? ( showTableView ? (
@ -400,8 +400,8 @@ const SwapHistoryTable = ({
) )
) : ( ) : (
<div className="flex flex-col items-center p-8"> <div className="flex flex-col items-center p-8">
<ClockIcon className="mb-2 h-6 w-6 text-th-fgd-4" /> <NoSymbolIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>No swap history found...</p> <p>{t('swap:no-history')}</p>
</div> </div>
) )
) : ( ) : (
@ -416,7 +416,7 @@ const SwapHistoryTable = ({
) : ( ) : (
<div className="flex flex-col items-center p-8"> <div className="flex flex-col items-center p-8">
<LinkIcon className="mb-2 h-6 w-6 text-th-fgd-4" /> <LinkIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>Connect to view your swap history</p> <p>{t('swap:connect-swap')}</p>
</div> </div>
) )
} }

View File

@ -9,7 +9,7 @@ import Loading from '@components/shared/Loading'
import SideBadge from '@components/shared/SideBadge' import SideBadge from '@components/shared/SideBadge'
import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements' import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements'
import Tooltip from '@components/shared/Tooltip' import Tooltip from '@components/shared/Tooltip'
import { LinkIcon, TrashIcon } from '@heroicons/react/20/solid' import { LinkIcon, NoSymbolIcon, TrashIcon } from '@heroicons/react/20/solid'
import { Order } from '@project-serum/serum/lib/market' import { Order } from '@project-serum/serum/lib/market'
import { useWallet } from '@solana/wallet-adapter-react' import { useWallet } from '@solana/wallet-adapter-react'
import { PublicKey } from '@solana/web3.js' import { PublicKey } from '@solana/web3.js'
@ -306,6 +306,7 @@ const OpenOrders = () => {
) )
) : ( ) : (
<div className="flex flex-col items-center p-8"> <div className="flex flex-col items-center p-8">
<NoSymbolIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>{t('trade:no-orders')}</p> <p>{t('trade:no-orders')}</p>
</div> </div>
) )

View File

@ -1,7 +1,7 @@
import { PerpMarket } from '@blockworks-foundation/mango-v4' import { PerpMarket } from '@blockworks-foundation/mango-v4'
import { LinkButton } from '@components/shared/Button' import { LinkButton } from '@components/shared/Button'
import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements' import { Table, Td, Th, TrBody, TrHead } from '@components/shared/TableElements'
import { LinkIcon } from '@heroicons/react/20/solid' import { LinkIcon, NoSymbolIcon } from '@heroicons/react/20/solid'
import { useWallet } from '@solana/wallet-adapter-react' import { useWallet } from '@solana/wallet-adapter-react'
import mangoStore from '@store/mangoStore' import mangoStore from '@store/mangoStore'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
@ -127,6 +127,7 @@ const PerpPositions = () => {
</div> </div>
) : ( ) : (
<div className="flex flex-col items-center p-8"> <div className="flex flex-col items-center p-8">
<NoSymbolIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>{t('trade:no-positions')}</p> <p>{t('trade:no-positions')}</p>
</div> </div>
) )

View File

@ -4,7 +4,7 @@ import { useCallback, useState } from 'react'
import { PublicKey } from '@solana/web3.js' import { PublicKey } from '@solana/web3.js'
import { IconButton } from '@components/shared/Button' import { IconButton } from '@components/shared/Button'
import { notify } from 'utils/notifications' import { notify } from 'utils/notifications'
import { CheckIcon, LinkIcon } from '@heroicons/react/20/solid' import { CheckIcon, LinkIcon, NoSymbolIcon } from '@heroicons/react/20/solid'
import Tooltip from '@components/shared/Tooltip' import Tooltip from '@components/shared/Tooltip'
import Loading from '@components/shared/Loading' import Loading from '@components/shared/Loading'
import { useViewport } from 'hooks/useViewport' import { useViewport } from 'hooks/useViewport'
@ -216,6 +216,7 @@ const UnsettledTrades = ({
) )
) : ( ) : (
<div className="flex flex-col items-center p-8"> <div className="flex flex-col items-center p-8">
<NoSymbolIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>{t('trade:no-unsettled')}</p> <p>{t('trade:no-unsettled')}</p>
</div> </div>
) )

View File

@ -1,11 +1,13 @@
{ {
"confirm-swap": "Confirm Swap", "confirm-swap": "Confirm Swap",
"connect-swap": "Connect to view your swap history",
"est-liq-price": "Est. Liq Price", "est-liq-price": "Est. Liq Price",
"fees-paid-to": "Fees Paid to {{route}}", "fees-paid-to": "Fees Paid to {{route}}",
"health-impact": "Health Impact", "health-impact": "Health Impact",
"insufficient-balance": "Insufficient {{symbol}} Balance", "insufficient-balance": "Insufficient {{symbol}} Balance",
"insufficient-collateral": "Insufficient Collateral", "insufficient-collateral": "Insufficient Collateral",
"minimum-received": "Minimum Received", "minimum-received": "Minimum Received",
"no-history": "No swap history",
"pay": "You Pay", "pay": "You Pay",
"rate": "Rate", "rate": "Rate",
"receive": "You Receive", "receive": "You Receive",

View File

@ -1,11 +1,13 @@
{ {
"confirm-swap": "Confirm Swap", "confirm-swap": "Confirm Swap",
"connect-swap": "Connect to view your swap history",
"est-liq-price": "Est. Liq Price", "est-liq-price": "Est. Liq Price",
"fees-paid-to": "Fees Paid to {{route}}", "fees-paid-to": "Fees Paid to {{route}}",
"health-impact": "Health Impact", "health-impact": "Health Impact",
"insufficient-balance": "Insufficient {{symbol}} Balance", "insufficient-balance": "Insufficient {{symbol}} Balance",
"insufficient-collateral": "Insufficient Collateral", "insufficient-collateral": "Insufficient Collateral",
"minimum-received": "Minimum Received", "minimum-received": "Minimum Received",
"no-history": "No swap history",
"pay": "You Pay", "pay": "You Pay",
"rate": "Rate", "rate": "Rate",
"receive": "You Receive", "receive": "You Receive",

View File

@ -1,11 +1,13 @@
{ {
"confirm-swap": "Confirm Swap", "confirm-swap": "Confirm Swap",
"connect-swap": "Connect to view your swap history",
"est-liq-price": "Est. Liq Price", "est-liq-price": "Est. Liq Price",
"fees-paid-to": "Fees Paid to {{route}}", "fees-paid-to": "Fees Paid to {{route}}",
"health-impact": "Health Impact", "health-impact": "Health Impact",
"insufficient-balance": "Insufficient {{symbol}} Balance", "insufficient-balance": "Insufficient {{symbol}} Balance",
"insufficient-collateral": "Insufficient Collateral", "insufficient-collateral": "Insufficient Collateral",
"minimum-received": "Minimum Received", "minimum-received": "Minimum Received",
"no-history": "No swap history",
"pay": "You Pay", "pay": "You Pay",
"rate": "Rate", "rate": "Rate",
"receive": "You Receive", "receive": "You Receive",

View File

@ -1,11 +1,13 @@
{ {
"confirm-swap": "Confirm Swap", "confirm-swap": "Confirm Swap",
"connect-swap": "Connect to view your swap history",
"est-liq-price": "Est. Liq Price", "est-liq-price": "Est. Liq Price",
"fees-paid-to": "Fees Paid to {{route}}", "fees-paid-to": "Fees Paid to {{route}}",
"health-impact": "Health Impact", "health-impact": "Health Impact",
"insufficient-balance": "Insufficient {{symbol}} Balance", "insufficient-balance": "Insufficient {{symbol}} Balance",
"insufficient-collateral": "Insufficient Collateral", "insufficient-collateral": "Insufficient Collateral",
"minimum-received": "Minimum Received", "minimum-received": "Minimum Received",
"no-history": "No swap history",
"pay": "You Pay", "pay": "You Pay",
"rate": "Rate", "rate": "Rate",
"receive": "You Receive", "receive": "You Receive",

View File

@ -1,11 +1,13 @@
{ {
"confirm-swap": "Confirm Swap", "confirm-swap": "Confirm Swap",
"connect-swap": "Connect to view your swap history",
"est-liq-price": "Est. Liq Price", "est-liq-price": "Est. Liq Price",
"fees-paid-to": "Fees Paid to {{route}}", "fees-paid-to": "Fees Paid to {{route}}",
"health-impact": "Health Impact", "health-impact": "Health Impact",
"insufficient-balance": "Insufficient {{symbol}} Balance", "insufficient-balance": "Insufficient {{symbol}} Balance",
"insufficient-collateral": "Insufficient Collateral", "insufficient-collateral": "Insufficient Collateral",
"minimum-received": "Minimum Received", "minimum-received": "Minimum Received",
"no-history": "No swap history",
"pay": "You Pay", "pay": "You Pay",
"rate": "Rate", "rate": "Rate",
"receive": "You Receive", "receive": "You Receive",