Browse Source

Improve list icon handling

Arnaud Vergnet 3 years ago
parent
commit
d133ea30a5

+ 8
- 4
src/components/Amicale/Vote/VoteResults.js View File

13
 import i18n from 'i18n-js';
13
 import i18n from 'i18n-js';
14
 import type {VoteTeamType} from '../../../screens/Amicale/VoteScreen';
14
 import type {VoteTeamType} from '../../../screens/Amicale/VoteScreen';
15
 import type {CustomThemeType} from '../../../managers/ThemeManager';
15
 import type {CustomThemeType} from '../../../managers/ThemeManager';
16
+import type {
17
+  CardTitleIconPropsType,
18
+  ListIconPropsType,
19
+} from '../../../constants/PaperStyles';
16
 
20
 
17
 type PropsType = {
21
 type PropsType = {
18
   teams: Array<VoteTeamType>,
22
   teams: Array<VoteTeamType>,
78
         <List.Item
82
         <List.Item
79
           title={item.name}
83
           title={item.name}
80
           description={`${item.votes} ${i18n.t('screens.vote.results.votes')}`}
84
           description={`${item.votes} ${i18n.t('screens.vote.results.votes')}`}
81
-          left={({size}: {size: number}): React.Node =>
85
+          left={(iconProps: ListIconPropsType): React.Node =>
82
             isWinner ? (
86
             isWinner ? (
83
               <List.Icon
87
               <List.Icon
84
-                size={size}
88
+                style={iconProps.style}
85
                 icon={isDraw ? 'trophy-outline' : 'trophy'}
89
                 icon={isDraw ? 'trophy-outline' : 'trophy'}
86
                 color={props.theme.colors.primary}
90
                 color={props.theme.colors.primary}
87
               />
91
               />
111
           subtitle={`${i18n.t('screens.vote.results.subtitle')} ${
115
           subtitle={`${i18n.t('screens.vote.results.subtitle')} ${
112
             props.dateEnd
116
             props.dateEnd
113
           }`}
117
           }`}
114
-          left={({size}: {size: number}): React.Node => (
115
-            <Avatar.Icon size={size} icon="podium-gold" />
118
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
119
+            <Avatar.Icon size={iconProps.size} icon="podium-gold" />
116
           )}
120
           )}
117
         />
121
         />
118
         <Card.Content>
122
         <Card.Content>

+ 3
- 2
src/components/Amicale/Vote/VoteSelect.js View File

8
 import LoadingConfirmDialog from '../../Dialogs/LoadingConfirmDialog';
8
 import LoadingConfirmDialog from '../../Dialogs/LoadingConfirmDialog';
9
 import ErrorDialog from '../../Dialogs/ErrorDialog';
9
 import ErrorDialog from '../../Dialogs/ErrorDialog';
10
 import type {VoteTeamType} from '../../../screens/Amicale/VoteScreen';
10
 import type {VoteTeamType} from '../../../screens/Amicale/VoteScreen';
11
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
11
 
12
 
12
 type PropsType = {
13
 type PropsType = {
13
   teams: Array<VoteTeamType>,
14
   teams: Array<VoteTeamType>,
99
           <Card.Title
100
           <Card.Title
100
             title={i18n.t('screens.vote.select.title')}
101
             title={i18n.t('screens.vote.select.title')}
101
             subtitle={i18n.t('screens.vote.select.subtitle')}
102
             subtitle={i18n.t('screens.vote.select.subtitle')}
102
-            left={({size}: {size: number}): React.Node => (
103
-              <Avatar.Icon size={size} icon="alert-decagram" />
103
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
104
+              <Avatar.Icon size={iconProps.size} icon="alert-decagram" />
104
             )}
105
             )}
105
           />
106
           />
106
           <Card.Content>
107
           <Card.Content>

+ 3
- 2
src/components/Amicale/Vote/VoteTease.js View File

4
 import {Avatar, Card, Paragraph} from 'react-native-paper';
4
 import {Avatar, Card, Paragraph} from 'react-native-paper';
5
 import {StyleSheet} from 'react-native';
5
 import {StyleSheet} from 'react-native';
6
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
7
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
7
 
8
 
8
 type PropsType = {
9
 type PropsType = {
9
   startDate: string,
10
   startDate: string,
30
         <Card.Title
31
         <Card.Title
31
           title={i18n.t('screens.vote.tease.title')}
32
           title={i18n.t('screens.vote.tease.title')}
32
           subtitle={i18n.t('screens.vote.tease.subtitle')}
33
           subtitle={i18n.t('screens.vote.tease.subtitle')}
33
-          left={({size}: {size: number}): React.Node => (
34
-            <Avatar.Icon size={size} icon="vote" />
34
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
35
+            <Avatar.Icon size={iconProps.size} icon="vote" />
35
           )}
36
           )}
36
         />
37
         />
37
         <Card.Content>
38
         <Card.Content>

+ 4
- 8
src/components/Amicale/Vote/VoteWait.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {
5
-  ActivityIndicator,
6
-  Card,
7
-  Paragraph,
8
-  withTheme,
9
-} from 'react-native-paper';
4
+import {Avatar, Card, Paragraph, withTheme} from 'react-native-paper';
10
 import {StyleSheet} from 'react-native';
5
 import {StyleSheet} from 'react-native';
11
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
12
 import type {CustomThemeType} from '../../../managers/ThemeManager';
7
 import type {CustomThemeType} from '../../../managers/ThemeManager';
8
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
13
 
9
 
14
 type PropsType = {
10
 type PropsType = {
15
   startDate: string | null,
11
   startDate: string | null,
45
               : i18n.t('screens.vote.wait.titleEnded')
41
               : i18n.t('screens.vote.wait.titleEnded')
46
           }
42
           }
47
           subtitle={i18n.t('screens.vote.wait.subtitle')}
43
           subtitle={i18n.t('screens.vote.wait.subtitle')}
48
-          left={({size}: {size: number}): React.Node => (
49
-            <ActivityIndicator size={size} />
44
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
45
+            <Avatar.Icon size={iconProps.size} icon="progress-check" />
50
           )}
46
           )}
51
         />
47
         />
52
         <Card.Content>
48
         <Card.Content>

+ 4
- 4
src/components/Animations/AnimatedAccordion.js View File

6
 import Collapsible from 'react-native-collapsible';
6
 import Collapsible from 'react-native-collapsible';
7
 import * as Animatable from 'react-native-animatable';
7
 import * as Animatable from 'react-native-animatable';
8
 import type {CustomThemeType} from '../../managers/ThemeManager';
8
 import type {CustomThemeType} from '../../managers/ThemeManager';
9
+import type {ListIconPropsType} from '../../constants/PaperStyles';
9
 
10
 
10
 type PropsType = {
11
 type PropsType = {
11
   theme: CustomThemeType,
12
   theme: CustomThemeType,
91
           subtitle={props.subtitle}
92
           subtitle={props.subtitle}
92
           titleStyle={state.expanded ? {color: colors.primary} : null}
93
           titleStyle={state.expanded ? {color: colors.primary} : null}
93
           onPress={this.toggleAccordion}
94
           onPress={this.toggleAccordion}
94
-          right={({size}: {size: number}): React.Node => (
95
+          right={(iconProps: ListIconPropsType): React.Node => (
95
             <AnimatedListIcon
96
             <AnimatedListIcon
96
               ref={this.chevronRef}
97
               ref={this.chevronRef}
97
-              size={size}
98
+              style={iconProps.style}
98
               icon={this.chevronIcon}
99
               icon={this.chevronIcon}
99
-              color={state.expanded ? colors.primary : null}
100
+              color={state.expanded ? colors.primary : iconProps.color}
100
               useNativeDriver
101
               useNativeDriver
101
-              style={{rotate: '0deg'}}
102
             />
102
             />
103
           )}
103
           )}
104
           left={props.left}
104
           left={props.left}

+ 15
- 6
src/components/Home/ActionsDashboardItem.js View File

6
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
7
 import {StackNavigationProp} from '@react-navigation/stack';
7
 import {StackNavigationProp} from '@react-navigation/stack';
8
 import type {CustomThemeType} from '../../managers/ThemeManager';
8
 import type {CustomThemeType} from '../../managers/ThemeManager';
9
+import type {ListIconPropsType} from '../../constants/PaperStyles';
9
 
10
 
10
 type PropsType = {
11
 type PropsType = {
11
   navigation: StackNavigationProp,
12
   navigation: StackNavigationProp,
19
   }
20
   }
20
 
21
 
21
   render(): React.Node {
22
   render(): React.Node {
22
-    const {props} = this;
23
+    const {navigation} = this.props;
23
     return (
24
     return (
24
       <View>
25
       <View>
25
         <List.Item
26
         <List.Item
26
           title={i18n.t('screens.feedback.homeButtonTitle')}
27
           title={i18n.t('screens.feedback.homeButtonTitle')}
27
           description={i18n.t('screens.feedback.homeButtonSubtitle')}
28
           description={i18n.t('screens.feedback.homeButtonSubtitle')}
28
-          left={({size}: {size: number}): React.Node => (
29
-            <List.Icon size={size} icon="comment-quote" />
29
+          left={(props: ListIconPropsType): React.Node => (
30
+            <List.Icon
31
+              color={props.color}
32
+              style={props.style}
33
+              icon="comment-quote"
34
+            />
30
           )}
35
           )}
31
-          right={({size}: {size: number}): React.Node => (
32
-            <List.Icon size={size} icon="chevron-right" />
36
+          right={(props: ListIconPropsType): React.Node => (
37
+            <List.Icon
38
+              color={props.color}
39
+              style={props.style}
40
+              icon="chevron-right"
41
+            />
33
           )}
42
           )}
34
-          onPress={(): void => props.navigation.navigate('feedback')}
43
+          onPress={(): void => navigation.navigate('feedback')}
35
           style={{
44
           style={{
36
             paddingTop: 0,
45
             paddingTop: 0,
37
             paddingBottom: 0,
46
             paddingBottom: 0,

+ 3
- 2
src/components/Home/EventDashboardItem.js View File

11
 import {StyleSheet, View} from 'react-native';
11
 import {StyleSheet, View} from 'react-native';
12
 import i18n from 'i18n-js';
12
 import i18n from 'i18n-js';
13
 import type {CustomThemeType} from '../../managers/ThemeManager';
13
 import type {CustomThemeType} from '../../managers/ThemeManager';
14
+import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
14
 
15
 
15
 type PropsType = {
16
 type PropsType = {
16
   eventNumber: number,
17
   eventNumber: number,
76
               titleStyle={{color: textColor}}
77
               titleStyle={{color: textColor}}
77
               subtitle={subtitle}
78
               subtitle={subtitle}
78
               subtitleStyle={{color: textColor}}
79
               subtitleStyle={{color: textColor}}
79
-              left={(): React.Node => (
80
+              left={(iconProps: CardTitleIconPropsType): React.Node => (
80
                 <Avatar.Icon
81
                 <Avatar.Icon
81
                   icon="calendar-range"
82
                   icon="calendar-range"
82
                   color={iconColor}
83
                   color={iconColor}
83
-                  size={60}
84
+                  size={iconProps.size}
84
                   style={styles.avatar}
85
                   style={styles.avatar}
85
                 />
86
                 />
86
               )}
87
               )}

+ 3
- 2
src/components/Lists/Clubs/ClubListHeader.js View File

7
 import AnimatedAccordion from '../../Animations/AnimatedAccordion';
7
 import AnimatedAccordion from '../../Animations/AnimatedAccordion';
8
 import {isItemInCategoryFilter} from '../../../utils/Search';
8
 import {isItemInCategoryFilter} from '../../../utils/Search';
9
 import type {ClubCategoryType} from '../../../screens/Amicale/Clubs/ClubListScreen';
9
 import type {ClubCategoryType} from '../../../screens/Amicale/Clubs/ClubListScreen';
10
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
10
 
11
 
11
 type PropsType = {
12
 type PropsType = {
12
   categories: Array<ClubCategoryType>,
13
   categories: Array<ClubCategoryType>,
74
       <Card style={styles.card}>
75
       <Card style={styles.card}>
75
         <AnimatedAccordion
76
         <AnimatedAccordion
76
           title={i18n.t('screens.clubs.categories')}
77
           title={i18n.t('screens.clubs.categories')}
77
-          left={({size}: {size: number}): React.Node => (
78
-            <List.Icon size={size} icon="star" />
78
+          left={(props: ListIconPropsType): React.Node => (
79
+            <List.Icon color={props.color} style={props.style} icon="star" />
79
           )}
80
           )}
80
           opened>
81
           opened>
81
           <Text style={styles.text}>
82
           <Text style={styles.text}>

+ 13
- 12
src/components/Lists/DashboardEdit/DashboardEditItem.js View File

5
 import {List, withTheme} from 'react-native-paper';
5
 import {List, withTheme} from 'react-native-paper';
6
 import type {CustomThemeType} from '../../../managers/ThemeManager';
6
 import type {CustomThemeType} from '../../../managers/ThemeManager';
7
 import type {ServiceItemType} from '../../../managers/ServicesManager';
7
 import type {ServiceItemType} from '../../../managers/ServicesManager';
8
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
8
 
9
 
9
 type PropsType = {
10
 type PropsType = {
10
   item: ServiceItemType,
11
   item: ServiceItemType,
21
   }
22
   }
22
 
23
 
23
   render(): React.Node {
24
   render(): React.Node {
24
-    const {props} = this;
25
+    const {item, onPress, height, isActive, theme} = this.props;
25
     return (
26
     return (
26
       <List.Item
27
       <List.Item
27
-        title={props.item.title}
28
-        description={props.item.subtitle}
29
-        onPress={props.isActive ? null : props.onPress}
28
+        title={item.title}
29
+        description={item.subtitle}
30
+        onPress={isActive ? null : onPress}
30
         left={(): React.Node => (
31
         left={(): React.Node => (
31
           <Image
32
           <Image
32
-            source={{uri: props.item.image}}
33
+            source={{uri: item.image}}
33
             style={{
34
             style={{
34
               width: 40,
35
               width: 40,
35
               height: 40,
36
               height: 40,
36
             }}
37
             }}
37
           />
38
           />
38
         )}
39
         )}
39
-        right={({size}: {size: number}): React.Node =>
40
-          props.isActive ? (
40
+        right={(props: ListIconPropsType): React.Node =>
41
+          isActive ? (
41
             <List.Icon
42
             <List.Icon
42
-              size={size}
43
+              style={props.style}
43
               icon="check"
44
               icon="check"
44
-              color={props.theme.colors.success}
45
+              color={theme.colors.success}
45
             />
46
             />
46
           ) : null
47
           ) : null
47
         }
48
         }
48
         style={{
49
         style={{
49
-          height: props.height,
50
+          height,
50
           justifyContent: 'center',
51
           justifyContent: 'center',
51
           paddingLeft: 30,
52
           paddingLeft: 30,
52
-          backgroundColor: props.isActive
53
-            ? props.theme.colors.proxiwashFinishedColor
53
+          backgroundColor: isActive
54
+            ? theme.colors.proxiwashFinishedColor
54
             : 'transparent',
55
             : 'transparent',
55
         }}
56
         }}
56
       />
57
       />

+ 3
- 2
src/components/Lists/PlanexGroups/GroupListAccordion.js View File

11
   PlanexGroupCategoryType,
11
   PlanexGroupCategoryType,
12
 } from '../../../screens/Planex/GroupSelectionScreen';
12
 } from '../../../screens/Planex/GroupSelectionScreen';
13
 import type {CustomThemeType} from '../../../managers/ThemeManager';
13
 import type {CustomThemeType} from '../../../managers/ThemeManager';
14
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
14
 
15
 
15
 type PropsType = {
16
 type PropsType = {
16
   item: PlanexGroupCategoryType,
17
   item: PlanexGroupCategoryType,
87
             height: props.height,
88
             height: props.height,
88
             justifyContent: 'center',
89
             justifyContent: 'center',
89
           }}
90
           }}
90
-          left={({size}: {size: number}): React.Node =>
91
+          left={(iconProps: ListIconPropsType): React.Node =>
91
             item.id === 0 ? (
92
             item.id === 0 ? (
92
               <List.Icon
93
               <List.Icon
93
-                size={size}
94
+                style={iconProps.style}
94
                 icon="star"
95
                 icon="star"
95
                 color={props.theme.colors.tetrisScore}
96
                 color={props.theme.colors.tetrisScore}
96
               />
97
               />

+ 7
- 2
src/components/Lists/PlanexGroups/GroupListItem.js View File

5
 import * as Animatable from 'react-native-animatable';
5
 import * as Animatable from 'react-native-animatable';
6
 import type {CustomThemeType} from '../../../managers/ThemeManager';
6
 import type {CustomThemeType} from '../../../managers/ThemeManager';
7
 import type {PlanexGroupType} from '../../../screens/Planex/GroupSelectionScreen';
7
 import type {PlanexGroupType} from '../../../screens/Planex/GroupSelectionScreen';
8
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
8
 
9
 
9
 type PropsType = {
10
 type PropsType = {
10
   theme: CustomThemeType,
11
   theme: CustomThemeType,
61
       <List.Item
62
       <List.Item
62
         title={props.item.name.replace(REPLACE_REGEX, ' ')}
63
         title={props.item.name.replace(REPLACE_REGEX, ' ')}
63
         onPress={props.onPress}
64
         onPress={props.onPress}
64
-        left={({size}: {size: number}): React.Node => (
65
-          <List.Icon size={size} icon="chevron-right" />
65
+        left={(iconProps: ListIconPropsType): React.Node => (
66
+          <List.Icon
67
+            color={iconProps.color}
68
+            style={iconProps.style}
69
+            icon="chevron-right"
70
+          />
66
         )}
71
         )}
67
         right={({size, color}: {size: number, color: string}): React.Node => (
72
         right={({size, color}: {size: number, color: string}): React.Node => (
68
           <Animatable.View ref={this.starRef} useNativeDriver>
73
           <Animatable.View ref={this.starRef} useNativeDriver>

+ 12
- 0
src/constants/PaperStyles.js View File

1
+// @flow
2
+
3
+import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
4
+
5
+export type ListIconPropsType = {
6
+  color: string,
7
+  style: ViewStyleProp,
8
+};
9
+
10
+export type CardTitleIconPropsType = {
11
+  size: number,
12
+};

+ 17
- 18
src/screens/About/AboutScreen.js View File

8
 import packageJson from '../../../package.json';
8
 import packageJson from '../../../package.json';
9
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
9
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
10
 import APP_LOGO from '../../../assets/android.icon.png';
10
 import APP_LOGO from '../../../assets/android.icon.png';
11
+import type {
12
+  CardTitleIconPropsType,
13
+  ListIconPropsType,
14
+} from '../../constants/PaperStyles';
11
 
15
 
12
 type ListItemType = {
16
 type ListItemType = {
13
   onPressCallback: () => void,
17
   onPressCallback: () => void,
217
         <Card.Title
221
         <Card.Title
218
           title="Campus"
222
           title="Campus"
219
           subtitle={packageJson.version}
223
           subtitle={packageJson.version}
220
-          left={({size}: {size: number}): React.Node => (
224
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
221
             <Avatar.Image
225
             <Avatar.Image
222
-              size={size}
226
+              size={iconProps.size}
223
               source={APP_LOGO}
227
               source={APP_LOGO}
224
               style={{backgroundColor: 'transparent'}}
228
               style={{backgroundColor: 'transparent'}}
225
             />
229
             />
246
       <Card style={{marginBottom: 10}}>
250
       <Card style={{marginBottom: 10}}>
247
         <Card.Title
251
         <Card.Title
248
           title={i18n.t('screens.about.team')}
252
           title={i18n.t('screens.about.team')}
249
-          left={({size, color}: {size: number, color: string}): React.Node => (
250
-            <Avatar.Icon size={size} color={color} icon="account-multiple" />
253
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
254
+            <Avatar.Icon size={iconProps.size} icon="account-multiple" />
251
           )}
255
           )}
252
         />
256
         />
253
         <Card.Content>
257
         <Card.Content>
296
    * @param props
300
    * @param props
297
    * @return {*}
301
    * @return {*}
298
    */
302
    */
299
-  static getChevronIcon({
300
-    size,
301
-    color,
302
-  }: {
303
-    size: number,
304
-    color: string,
305
-  }): React.Node {
306
-    return <List.Icon size={size} color={color} icon="chevron-right" />;
303
+  static getChevronIcon(props: ListIconPropsType): React.Node {
304
+    return (
305
+      <List.Icon color={props.color} style={props.style} icon="chevron-right" />
306
+    );
307
   }
307
   }
308
 
308
 
309
   /**
309
   /**
313
    * @param props
313
    * @param props
314
    * @return {*}
314
    * @return {*}
315
    */
315
    */
316
-  static getItemIcon(
317
-    item: ListItemType,
318
-    {size, color}: {size: number, color: string},
319
-  ): React.Node {
320
-    return <List.Icon size={size} color={color} icon={item.icon} />;
316
+  static getItemIcon(item: ListItemType, props: ListIconPropsType): React.Node {
317
+    return (
318
+      <List.Icon color={props.color} style={props.style} icon={item.icon} />
319
+    );
321
   }
320
   }
322
 
321
 
323
   /**
322
   /**
326
    * @returns {*}
325
    * @returns {*}
327
    */
326
    */
328
   getCardItem = ({item}: {item: ListItemType}): React.Node => {
327
   getCardItem = ({item}: {item: ListItemType}): React.Node => {
329
-    const getItemIcon = (props: {size: number, color: string}): React.Node =>
328
+    const getItemIcon = (props: ListIconPropsType): React.Node =>
330
       AboutScreen.getItemIcon(item, props);
329
       AboutScreen.getItemIcon(item, props);
331
     if (item.showChevron) {
330
     if (item.showChevron) {
332
       return (
331
       return (

+ 19
- 19
src/screens/Amicale/AmicaleContactScreen.js View File

2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
 import {FlatList, Image, Linking, View} from 'react-native';
4
 import {FlatList, Image, Linking, View} from 'react-native';
5
-import {Card, List, Text, withTheme} from 'react-native-paper';
5
+import {Card, List, Text, withTheme, Avatar} from 'react-native-paper';
6
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
7
 import type {MaterialCommunityIconsGlyphs} from 'react-native-vector-icons/MaterialCommunityIcons';
7
 import type {MaterialCommunityIconsGlyphs} from 'react-native-vector-icons/MaterialCommunityIcons';
8
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
8
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
9
 import AMICALE_LOGO from '../../../assets/amicale.png';
9
 import AMICALE_LOGO from '../../../assets/amicale.png';
10
+import type {
11
+  CardTitleIconPropsType,
12
+  ListIconPropsType,
13
+} from '../../constants/PaperStyles';
10
 
14
 
11
 type DatasetItemType = {
15
 type DatasetItemType = {
12
   name: string,
16
   name: string,
74
 
78
 
75
   keyExtractor = (item: DatasetItemType): string => item.email;
79
   keyExtractor = (item: DatasetItemType): string => item.email;
76
 
80
 
77
-  getChevronIcon = ({
78
-    size,
79
-    color,
80
-  }: {
81
-    size: number,
82
-    color: string,
83
-  }): React.Node => (
84
-    <List.Icon size={size} color={color} icon="chevron-right" />
81
+  getChevronIcon = (iconProps: ListIconPropsType): React.Node => (
82
+    <List.Icon
83
+      color={iconProps.color}
84
+      style={iconProps.style}
85
+      icon="chevron-right"
86
+    />
85
   );
87
   );
86
 
88
 
87
   getRenderItem = ({item}: {item: DatasetItemType}): React.Node => {
89
   getRenderItem = ({item}: {item: DatasetItemType}): React.Node => {
92
       <List.Item
94
       <List.Item
93
         title={item.name}
95
         title={item.name}
94
         description={item.email}
96
         description={item.email}
95
-        left={({size, color}: {size: number, color: string}): React.Node => (
96
-          <List.Icon size={size} color={color} icon={item.icon} />
97
+        left={(iconProps: ListIconPropsType): React.Node => (
98
+          <List.Icon
99
+            color={iconProps.color}
100
+            style={iconProps.style}
101
+            icon={item.icon}
102
+          />
97
         )}
103
         )}
98
         right={this.getChevronIcon}
104
         right={this.getChevronIcon}
99
         onPress={onPress}
105
         onPress={onPress}
123
           <Card.Title
129
           <Card.Title
124
             title={i18n.t('screens.amicaleAbout.title')}
130
             title={i18n.t('screens.amicaleAbout.title')}
125
             subtitle={i18n.t('screens.amicaleAbout.subtitle')}
131
             subtitle={i18n.t('screens.amicaleAbout.subtitle')}
126
-            left={({
127
-              size,
128
-              color,
129
-            }: {
130
-              size: number,
131
-              color: string,
132
-            }): React.Node => (
133
-              <List.Icon size={size} color={color} icon="information" />
132
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
133
+              <Avatar.Icon size={iconProps.size} icon="information" />
134
             )}
134
             )}
135
           />
135
           />
136
           <Card.Content>
136
           <Card.Content>

+ 4
- 3
src/screens/Amicale/Clubs/ClubAboutScreen.js View File

2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
 import {Image, View} from 'react-native';
4
 import {Image, View} from 'react-native';
5
-import {Card, List, Text, withTheme} from 'react-native-paper';
5
+import {Card, Avatar, Text, withTheme} from 'react-native-paper';
6
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
7
 import Autolink from 'react-native-autolink';
7
 import Autolink from 'react-native-autolink';
8
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
8
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
9
 import AMICALE_ICON from '../../../../assets/amicale.png';
9
 import AMICALE_ICON from '../../../../assets/amicale.png';
10
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
10
 
11
 
11
 const CONTACT_LINK = 'clubs@amicale-insat.fr';
12
 const CONTACT_LINK = 'clubs@amicale-insat.fr';
12
 
13
 
35
           <Card.Title
36
           <Card.Title
36
             title={i18n.t('screens.clubs.about.title')}
37
             title={i18n.t('screens.clubs.about.title')}
37
             subtitle={i18n.t('screens.clubs.about.subtitle')}
38
             subtitle={i18n.t('screens.clubs.about.subtitle')}
38
-            left={({size}: {size: number}): React.Node => (
39
-              <List.Icon size={size} icon="information" />
39
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
40
+              <Avatar.Icon size={iconProps.size} icon="information" />
40
             )}
41
             )}
41
           />
42
           />
42
           <Card.Content>
43
           <Card.Content>

+ 3
- 2
src/screens/Amicale/Clubs/ClubDisplayScreen.js View File

21
 import {ERROR_TYPE} from '../../../utils/WebData';
21
 import {ERROR_TYPE} from '../../../utils/WebData';
22
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
22
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
23
 import type {ApiGenericDataType} from '../../../utils/WebData';
23
 import type {ApiGenericDataType} from '../../../utils/WebData';
24
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
24
 
25
 
25
 type PropsType = {
26
 type PropsType = {
26
   navigation: StackNavigationProp,
27
   navigation: StackNavigationProp,
133
               ? i18n.t('screens.clubs.managersSubtitle')
134
               ? i18n.t('screens.clubs.managersSubtitle')
134
               : i18n.t('screens.clubs.managersUnavailable')
135
               : i18n.t('screens.clubs.managersUnavailable')
135
           }
136
           }
136
-          left={({size}: {size: number}): React.Node => (
137
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
137
             <Avatar.Icon
138
             <Avatar.Icon
138
-              size={size}
139
+              size={iconProps.size}
139
               style={{backgroundColor: 'transparent'}}
140
               style={{backgroundColor: 'transparent'}}
140
               color={
141
               color={
141
                 hasManagers
142
                 hasManagers

+ 23
- 15
src/screens/Amicale/ProfileScreen.js View File

25
 import ServicesManager, {SERVICES_KEY} from '../../managers/ServicesManager';
25
 import ServicesManager, {SERVICES_KEY} from '../../managers/ServicesManager';
26
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
26
 import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
27
 import type {ServiceItemType} from '../../managers/ServicesManager';
27
 import type {ServiceItemType} from '../../managers/ServicesManager';
28
+import type {
29
+  CardTitleIconPropsType,
30
+  ListIconPropsType,
31
+} from '../../constants/PaperStyles';
28
 
32
 
29
 type PropsType = {
33
 type PropsType = {
30
   navigation: StackNavigationProp,
34
   navigation: StackNavigationProp,
229
       <List.Item
233
       <List.Item
230
         title={title}
234
         title={title}
231
         description={subtitle}
235
         description={subtitle}
232
-        left={({size}: {size: number}): React.Node => (
236
+        left={(props: ListIconPropsType): React.Node => (
233
           <List.Icon
237
           <List.Icon
234
-            size={size}
238
+            style={props.style}
235
             icon={icon}
239
             icon={icon}
236
-            color={field != null ? null : theme.colors.textDisabled}
240
+            color={field != null ? props.color : theme.colors.textDisabled}
237
           />
241
           />
238
         )}
242
         )}
239
       />
243
       />
252
         <Card.Title
256
         <Card.Title
253
           title={`${this.data.first_name} ${this.data.last_name}`}
257
           title={`${this.data.first_name} ${this.data.last_name}`}
254
           subtitle={this.data.email}
258
           subtitle={this.data.email}
255
-          left={({size}: {size: number}): React.Node => (
259
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
256
             <Avatar.Icon
260
             <Avatar.Icon
257
-              size={size}
261
+              size={iconProps.size}
258
               icon="account"
262
               icon="account"
259
               color={theme.colors.primary}
263
               color={theme.colors.primary}
260
               style={styles.icon}
264
               style={styles.icon}
305
         <Card.Title
309
         <Card.Title
306
           title={i18n.t('screens.profile.clubs')}
310
           title={i18n.t('screens.profile.clubs')}
307
           subtitle={i18n.t('screens.profile.clubsSubtitle')}
311
           subtitle={i18n.t('screens.profile.clubsSubtitle')}
308
-          left={({size}: {size: number}): React.Node => (
312
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
309
             <Avatar.Icon
313
             <Avatar.Icon
310
-              size={size}
314
+              size={iconProps.size}
311
               icon="account-group"
315
               icon="account-group"
312
               color={theme.colors.primary}
316
               color={theme.colors.primary}
313
               style={styles.icon}
317
               style={styles.icon}
334
         <Card.Title
338
         <Card.Title
335
           title={i18n.t('screens.profile.membership')}
339
           title={i18n.t('screens.profile.membership')}
336
           subtitle={i18n.t('screens.profile.membershipSubtitle')}
340
           subtitle={i18n.t('screens.profile.membershipSubtitle')}
337
-          left={({size}: {size: number}): React.Node => (
341
+          left={(iconProps: CardTitleIconPropsType): React.Node => (
338
             <Avatar.Icon
342
             <Avatar.Icon
339
-              size={size}
343
+              size={iconProps.size}
340
               icon="credit-card"
344
               icon="credit-card"
341
               color={theme.colors.primary}
345
               color={theme.colors.primary}
342
               style={styles.icon}
346
               style={styles.icon}
366
             ? i18n.t('screens.profile.membershipPayed')
370
             ? i18n.t('screens.profile.membershipPayed')
367
             : i18n.t('screens.profile.membershipNotPayed')
371
             : i18n.t('screens.profile.membershipNotPayed')
368
         }
372
         }
369
-        left={({size}: {size: number}): React.Node => (
373
+        left={(props: ListIconPropsType): React.Node => (
370
           <List.Icon
374
           <List.Icon
371
-            size={size}
375
+            style={props.style}
372
             color={state ? theme.colors.success : theme.colors.danger}
376
             color={state ? theme.colors.success : theme.colors.danger}
373
             icon={state ? 'check' : 'close'}
377
             icon={state ? 'check' : 'close'}
374
           />
378
           />
389
       this.openClubDetailsScreen(item.id);
393
       this.openClubDetailsScreen(item.id);
390
     };
394
     };
391
     let description = i18n.t('screens.profile.isMember');
395
     let description = i18n.t('screens.profile.isMember');
392
-    let icon = ({size, color}: {size: number, color: string}): React.Node => (
393
-      <List.Icon size={size} color={color} icon="chevron-right" />
396
+    let icon = (props: ListIconPropsType): React.Node => (
397
+      <List.Icon color={props.color} style={props.style} icon="chevron-right" />
394
     );
398
     );
395
     if (item.is_manager) {
399
     if (item.is_manager) {
396
       description = i18n.t('screens.profile.isManager');
400
       description = i18n.t('screens.profile.isManager');
397
-      icon = ({size}: {size: number}): React.Node => (
398
-        <List.Icon size={size} icon="star" color={theme.colors.primary} />
401
+      icon = (props: ListIconPropsType): React.Node => (
402
+        <List.Icon
403
+          style={props.style}
404
+          icon="star"
405
+          color={theme.colors.primary}
406
+        />
399
       );
407
       );
400
     }
408
     }
401
     return (
409
     return (

+ 5
- 16
src/screens/Other/FeedbackScreen.js View File

6
 import {Linking} from 'react-native';
6
 import {Linking} from 'react-native';
7
 import type {CustomThemeType} from '../../managers/ThemeManager';
7
 import type {CustomThemeType} from '../../managers/ThemeManager';
8
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
8
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
9
+import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
9
 
10
 
10
 type PropsType = {
11
 type PropsType = {
11
   theme: CustomThemeType,
12
   theme: CustomThemeType,
91
           <Card.Title
92
           <Card.Title
92
             title={i18n.t('screens.feedback.bugs')}
93
             title={i18n.t('screens.feedback.bugs')}
93
             subtitle={i18n.t('screens.feedback.bugsSubtitle')}
94
             subtitle={i18n.t('screens.feedback.bugsSubtitle')}
94
-            left={({
95
-              size,
96
-              color,
97
-            }: {
98
-              size: number,
99
-              color: number,
100
-            }): React.Node => (
101
-              <Avatar.Icon size={size} color={color} icon="bug" />
95
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
96
+              <Avatar.Icon size={iconProps.size} icon="bug" />
102
             )}
97
             )}
103
           />
98
           />
104
           <Card.Content>
99
           <Card.Content>
114
           <Card.Title
109
           <Card.Title
115
             title={i18n.t('screens.feedback.title')}
110
             title={i18n.t('screens.feedback.title')}
116
             subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
111
             subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
117
-            left={({
118
-              size,
119
-              color,
120
-            }: {
121
-              size: number,
122
-              color: number,
123
-            }): React.Node => (
124
-              <Avatar.Icon size={size} color={color} icon="comment" />
112
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
113
+              <Avatar.Icon size={iconProps.size} icon="comment" />
125
             )}
114
             )}
126
           />
115
           />
127
           <Card.Content>
116
           <Card.Content>

+ 23
- 22
src/screens/Other/Settings/SettingsScreen.js View File

11
 import AsyncStorageManager from '../../../managers/AsyncStorageManager';
11
 import AsyncStorageManager from '../../../managers/AsyncStorageManager';
12
 import CustomSlider from '../../../components/Overrides/CustomSlider';
12
 import CustomSlider from '../../../components/Overrides/CustomSlider';
13
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
13
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
14
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
14
 
15
 
15
 type PropsType = {
16
 type PropsType = {
16
   navigation: StackNavigationProp,
17
   navigation: StackNavigationProp,
171
       <List.Item
172
       <List.Item
172
         title={title}
173
         title={title}
173
         description={subtitle}
174
         description={subtitle}
174
-        left={({size, color}: {size: number, color: number}): React.Node => (
175
-          <List.Icon size={size} color={color} icon={icon} />
175
+        left={(props: ListIconPropsType): React.Node => (
176
+          <List.Icon color={props.color} style={props.style} icon={icon} />
176
         )}
177
         )}
177
         right={(): React.Node => (
178
         right={(): React.Node => (
178
           <Switch value={state} onValueChange={onPressCallback} />
179
           <Switch value={state} onValueChange={onPressCallback} />
196
         onPress={() => {
197
         onPress={() => {
197
           navigation.navigate(route);
198
           navigation.navigate(route);
198
         }}
199
         }}
199
-        left={({size, color}: {size: number, color: number}): React.Node => (
200
-          <List.Icon size={size} color={color} icon={icon} />
200
+        left={(props: ListIconPropsType): React.Node => (
201
+          <List.Icon color={props.color} style={props.style} icon={icon} />
201
         )}
202
         )}
202
-        right={({size, color}: {size: number, color: number}): React.Node => (
203
-          <List.Icon size={size} color={color} icon="chevron-right" />
203
+        right={(props: ListIconPropsType): React.Node => (
204
+          <List.Icon
205
+            color={props.color}
206
+            style={props.style}
207
+            icon="chevron-right"
208
+          />
204
         )}
209
         )}
205
         onLongPress={onLongPress}
210
         onLongPress={onLongPress}
206
       />
211
       />
249
             <List.Item
254
             <List.Item
250
               title={i18n.t('screens.settings.startScreen')}
255
               title={i18n.t('screens.settings.startScreen')}
251
               description={i18n.t('screens.settings.startScreenSub')}
256
               description={i18n.t('screens.settings.startScreenSub')}
252
-              left={({
253
-                size,
254
-                color,
255
-              }: {
256
-                size: number,
257
-                color: number,
258
-              }): React.Node => (
259
-                <List.Icon size={size} color={color} icon="power" />
257
+              left={(props: ListIconPropsType): React.Node => (
258
+                <List.Icon
259
+                  color={props.color}
260
+                  style={props.style}
261
+                  icon="power"
262
+                />
260
               )}
263
               )}
261
             />
264
             />
262
             {this.getStartScreenPicker()}
265
             {this.getStartScreenPicker()}
274
             <List.Item
277
             <List.Item
275
               title={i18n.t('screens.settings.proxiwashNotifReminder')}
278
               title={i18n.t('screens.settings.proxiwashNotifReminder')}
276
               description={i18n.t('screens.settings.proxiwashNotifReminderSub')}
279
               description={i18n.t('screens.settings.proxiwashNotifReminderSub')}
277
-              left={({
278
-                size,
279
-                color,
280
-              }: {
281
-                size: number,
282
-                color: number,
283
-              }): React.Node => (
284
-                <List.Icon size={size} color={color} icon="washing-machine" />
280
+              left={(props: ListIconPropsType): React.Node => (
281
+                <List.Icon
282
+                  color={props.color}
283
+                  style={props.style}
284
+                  icon="washing-machine"
285
+                />
285
               )}
286
               )}
286
             />
287
             />
287
             <View style={{marginLeft: 30}}>
288
             <View style={{marginLeft: 30}}>

+ 10
- 33
src/screens/Proxiwash/ProxiwashAboutScreen.js View File

3
 import * as React from 'react';
3
 import * as React from 'react';
4
 import {Image, View} from 'react-native';
4
 import {Image, View} from 'react-native';
5
 import i18n from 'i18n-js';
5
 import i18n from 'i18n-js';
6
-import {Card, List, Paragraph, Text, Title} from 'react-native-paper';
6
+import {Card, Avatar, Paragraph, Text, Title} from 'react-native-paper';
7
 import CustomTabBar from '../../components/Tabbar/CustomTabBar';
7
 import CustomTabBar from '../../components/Tabbar/CustomTabBar';
8
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
8
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
9
+import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
9
 
10
 
10
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proxiwash.png';
11
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proxiwash.png';
11
 
12
 
35
         <Card style={{margin: 5}}>
36
         <Card style={{margin: 5}}>
36
           <Card.Title
37
           <Card.Title
37
             title={i18n.t('screens.proxiwash.dryer')}
38
             title={i18n.t('screens.proxiwash.dryer')}
38
-            left={({
39
-              size,
40
-              color,
41
-            }: {
42
-              size: number,
43
-              color: string,
44
-            }): React.Node => (
45
-              <List.Icon size={size} color={color} icon="tumble-dryer" />
39
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
40
+              <Avatar.Icon size={iconProps.size} icon="tumble-dryer" />
46
             )}
41
             )}
47
           />
42
           />
48
           <Card.Content>
43
           <Card.Content>
56
         <Card style={{margin: 5}}>
51
         <Card style={{margin: 5}}>
57
           <Card.Title
52
           <Card.Title
58
             title={i18n.t('screens.proxiwash.washer')}
53
             title={i18n.t('screens.proxiwash.washer')}
59
-            left={({
60
-              size,
61
-              color,
62
-            }: {
63
-              size: number,
64
-              color: string,
65
-            }): React.Node => (
66
-              <List.Icon size={size} color={color} icon="washing-machine" />
54
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
55
+              <Avatar.Icon size={iconProps.size} icon="washing-machine" />
67
             )}
56
             )}
68
           />
57
           />
69
           <Card.Content>
58
           <Card.Content>
77
         <Card style={{margin: 5}}>
66
         <Card style={{margin: 5}}>
78
           <Card.Title
67
           <Card.Title
79
             title={i18n.t('screens.proxiwash.tariffs')}
68
             title={i18n.t('screens.proxiwash.tariffs')}
80
-            left={({
81
-              size,
82
-              color,
83
-            }: {
84
-              size: number,
85
-              color: string,
86
-            }): React.Node => (
87
-              <List.Icon size={size} color={color} icon="circle-multiple" />
69
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
70
+              <Avatar.Icon size={iconProps.size} icon="circle-multiple" />
88
             )}
71
             )}
89
           />
72
           />
90
           <Card.Content>
73
           <Card.Content>
96
           style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
79
           style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
97
           <Card.Title
80
           <Card.Title
98
             title={i18n.t('screens.proxiwash.paymentMethods')}
81
             title={i18n.t('screens.proxiwash.paymentMethods')}
99
-            left={({
100
-              size,
101
-              color,
102
-            }: {
103
-              size: number,
104
-              color: string,
105
-            }): React.Node => (
106
-              <List.Icon size={size} color={color} icon="cash" />
82
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
83
+              <Avatar.Icon size={iconProps.size} icon="cash" />
107
             )}
84
             )}
108
           />
85
           />
109
           <Card.Content>
86
           <Card.Content>

+ 6
- 17
src/screens/Services/Proximo/ProximoAboutScreen.js View File

3
 import * as React from 'react';
3
 import * as React from 'react';
4
 import {Image, View} from 'react-native';
4
 import {Image, View} from 'react-native';
5
 import i18n from 'i18n-js';
5
 import i18n from 'i18n-js';
6
-import {Card, List, Paragraph, Text} from 'react-native-paper';
6
+import {Card, Avatar, Paragraph, Text} from 'react-native-paper';
7
 import CustomTabBar from '../../../components/Tabbar/CustomTabBar';
7
 import CustomTabBar from '../../../components/Tabbar/CustomTabBar';
8
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
8
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';
9
+import type {CardTitleIconPropsType} from '../../../constants/PaperStyles';
9
 
10
 
10
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proximo.png';
11
 const LOGO = 'https://etud.insa-toulouse.fr/~amicale_app/images/Proximo.png';
11
 
12
 
35
         <Card style={{margin: 5}}>
36
         <Card style={{margin: 5}}>
36
           <Card.Title
37
           <Card.Title
37
             title={i18n.t('screens.proximo.openingHours')}
38
             title={i18n.t('screens.proximo.openingHours')}
38
-            left={({
39
-              size,
40
-              color,
41
-            }: {
42
-              size: number,
43
-              color: string,
44
-            }): React.Node => (
45
-              <List.Icon size={size} color={color} icon="clock-outline" />
39
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
40
+              <Avatar.Icon size={iconProps.size} icon="clock-outline" />
46
             )}
41
             )}
47
           />
42
           />
48
           <Card.Content>
43
           <Card.Content>
53
           style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
48
           style={{margin: 5, marginBottom: CustomTabBar.TAB_BAR_HEIGHT + 20}}>
54
           <Card.Title
49
           <Card.Title
55
             title={i18n.t('screens.proximo.paymentMethods')}
50
             title={i18n.t('screens.proximo.paymentMethods')}
56
-            left={({
57
-              size,
58
-              color,
59
-            }: {
60
-              size: number,
61
-              color: string,
62
-            }): React.Node => (
63
-              <List.Icon size={size} color={color} icon="cash" />
51
+            left={(iconProps: CardTitleIconPropsType): React.Node => (
52
+              <Avatar.Icon size={iconProps.size} icon="cash" />
64
             )}
53
             )}
65
           />
54
           />
66
           <Card.Content>
55
           <Card.Content>

+ 9
- 4
src/screens/Services/Proximo/ProximoMainScreen.js View File

10
 } from '../../../components/Overrides/CustomHeaderButton';
10
 } from '../../../components/Overrides/CustomHeaderButton';
11
 import type {CustomThemeType} from '../../../managers/ThemeManager';
11
 import type {CustomThemeType} from '../../../managers/ThemeManager';
12
 import type {SectionListDataType} from '../../../components/Screens/WebSectionList';
12
 import type {SectionListDataType} from '../../../components/Screens/WebSectionList';
13
+import type {ListIconPropsType} from '../../../constants/PaperStyles';
13
 
14
 
14
 const DATA_URL = 'https://etud.insa-toulouse.fr/~proximo/data/stock-v2.json';
15
 const DATA_URL = 'https://etud.insa-toulouse.fr/~proximo/data/stock-v2.json';
15
 const LIST_ITEM_HEIGHT = 84;
16
 const LIST_ITEM_HEIGHT = 84;
199
           title={item.type.name}
200
           title={item.type.name}
200
           description={subtitle}
201
           description={subtitle}
201
           onPress={onPress}
202
           onPress={onPress}
202
-          left={({size}: {size: number}): React.Node => (
203
+          left={(props: ListIconPropsType): React.Node => (
203
             <List.Icon
204
             <List.Icon
204
-              size={size}
205
+              style={props.style}
205
               icon={item.type.icon}
206
               icon={item.type.icon}
206
               color={theme.colors.primary}
207
               color={theme.colors.primary}
207
             />
208
             />
208
           )}
209
           )}
209
-          right={({size, color}: {size: number, color: string}): React.Node => (
210
-            <List.Icon size={size} color={color} icon="chevron-right" />
210
+          right={(props: ListIconPropsType): React.Node => (
211
+            <List.Icon
212
+              color={props.color}
213
+              style={props.style}
214
+              icon="chevron-right"
215
+            />
211
           )}
216
           )}
212
           style={{
217
           style={{
213
             height: LIST_ITEM_HEIGHT,
218
             height: LIST_ITEM_HEIGHT,

+ 1
- 3
src/screens/Services/ServicesScreen.js View File

118
             title={item.title}
118
             title={item.title}
119
             subtitle={item.subtitle}
119
             subtitle={item.subtitle}
120
             left={(): React.Node => this.getListTitleImage(item.image)}
120
             left={(): React.Node => this.getListTitleImage(item.image)}
121
-            right={({size}: {size: number}): React.Node => (
122
-              <List.Icon size={size} icon="chevron-right" />
123
-            )}
121
+            right={(): React.Node => <List.Icon icon="chevron-right" />}
124
           />
122
           />
125
           <CardList dataset={item.content} isHorizontal />
123
           <CardList dataset={item.content} isHorizontal />
126
         </View>
124
         </View>

Loading…
Cancel
Save