File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ type Props = TopLevelViewPropsType & {
1515 url : string ,
1616 query ?: Object ,
1717 mode : 'rss' | 'wp-json' ,
18- thumbnail : number ,
18+ thumbnail : false | number ,
1919}
2020
2121type State = {
Original file line number Diff line number Diff line change @@ -20,15 +20,19 @@ type Props = TopLevelViewPropsType & {
2020 onRefresh : ( ) => any ,
2121 entries : StoryType [ ] ,
2222 loading : boolean ,
23- thumbnail : number ,
23+ thumbnail : false | number ,
2424}
2525
2626export class NewsList extends React . PureComponent < Props > {
2727 onPressNews = ( url : string ) => {
2828 return openUrl ( url )
2929 }
3030
31- renderSeparator = ( ) => < ListSeparator spacing = { { left : 101 } } />
31+ renderSeparator = ( ) => (
32+ < ListSeparator
33+ spacing = { { left : this . props . thumbnail === false ? undefined : 101 } }
34+ />
35+ )
3236
3337 renderItem = ( { item} : { item : StoryType } ) => (
3438 < NewsRow
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import type {StoryType} from './types'
99type Props = {
1010 onPress : string => any ,
1111 story : StoryType ,
12- thumbnail : number ,
12+ thumbnail : false | number ,
1313}
1414
1515export class NewsRow extends React . PureComponent < Props > {
@@ -23,14 +23,19 @@ export class NewsRow extends React.PureComponent<Props> {
2323
2424 render ( ) {
2525 const { story } = this . props
26- const thumb = story . featuredImage
27- ? { uri : story . featuredImage }
28- : this . props . thumbnail
26+ const thumb =
27+ this . props . thumbnail !== false
28+ ? story . featuredImage
29+ ? { uri : story . featuredImage }
30+ : this . props . thumbnail
31+ : null
2932
3033 return (
3134 < ListRow arrowPosition = "top" onPress = { this . _onPress } >
3235 < Row alignItems = "center" >
33- < Image source = { thumb } style = { styles . image } />
36+ { thumb !== null ? (
37+ < Image source = { thumb } style = { styles . image } />
38+ ) : null }
3439 < Column flex = { 1 } >
3540 < Title lines = { 2 } > { story . title } </ Title >
3641 < Detail lines = { 3 } > { story . excerpt } </ Detail >
You can’t perform that action at this time.
0 commit comments