Commit 27b3f058 by Nguyễn Thị Thúy

update calculator profit loss

parent 05ff171a
...@@ -53,8 +53,8 @@ const CalculatorProfitLoss = (props) => { ...@@ -53,8 +53,8 @@ const CalculatorProfitLoss = (props) => {
if (index === true) { if (index === true) {
let newData = [...dataCalculator] let newData = [...dataCalculator]
newData.push({ newData.push({
name: 'Bạc', name: product.name,
status: 'Mua', status: RadioBuySale[transactionType].label,
slot_number: 6, slot_number: 6,
profit_loss_usd: 639324325, profit_loss_usd: 639324325,
profit_loss_vnd: 1234349235455, profit_loss_vnd: 1234349235455,
......
...@@ -12,6 +12,7 @@ import Ionicons from 'react-native-vector-icons/Ionicons'; ...@@ -12,6 +12,7 @@ import Ionicons from 'react-native-vector-icons/Ionicons';
import {getFontXD, getLineHeightXD, HEIGHTXD, toPriceVnd, WIDTHXD} from '../../../Config/Functions'; import {getFontXD, getLineHeightXD, HEIGHTXD, toPriceVnd, WIDTHXD} from '../../../Config/Functions';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import TextField from '../../../components/TextField'; import TextField from '../../../components/TextField';
import {RadioBuySale} from '../../../Config/constants';
const ItemCalculator = (props) => { const ItemCalculator = (props) => {
const [expanded, setExpanded] = useState(true); const [expanded, setExpanded] = useState(true);
...@@ -59,7 +60,7 @@ const ItemCalculator = (props) => { ...@@ -59,7 +60,7 @@ const ItemCalculator = (props) => {
<TextField <TextField
title={I18n.t('Status')} title={I18n.t('Status')}
content={props.item.status} content={props.item.status}
styleContent={{color: R.colors.green}} color={props.item.status == RadioBuySale[0].label ? R.colors.green : R.colors.red2}
/> />
<TextField <TextField
title={I18n.t('SlotNumber')} title={I18n.t('SlotNumber')}
......
...@@ -8,11 +8,11 @@ import R from '../assets/R'; ...@@ -8,11 +8,11 @@ import R from '../assets/R';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../Config/Functions'; import {getFontXD, HEIGHTXD, WIDTHXD} from '../Config/Functions';
const TextField = (props) => { const TextField = (props) => {
const {styleContent} = props const {color} = props
return ( return (
<View style={[styles.row, { paddingVertical: WIDTHXD(15) }]}> <View style={[styles.row, { paddingVertical: WIDTHXD(15) }]}>
<Text style={styles.title}>{props.title}</Text> <Text style={styles.title}>{props.title}</Text>
<Text style={[styles.content, styleContent && {styleContent}]}>{props.content}</Text> <Text style={[styles.content, color && {color}]}>{props.content}</Text>
</View> </View>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment