refactor: use proft calculated in GraphQL resolver

This commit is contained in:
siiky 2022-10-10 16:05:34 +01:00 committed by Rafael
parent e7ca33c8a4
commit ce8295e54a

View file

@ -4,12 +4,7 @@ import React, { useEffect, useRef, useCallback } from 'react'
import { backgroundColor, zircon, primaryColor } from 'src/styling/variables'
const transactionProfit = tx => {
const fixedFee = tx.fixedFee ? Number.parseFloat(tx.fixedFee) : 0
const commission =
Number.parseFloat(tx.commissionPercentage) * Number.parseFloat(tx.fiat)
return commission + fixedFee
}
const transactionProfit = R.prop('profit')
const mockPoint = (tx, offsetMs, profit) => {
const date = new Date(new Date(tx.created).getTime() + offsetMs).toISOString()