Skip to content

Commit

Permalink
chore: move market type sticker to bottom of description block
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaran- committed Oct 24, 2023
1 parent 649f3c2 commit e94b900
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions src/components/VegaMarkets/Description.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import React from 'react'

const marketTypeToShortName = (marketType: string) => {
switch (marketType) {
case 'Future':
return 'FUTR'
case 'Perpetual':
return 'PERP'
case 'Spot':
return 'SPOT'
default:
return marketType
}
}

export const Description = ({ market }: { market: any }) => {
const marketName = market.tradableInstrument.instrument.name
const marketCode = market.tradableInstrument.instrument.code
Expand All @@ -11,19 +24,16 @@ export const Description = ({ market }: { market: any }) => {
<div>
{marketName}
<br />
<div className="flex justify-between">
<div className="text-vega-dark-300">
{marketCode}
<br />
{symbol}
<br />
</div>
<div>
<div className="w-fit rounded-lg bg-vega-light-200 p-1 dark:bg-vega-dark-200">
{marketType}
</div>
<div className="text-vega-dark-300">
{marketCode}
<br />
{symbol}
<div className="w-fit rounded-lg bg-vega-light-200 p-1 dark:bg-vega-dark-200">
{marketTypeToShortName(marketType)}
</div>
<br />
</div>
<div></div>
</div>
)
}

0 comments on commit e94b900

Please sign in to comment.