Commit ede0f37a by Giang Tran

update code

parent 460c8ee6
import React, {Component} from 'react';
import React, {Component, useState} from 'react';
import {View, Text, StyleSheet, Image, TouchableOpacity} from 'react-native';
import Block from '../../../components/Block';
......@@ -11,10 +11,12 @@ import {DETAILNEW} from '../../../routers/ScreenNames';
const Item = (props) => {
const navigate = useNavigation();
const {title, image, published_at, id} = props.item;
return (
<TouchableOpacity
onPress={() => navigate.navigate(DETAILNEW, {id})}
style={styles.container}>
style={styles.container}
>
<Text numberOfLines={2} style={styles.txtTitle}>
{title}
</Text>
......@@ -22,7 +24,6 @@ const Item = (props) => {
<Icon name={'calendar'} style={{marginRight: 10}} size={15} />
<Text style={styles.txtDate}>{published_at}</Text>
</View>
<Image source={{uri: image}} resizeMode={'cover'} style={styles.img} />
</TouchableOpacity>
);
......@@ -52,6 +53,7 @@ const styles = StyleSheet.create({
height: HEIGHTXD(500),
borderRadius: 10,
marginTop: 5,
width: '100%',
},
row: {
flexDirection: 'row',
......
......@@ -110,6 +110,7 @@ const images = {
toolProfitLoss: require('./images/toolProfitLoss.png'),
toolRate: require('./images/toolRate.png'),
toolStopLoss: require('./images/toolStopLoss.png'),
placeholderImage: require('./images/placeholderImage.png'),
};
export default images;
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