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