Browse Source

Fix feed item screen page source

Arnaud Vergnet 3 years ago
parent
commit
14e5b01341
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      src/screens/Home/FeedItemScreen.js

+ 6
- 6
src/screens/Home/FeedItemScreen.js View File

12
 import type {FeedItemType} from './HomeScreen';
12
 import type {FeedItemType} from './HomeScreen';
13
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
13
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
14
 import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
14
 import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
15
+import NewsSourcesConstants from '../../constants/NewsSourcesConstants';
16
+import type {NewsSourceType} from '../../constants/NewsSourcesConstants';
15
 
17
 
16
 type PropsType = {
18
 type PropsType = {
17
   navigation: StackNavigationProp,
19
   navigation: StackNavigationProp,
18
   route: {params: {data: FeedItemType, date: string}},
20
   route: {params: {data: FeedItemType, date: string}},
19
 };
21
 };
20
 
22
 
21
-const ICON_AMICALE = require('../../../assets/amicale.png');
22
-
23
-const NAME_AMICALE = 'Amicale INSA Toulouse';
24
-
25
 /**
23
 /**
26
  * Class defining a feed item page.
24
  * Class defining a feed item page.
27
  */
25
  */
72
     const {navigation} = this.props;
70
     const {navigation} = this.props;
73
     const hasImage =
71
     const hasImage =
74
       this.displayData.image !== '' && this.displayData.image != null;
72
       this.displayData.image !== '' && this.displayData.image != null;
73
+    const pageSource: NewsSourceType =
74
+      NewsSourcesConstants[this.displayData.page_id];
75
     return (
75
     return (
76
       <CollapsibleScrollView style={{margin: 5}} hasTab>
76
       <CollapsibleScrollView style={{margin: 5}} hasTab>
77
         <Card.Title
77
         <Card.Title
78
-          title={NAME_AMICALE}
78
+          title={pageSource.name}
79
           subtitle={this.date}
79
           subtitle={this.date}
80
           left={(): React.Node => (
80
           left={(): React.Node => (
81
             <Avatar.Image
81
             <Avatar.Image
82
               size={48}
82
               size={48}
83
-              source={ICON_AMICALE}
83
+              source={pageSource.icon}
84
               style={{backgroundColor: 'transparent'}}
84
               style={{backgroundColor: 'transparent'}}
85
             />
85
             />
86
           )}
86
           )}

Loading…
Cancel
Save