Item.js 3.11 KB
Newer Older
Giang Tran committed
1 2 3 4 5 6 7
import React from 'react';
import {View, Text, StyleSheet, TouchableOpacity} from 'react-native';
import {
  getFontXD,
  HEIGHTXD,
  WIDTHXD,
  toPriceVnd,
8
  converType,
Giang Tran committed
9 10 11 12 13
} from '../../../../Config/Functions';
import R from '../../../../assets/R';
import Block from '../../../../components/Block';
import {useNavigation} from '@react-navigation/native';
import {DETAIL_REQUIRE_MONEY} from '../../../../routers/ScreenNames';
Giang Tran committed
14
import AppText from '../../../../components/AppText';
Giang Tran committed
15 16 17 18
const Item = (props) => {
  const {item} = props;
  const navigate = useNavigation();
  return (
Giang Tran committed
19
    <View style={[styles.container, props.isEnd ? {marginBottom: 60} : {}]}>
Giang Tran committed
20 21
      <Block flex={1} row>
        {/* <View style={[styles.wrapLeft, {backgroundColor: item.color}]} />
Giang Tran committed
22 23 24
          <View style={styles.wrapDate}>
            <Text style={styles.txt}>T{item.month}</Text>
            <Text style={styles.txtTitle}>{item.day}</Text>
Giang Tran committed
25
          </View> */}
Giang Tran committed
26 27 28 29 30 31 32 33
        <Block
          style={styles.wrapRight}
          padding={[10, 10]}
          space={'between'}
          flex={1}>
          <View style={styles.rowBet}>
            <Text style={styles.txtTitle}>
              {converType(item.transection_category)}
Giang Tran committed
34
            </Text>
Giang Tran committed
35 36 37 38 39 40 41
            <Text
              style={{
                fontSize: getFontXD(42),
                fontWeight: 'bold',
                color: '#FFB721',
              }}>
              {toPriceVnd(item.amount)}
Giang Tran committed
42
            </Text>
Giang Tran committed
43 44 45 46
          </View>
          <Text numberOfLines={2} style={styles.txt}>
            {item.comments}
          </Text>
Giang Tran committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
          <View
            style={{
              flexDirection: 'row',
              alignItems: 'center',
              justifyContent: 'space-between',
            }}>
            <Text style={styles.txtDate}>
              {item.transection_date_timestamp}
            </Text>
            {item.status == 0 ? (
              <AppText style={{color: '#FFB721'}} i18nKey={'Waiting'}></AppText>
            ) : (
              <AppText
                style={{color: R.colors.green}}
                i18nKey={'Success'}></AppText>
            )}
          </View>
Giang Tran committed
64
        </Block>
Giang Tran committed
65 66
      </Block>
    </View>
Giang Tran committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
  );
};

export default Item;

const styles = StyleSheet.create({
  container: {
    height: HEIGHTXD(280),
    shadowColor: '#000',
    shadowOffset: {
      width: 0,
      height: 2,
    },
    shadowOpacity: 0.25,
    shadowRadius: 3.84,
    elevation: 5,
    marginHorizontal: 10,
    backgroundColor: R.colors.white,
    borderRadius: HEIGHTXD(30),
Giang Tran committed
86
    marginTop: 10,
Giang Tran committed
87 88 89 90 91 92 93 94 95 96 97 98
  },
  wrapRight: {
    borderLeftColor: R.colors.borderGray,
    borderLeftWidth: 0.7,
  },
  wrapLeft: {
    width: WIDTHXD(16),
    borderTopLeftRadius: HEIGHTXD(30),
    borderBottomStartRadius: HEIGHTXD(30),
  },
  wrapDate: {
    justifyContent: 'center',
Giang Tran committed
99
    paddingLeft: 10,
Giang Tran committed
100 101
  },
  txtTitle: {
Giang Tran committed
102
    fontSize: getFontXD(42),
Giang Tran committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
    color: R.colors.black,
    fontWeight: '700',
  },
  txt: {
    fontSize: getFontXD(36),
    color: '#363636',
  },
  txtDate: {
    fontSize: getFontXD(39),
    color: '#363636',
  },
  rowBet: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
  },
});