Browse Source

Changed sections icons

Arnaud Vergnet 4 years ago
parent
commit
524dd5362a
1 changed files with 16 additions and 6 deletions
  1. 16
    6
      src/screens/Services/ServicesScreen.js

+ 16
- 6
src/screens/Services/ServicesScreen.js View File

@@ -8,12 +8,14 @@ import {withCollapsible} from "../../utils/withCollapsible";
8 8
 import {Collapsible} from "react-navigation-collapsible";
9 9
 import {CommonActions} from "@react-navigation/native";
10 10
 import {Animated, View} from "react-native";
11
-import {Avatar, Card, Divider, List, TouchableRipple} from "react-native-paper";
11
+import {Avatar, Card, Divider, List, TouchableRipple, withTheme} from "react-native-paper";
12
+import type {CustomTheme} from "../../managers/ThemeManager";
12 13
 
13 14
 type Props = {
14 15
     navigation: Object,
15 16
     route: Object,
16 17
     collapsibleStack: Collapsible,
18
+    theme: CustomTheme,
17 19
 }
18 20
 const BIB_IMAGE = "https://scontent-cdg2-1.xx.fbcdn.net/v/t1.0-9/50695561_2124263197597162_2325349608210825216_n.jpg?_nc_cat=109&_nc_sid=8bfeb9&_nc_ohc=tmcV6FWO7_kAX9vfWHU&_nc_ht=scontent-cdg2-1.xx&oh=3b81c76e46b49f7c3a033ea3b07ec212&oe=5EC59B4D";
19 21
 const RU_IMAGE = "https://scontent-cdg2-1.xx.fbcdn.net/v/t1.0-9/47123773_2041883702501779_5289372776166064128_o.jpg?_nc_cat=100&_nc_sid=cdbe9c&_nc_ohc=dpuBGlIIy_EAX8CyC0l&_nc_ht=scontent-cdg2-1.xx&oh=5c5bb4f0c7f12b554246f7c9b620a5f3&oe=5EC4DB31";
@@ -151,13 +153,13 @@ class ServicesScreen extends React.Component<Props> {
151 153
             {
152 154
                 title: "STUDENTS",
153 155
                 description: "SERVICES OFFERED BY STUDENTS",
154
-                image: AMICALE_IMAGE,
156
+                image: 'account-group',
155 157
                 content: this.studentsDataset
156 158
             },
157 159
             {
158 160
                 title: "INSA",
159 161
                 description: "SERVICES OFFERED BY INSA",
160
-                image: AMICALE_IMAGE,
162
+                image: 'school',
161 163
                 content: this.insaDataset
162 164
             },
163 165
         ]
@@ -181,11 +183,19 @@ class ServicesScreen extends React.Component<Props> {
181 183
     getAvatar(props, source: string | number) {
182 184
         if (typeof source === "number")
183 185
             return <Avatar.Image
186
+                {...props}
184 187
                 size={48}
185 188
                 source={AMICALE_IMAGE}
186
-                style={{backgroundColor: 'transparent'}}/>
189
+                style={{backgroundColor: 'transparent'}}
190
+            />
187 191
         else
188
-            return <List.Icon {...props} icon={source}/>
192
+            return <Avatar.Icon
193
+                {...props}
194
+                size={48}
195
+                icon={source}
196
+                color={this.props.theme.colors.primary}
197
+                style={{backgroundColor: 'transparent'}}
198
+            />
189 199
     }
190 200
 
191 201
     renderItem = ({item}: { item: listItem }) => {
@@ -234,4 +244,4 @@ class ServicesScreen extends React.Component<Props> {
234 244
     }
235 245
 }
236 246
 
237
-export default withCollapsible(ServicesScreen);
247
+export default withCollapsible(withTheme(ServicesScreen));

Loading…
Cancel
Save