open orders empty states

This commit is contained in:
saml33 2022-09-19 21:32:59 +10:00
parent 637f14a8a3
commit f15de620ee
2 changed files with 45 additions and 32 deletions

View File

@ -341,7 +341,7 @@ const SwapHistoryTable = ({
</div>
)
) : (
<div className="flex flex-col items-center border-b border-th-bkg-3 p-8">
<div className="flex flex-col items-center p-8">
<ClockIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>No swap history found...</p>
</div>
@ -363,7 +363,7 @@ const SwapHistoryTable = ({
</div>
)
) : (
<div className="flex flex-col items-center border-b border-th-bkg-3 p-8">
<div className="flex flex-col items-center p-8">
<LinkIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>Connect to view your swap history</p>
</div>

View File

@ -2,8 +2,9 @@ import { Serum3Side } from '@blockworks-foundation/mango-v4'
import Button from '@components/shared/Button'
import SideBadge from '@components/shared/SideBadge'
import TabButtons from '@components/shared/TabButtons'
import { QuestionMarkCircleIcon } from '@heroicons/react/20/solid'
import { LinkIcon, QuestionMarkCircleIcon } from '@heroicons/react/20/solid'
import { Order } from '@project-serum/serum/lib/market'
import { useWallet } from '@solana/wallet-adapter-react'
import mangoStore from '@store/mangoStore'
import { useTranslation } from 'next-i18next'
import Image from 'next/image'
@ -135,6 +136,7 @@ const Balances = () => {
const OpenOrders = () => {
const { t } = useTranslation('common')
const { connected } = useWallet()
const openOrders = mangoStore((s) => s.mangoAccount.openOrders)
const handleCancelOrder = useCallback(
@ -172,7 +174,8 @@ const OpenOrders = () => {
[t]
)
return (
return connected ? (
openOrders.length ? (
<table>
<thead>
<tr className="">
@ -201,6 +204,16 @@ const OpenOrders = () => {
})}
</tbody>
</table>
) : (
<div className="flex flex-col items-center p-8">
<p>No open orders...</p>
</div>
)
) : (
<div className="flex flex-col items-center p-8">
<LinkIcon className="mb-2 h-6 w-6 text-th-fgd-4" />
<p>Connect to view your open orders</p>
</div>
)
}