From 6441865b09ee58994845d9468c64282d827d9a5a Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Mon, 10 Aug 2020 12:46:26 +0200 Subject: [PATCH] Fix eslint errors --- src/components/Home/FeedItem.js | 36 +++++++++++----------- src/components/Media/ImageGalleryButton.js | 6 ++-- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/components/Home/FeedItem.js b/src/components/Home/FeedItem.js index c2920ce..148b539 100644 --- a/src/components/Home/FeedItem.js +++ b/src/components/Home/FeedItem.js @@ -45,18 +45,18 @@ class FeedItem extends React.Component { }; render(): React.Node { - const {props} = this; - const {item} = props; - const hasImage = item.image !== '' && item.image != null; + const {item, height, navigation} = this.props; + const image = item.image !== '' && item.image != null ? item.image : null; const pageSource: NewsSourceType = NewsSourcesConstants[item.page_id]; const cardMargin = 10; - const cardHeight = props.height - 2 * cardMargin; + const cardHeight = height - 2 * cardMargin; const imageSize = 250; const titleHeight = 80; const actionsHeight = 60; - const textHeight = hasImage - ? cardHeight - titleHeight - actionsHeight - imageSize - : cardHeight - titleHeight - actionsHeight; + const textHeight = + image != null + ? cardHeight - titleHeight - actionsHeight - imageSize + : cardHeight - titleHeight - actionsHeight; return ( { )} style={{height: titleHeight}} /> - {hasImage ? ( - - - + {image != null ? ( + ) : null} {item.message !== undefined ? ( diff --git a/src/components/Media/ImageGalleryButton.js b/src/components/Media/ImageGalleryButton.js index 4fc4392..aeaf5ee 100644 --- a/src/components/Media/ImageGalleryButton.js +++ b/src/components/Media/ImageGalleryButton.js @@ -1,16 +1,14 @@ // @flow import * as React from 'react'; -import {TouchableRipple, withTheme} from 'react-native-paper'; +import {TouchableRipple} from 'react-native-paper'; import {StackNavigationProp} from '@react-navigation/stack'; import {Image} from 'react-native-animatable'; import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; -import type {CustomThemeType} from '../../managers/ThemeManager'; type PropsType = { navigation: StackNavigationProp, images: Array<{url: string}>, - theme: CustomThemeType, style: ViewStyleProp, }; @@ -37,4 +35,4 @@ class ImageGalleryButton extends React.Component { } } -export default withTheme(ImageGalleryButton); +export default ImageGalleryButton;