|
@@ -45,18 +45,18 @@ class FeedItem extends React.Component<PropsType> {
|
45
|
45
|
};
|
46
|
46
|
|
47
|
47
|
render(): React.Node {
|
48
|
|
- const {props} = this;
|
49
|
|
- const {item} = props;
|
50
|
|
- const hasImage = item.image !== '' && item.image != null;
|
|
48
|
+ const {item, height, navigation} = this.props;
|
|
49
|
+ const image = item.image !== '' && item.image != null ? item.image : null;
|
51
|
50
|
const pageSource: NewsSourceType = NewsSourcesConstants[item.page_id];
|
52
|
51
|
const cardMargin = 10;
|
53
|
|
- const cardHeight = props.height - 2 * cardMargin;
|
|
52
|
+ const cardHeight = height - 2 * cardMargin;
|
54
|
53
|
const imageSize = 250;
|
55
|
54
|
const titleHeight = 80;
|
56
|
55
|
const actionsHeight = 60;
|
57
|
|
- const textHeight = hasImage
|
58
|
|
- ? cardHeight - titleHeight - actionsHeight - imageSize
|
59
|
|
- : cardHeight - titleHeight - actionsHeight;
|
|
56
|
+ const textHeight =
|
|
57
|
+ image != null
|
|
58
|
+ ? cardHeight - titleHeight - actionsHeight - imageSize
|
|
59
|
+ : cardHeight - titleHeight - actionsHeight;
|
60
|
60
|
return (
|
61
|
61
|
<Card
|
62
|
62
|
style={{
|
|
@@ -80,17 +80,17 @@ class FeedItem extends React.Component<PropsType> {
|
80
|
80
|
)}
|
81
|
81
|
style={{height: titleHeight}}
|
82
|
82
|
/>
|
83
|
|
- {hasImage ? (
|
84
|
|
- <View style={{marginLeft: 'auto', marginRight: 'auto'}}>
|
85
|
|
- <ImageGalleryButton
|
86
|
|
- navigation={props.navigation}
|
87
|
|
- images={[{url: item.image}]}
|
88
|
|
- style={{
|
89
|
|
- width: imageSize,
|
90
|
|
- height: imageSize,
|
91
|
|
- }}
|
92
|
|
- />
|
93
|
|
- </View>
|
|
83
|
+ {image != null ? (
|
|
84
|
+ <ImageGalleryButton
|
|
85
|
+ navigation={navigation}
|
|
86
|
+ images={[{url: image}]}
|
|
87
|
+ style={{
|
|
88
|
+ width: imageSize,
|
|
89
|
+ height: imageSize,
|
|
90
|
+ marginLeft: 'auto',
|
|
91
|
+ marginRight: 'auto',
|
|
92
|
+ }}
|
|
93
|
+ />
|
94
|
94
|
) : null}
|
95
|
95
|
<Card.Content>
|
96
|
96
|
{item.message !== undefined ? (
|