refactor: moving mock data variables outside component
This commit is contained in:
parent
24a1ca84a6
commit
4991a43dea
1 changed files with 64 additions and 64 deletions
|
|
@ -15,6 +15,70 @@ import { H4, Label2, P, Info2 } from 'src/components/typography'
|
||||||
import styles from './Assets.styles'
|
import styles from './Assets.styles'
|
||||||
const useStyles = makeStyles(styles)
|
const useStyles = makeStyles(styles)
|
||||||
|
|
||||||
|
const mockData = [
|
||||||
|
{
|
||||||
|
id: 'fiatBalance',
|
||||||
|
display: 'Fiat balance',
|
||||||
|
amount: 10438,
|
||||||
|
currency: 'USD',
|
||||||
|
class: 'Available balance'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'hedgingReserve',
|
||||||
|
display: 'Hedging reserve',
|
||||||
|
amount: -1486,
|
||||||
|
currency: 'USD',
|
||||||
|
class: 'Available balance',
|
||||||
|
direction: 'out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'hedgedWalletAssets',
|
||||||
|
display: 'Hedged wallet assets',
|
||||||
|
amount: 96446,
|
||||||
|
currency: 'USD',
|
||||||
|
class: 'Wallet assets',
|
||||||
|
direction: 'in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'unhedgedWalletAssets',
|
||||||
|
display: 'Unhedged wallet assets',
|
||||||
|
amount: 3978,
|
||||||
|
currency: 'USD',
|
||||||
|
class: 'Wallet assets',
|
||||||
|
direction: 'in'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const mockDataTotal = [
|
||||||
|
{
|
||||||
|
id: 'fiatBalance',
|
||||||
|
display: 'Fiat balance',
|
||||||
|
amount: 10438,
|
||||||
|
currency: 'USD'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'hedgingReserve',
|
||||||
|
display: 'Hedging reserve',
|
||||||
|
amount: -1486,
|
||||||
|
currency: 'USD',
|
||||||
|
direction: 'out'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'hedgedWalletAssets',
|
||||||
|
display: 'Market value of hedged wallet assets',
|
||||||
|
amount: 94980,
|
||||||
|
currency: 'USD',
|
||||||
|
direction: 'in'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'unhedgedWalletAssets',
|
||||||
|
display: 'Unhedged wallet assets',
|
||||||
|
amount: 3978,
|
||||||
|
currency: 'USD',
|
||||||
|
direction: 'in'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
const cellStyling = {
|
const cellStyling = {
|
||||||
borderBottom: '4px solid white',
|
borderBottom: '4px solid white',
|
||||||
padding: 0,
|
padding: 0,
|
||||||
|
|
@ -100,70 +164,6 @@ const formatCurrency = amount =>
|
||||||
const Assets = () => {
|
const Assets = () => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
|
|
||||||
const mockData = [
|
|
||||||
{
|
|
||||||
id: 'fiatBalance',
|
|
||||||
display: 'Fiat balance',
|
|
||||||
amount: 10438,
|
|
||||||
currency: 'USD',
|
|
||||||
class: 'Available balance'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'hedgingReserve',
|
|
||||||
display: 'Hedging reserve',
|
|
||||||
amount: -1486,
|
|
||||||
currency: 'USD',
|
|
||||||
class: 'Available balance',
|
|
||||||
direction: 'out'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'hedgedWalletAssets',
|
|
||||||
display: 'Hedged wallet assets',
|
|
||||||
amount: 96446,
|
|
||||||
currency: 'USD',
|
|
||||||
class: 'Wallet assets',
|
|
||||||
direction: 'in'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'unhedgedWalletAssets',
|
|
||||||
display: 'Unhedged wallet assets',
|
|
||||||
amount: 3978,
|
|
||||||
currency: 'USD',
|
|
||||||
class: 'Wallet assets',
|
|
||||||
direction: 'in'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const mockDataTotal = [
|
|
||||||
{
|
|
||||||
id: 'fiatBalance',
|
|
||||||
display: 'Fiat balance',
|
|
||||||
amount: 10438,
|
|
||||||
currency: 'USD'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'hedgingReserve',
|
|
||||||
display: 'Hedging reserve',
|
|
||||||
amount: -1486,
|
|
||||||
currency: 'USD',
|
|
||||||
direction: 'out'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'hedgedWalletAssets',
|
|
||||||
display: 'Market value of hedged wallet assets',
|
|
||||||
amount: 94980,
|
|
||||||
currency: 'USD',
|
|
||||||
direction: 'in'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'unhedgedWalletAssets',
|
|
||||||
display: 'Unhedged wallet assets',
|
|
||||||
amount: 3978,
|
|
||||||
currency: 'USD',
|
|
||||||
direction: 'in'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const filterByClass = x =>
|
const filterByClass = x =>
|
||||||
R.filter(it => R.path(['class'])(it) === x)(mockData)
|
R.filter(it => R.path(['class'])(it) === x)(mockData)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue