Item.js 2.29 KB
Newer Older
Giang Tran committed
1 2
import React from 'react';
import {
Giang Tran committed
3 4 5 6 7 8
  View,
  Text,
  StyleSheet,
  TouchableOpacity,
  Image,
  Alert,
Giang Tran committed
9 10
} from 'react-native';
import {
Giang Tran committed
11 12 13 14
  getFontXD,
  HEIGHTXD,
  WIDTHXD,
  toPriceVnd,
Giang Tran committed
15 16 17 18 19
} from '../../../Config/Functions';
import R from '../../../assets/R';
import Block from '../../../components/Block';

const Item = (props) => {
Giang Tran committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
  const {item} = props;
  return (
    <View style={styles.container}>
      <TouchableOpacity onPress={() => props.onPress(item)}>
        <Block flex={1} row>
          <View style={styles.wrapDate}>
            <Image source={R.images.iconRecharge} style={styles.imgIcon} />
          </View>
          <Block padding={[5, 10]} space={'between'} flex={1}>
            <View
              style={{
                flex: 1,
                flexDirection: 'row',
                justifyContent: 'space-between',
              }}>
              <Text numberOfLines={2} style={styles.txtBlack}>
                Ngô CBOT
              </Text>
              <Text style={styles.txtMoney}>{toPriceVnd(300000)}</Text>
            </View>
            <Text style={styles.txt}>ZCE</Text>
          </Block>
        </Block>
      </TouchableOpacity>
    </View>
  );
Giang Tran committed
46 47 48 49 50
};

export default Item;

const styles = StyleSheet.create({
Giang Tran committed
51 52 53 54 55 56 57
  container: {
    marginTop: 10,
    paddingVertical: 10,
    shadowColor: '#000',
    shadowOffset: {
      width: 0,
      height: 2,
Giang Tran committed
58
    },
Giang Tran committed
59 60 61 62 63 64 65 66
    shadowOpacity: 0.25,
    shadowRadius: 3.84,
    elevation: 5,
    marginHorizontal: 10,
    backgroundColor: R.colors.white,
    marginBottom: 10,
    borderRadius: HEIGHTXD(30),
  },
Giang Tran committed
67

Giang Tran committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
  wrapLeft: {
    width: WIDTHXD(16),
    borderTopLeftRadius: HEIGHTXD(30),
    borderBottomStartRadius: HEIGHTXD(30),
  },
  wrapDate: {
    justifyContent: 'center',
    paddingHorizontal: 10,
  },
  txtTitle: {
    fontSize: getFontXD(42),
    color: R.colors.black,
    fontWeight: 'bold',
  },
  txt: {
    fontSize: getFontXD(39),
    color: '#929292',
    fontStyle: 'italic',
  },
  rowBet: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'center',
  },
  txtBlack: {
    fontSize: getFontXD(42),
    color: 'black',
    fontWeight: 'bold',
  },
  imgIcon: {
    width: WIDTHXD(178),
    height: HEIGHTXD(178),
    resizeMode: 'contain',
  },
  txtMoney: {
    fontSize: getFontXD(42),
    color: R.colors.main,
  },
Giang Tran committed
106
});