Skip to content

Instantly share code, notes, and snippets.

@kluu1
Created March 24, 2020 02:03
Show Gist options
  • Select an option

  • Save kluu1/ea183e0db6ad23ad97780d975f669b95 to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/ea183e0db6ad23ad97780d975f669b95 to your computer and use it in GitHub Desktop.
import { Table } from 'semantic-ui-react'
import { formatCurrency, convertToPercentage } from '../../utils/filters'
const CoinDetailsModalTable = ({ coinDetails, data }) => (
<Table basic="very">
<Table.Body>
<Table.Row>
<Table.Cell>Symbol</Table.Cell>
<Table.Cell>{coinDetails.currency}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Rank</Table.Cell>
<Table.Cell>{coinDetails.rank}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Price</Table.Cell>
<Table.Cell>{formatCurrency(coinDetails.price)}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Price Change</Table.Cell>
<Table.Cell>
{data && data.getCoinDetails && convertToPercentage(data.getCoinDetails.price_change_pct)}
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Circulating Supply</Table.Cell>
<Table.Cell>{coinDetails.circulating_supply}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Max Supply</Table.Cell>
<Table.Cell>{coinDetails.max_supply}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Market Cap Change</Table.Cell>
<Table.Cell>
{data && data.getCoinDetails && formatCurrency(data.getCoinDetails.market_cap_change)}
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>Market Cap Change (%)</Table.Cell>
<Table.Cell>
{data &&
data.getCoinDetails &&
convertToPercentage(data.getCoinDetails.market_cap_change_pct)}
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
)
export default CoinDetailsModalTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment