allow positions and trade history tables to scroll horizontally

This commit is contained in:
saml33 2023-02-09 13:01:31 +11:00
parent 1ed50b9616
commit 8fa244a09b
2 changed files with 184 additions and 182 deletions

View File

@ -72,7 +72,8 @@ const PerpPositions = () => {
) )
return mangoAccountAddress && openPerpPositions.length ? ( return mangoAccountAddress && openPerpPositions.length ? (
<div> <>
<div className="thin-scroll overflow-x-auto">
<Table> <Table>
<thead> <thead>
<TrHead> <TrHead>
@ -105,10 +106,8 @@ const PerpPositions = () => {
if (!basePosition) return null if (!basePosition) return null
const unsettledPnl = position.getUnsettledPnlUi(group, market) const unsettledPnl = position.getUnsettledPnlUi(group, market)
const cummulativePnl = position.cumulativePnlOverPositionLifetimeUi( const cummulativePnl =
group, position.cumulativePnlOverPositionLifetimeUi(group, market)
market
)
return ( return (
<TrBody key={`${position.marketIndex}`} className="my-1 p-2"> <TrBody key={`${position.marketIndex}`} className="my-1 p-2">
@ -180,6 +179,7 @@ const PerpPositions = () => {
})} })}
</tbody> </tbody>
</Table> </Table>
</div>
{showMarketCloseModal && positionToClose ? ( {showMarketCloseModal && positionToClose ? (
<MarketCloseModal <MarketCloseModal
isOpen={showMarketCloseModal} isOpen={showMarketCloseModal}
@ -187,7 +187,7 @@ const PerpPositions = () => {
position={positionToClose} position={positionToClose}
/> />
) : null} ) : null}
</div> </>
) : mangoAccountAddress || connected ? ( ) : mangoAccountAddress || connected ? (
<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" /> <NoSymbolIcon className="mb-2 h-6 w-6 text-th-fgd-4" />

View File

@ -240,6 +240,7 @@ const TradeHistory = () => {
(combinedTradeHistory.length || loadingTradeHistory) ? ( (combinedTradeHistory.length || loadingTradeHistory) ? (
<> <>
{showTableView ? ( {showTableView ? (
<div className="thin-scroll overflow-x-auto">
<Table> <Table>
<thead> <thead>
<TrHead> <TrHead>
@ -322,6 +323,7 @@ const TradeHistory = () => {
})} })}
</tbody> </tbody>
</Table> </Table>
</div>
) : ( ) : (
<div> <div>
{combinedTradeHistory.map((trade: any, index: number) => { {combinedTradeHistory.map((trade: any, index: number) => {