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

update calculator profit loss

parent 05ff171a
......@@ -53,8 +53,8 @@ const CalculatorProfitLoss = (props) => {
if (index === true) {
let newData = [...dataCalculator]
newData.push({
name: 'Bạc',
status: 'Mua',
name: product.name,
status: RadioBuySale[transactionType].label,
slot_number: 6,
profit_loss_usd: 639324325,
profit_loss_vnd: 1234349235455,
......
......@@ -12,6 +12,7 @@ import Ionicons from 'react-native-vector-icons/Ionicons';
import {getFontXD, getLineHeightXD, HEIGHTXD, toPriceVnd, WIDTHXD} from '../../../Config/Functions';
import I18n from '../../../helper/i18/i18n';
import TextField from '../../../components/TextField';
import {RadioBuySale} from '../../../Config/constants';
const ItemCalculator = (props) => {
const [expanded, setExpanded] = useState(true);
......@@ -59,7 +60,7 @@ const ItemCalculator = (props) => {
<TextField
title={I18n.t('Status')}
content={props.item.status}
styleContent={{color: R.colors.green}}
color={props.item.status == RadioBuySale[0].label ? R.colors.green : R.colors.red2}
/>
<TextField
title={I18n.t('SlotNumber')}
......
......@@ -8,11 +8,11 @@ import R from '../assets/R';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../Config/Functions';
const TextField = (props) => {
const {styleContent} = props
const {color} = props
return (
<View style={[styles.row, { paddingVertical: WIDTHXD(15) }]}>
<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>
)
}
......
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