Browse Source

Fix feed item screen page source

Arnaud Vergnet 1 year 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,16 +12,14 @@ import CustomTabBar from '../../components/Tabbar/CustomTabBar';
12 12
 import type {FeedItemType} from './HomeScreen';
13 13
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
14 14
 import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
15
+import NewsSourcesConstants from '../../constants/NewsSourcesConstants';
16
+import type {NewsSourceType} from '../../constants/NewsSourcesConstants';
15 17
 
16 18
 type PropsType = {
17 19
   navigation: StackNavigationProp,
18 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 24
  * Class defining a feed item page.
27 25
  */
@@ -72,15 +70,17 @@ class FeedItemScreen extends React.Component<PropsType> {
72 70
     const {navigation} = this.props;
73 71
     const hasImage =
74 72
       this.displayData.image !== '' && this.displayData.image != null;
73
+    const pageSource: NewsSourceType =
74
+      NewsSourcesConstants[this.displayData.page_id];
75 75
     return (
76 76
       <CollapsibleScrollView style={{margin: 5}} hasTab>
77 77
         <Card.Title
78
-          title={NAME_AMICALE}
78
+          title={pageSource.name}
79 79
           subtitle={this.date}
80 80
           left={(): React.Node => (
81 81
             <Avatar.Image
82 82
               size={48}
83
-              source={ICON_AMICALE}
83
+              source={pageSource.icon}
84 84
               style={{backgroundColor: 'transparent'}}
85 85
             />
86 86
           )}

Loading…
Cancel
Save