Browse Source

Use expo material icons instead of custom class

keplyx 4 years ago
parent
commit
cec72be88c

+ 10
- 11
App.js View File

@@ -9,12 +9,11 @@ import {clearThemeCache} from 'native-base-shoutem-theme';
9 9
 import AsyncStorageManager from "./utils/AsyncStorageManager";
10 10
 import CustomIntroSlider from "./components/CustomIntroSlider";
11 11
 import {SplashScreen} from 'expo';
12
-import NotificationsManager from "./utils/NotificationsManager";
13 12
 import ThemeManager from './utils/ThemeManager';
14 13
 import { NavigationContainer } from '@react-navigation/native';
15 14
 import { createStackNavigator } from '@react-navigation/stack';
16 15
 import DrawerNavigator from './navigation/DrawerNavigator';
17
-import { enableScreens } from 'react-native-screens';
16
+import NotificationsManager from "./utils/NotificationsManager";
18 17
 
19 18
 type Props = {};
20 19
 
@@ -36,10 +35,12 @@ export default class App extends React.Component<Props, State> {
36 35
         currentTheme: null,
37 36
     };
38 37
 
39
-    constructor(props: Object) {
40
-        super(props);
38
+    onIntroDone: Function;
39
+
40
+    constructor() {
41
+        super();
41 42
         LocaleManager.initTranslations();
42
-        enableScreens();
43
+        this.onIntroDone = this.onIntroDone.bind(this);
43 44
     }
44 45
 
45 46
     /**
@@ -81,23 +82,21 @@ export default class App extends React.Component<Props, State> {
81 82
 
82 83
     async loadAssetsAsync() {
83 84
         // Wait for custom fonts to be loaded before showing the app
84
-        console.log("loading Fonts");
85
+        // console.log("loading Fonts");
85 86
         SplashScreen.preventAutoHide();
86 87
         await Font.loadAsync({
87 88
             'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
88 89
         });
89
-        console.log("loading preferences");
90
+        // console.log("loading preferences");
90 91
         await AsyncStorageManager.getInstance().loadPreferences();
91 92
         ThemeManager.getInstance().setUpdateThemeCallback(() => this.updateTheme());
92
-        console.log("loading Expo token");
93
+        // console.log("loading Expo token");
93 94
         await NotificationsManager.initExpoToken();
94
-        console.log("loaded");
95 95
         this.onLoadFinished();
96 96
     }
97 97
 
98 98
     onLoadFinished() {
99
-
100
-        console.log("finished");
99
+        // console.log("finished");
101 100
         // Only show intro if this is the first time starting the app
102 101
         this.setState({
103 102
             isLoading: false,

+ 4
- 3
components/BaseContainer.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {Container} from "native-base";
5 5
 import CustomHeader from "./CustomHeader";
6
-import CustomMaterialIcon from "./CustomMaterialIcon";
6
+import {MaterialCommunityIcons} from "@expo/vector-icons";
7 7
 import {Platform, View} from "react-native";
8 8
 import ThemeManager from "../utils/ThemeManager";
9 9
 import Touchable from "react-native-platform-touchable";
@@ -66,9 +66,10 @@ export default class BaseContainer extends React.Component<Props, State> {
66 66
                             <Touchable
67 67
                                 style={{padding: 6}}
68 68
                                 onPress={this.onDrawerPress}>
69
-                                <CustomMaterialIcon
69
+                                <MaterialCommunityIcons
70 70
                                     color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
71
-                                    icon="menu"/>
71
+                                    size={26}
72
+                                    name="menu"/>
72 73
                             </Touchable>
73 74
                         }
74 75
                         rightButton={this.props.headerRightButton}

+ 7
- 5
components/CustomHeader.js View File

@@ -6,7 +6,7 @@ import {Platform, StyleSheet, View} from "react-native";
6 6
 import {getStatusBarHeight} from "react-native-status-bar-height";
7 7
 import Touchable from 'react-native-platform-touchable';
8 8
 import ThemeManager from "../utils/ThemeManager";
9
-import CustomMaterialIcon from "./CustomMaterialIcon";
9
+import {MaterialCommunityIcons} from "@expo/vector-icons";
10 10
 import i18n from "i18n-js";
11 11
 
12 12
 type Props = {
@@ -76,8 +76,9 @@ export default class CustomHeader extends React.Component<Props> {
76 76
                         width: '100%',
77 77
                         marginBottom: 7
78 78
                     }}>
79
-                    <CustomMaterialIcon
80
-                        icon={'magnify'}
79
+                    <MaterialCommunityIcons
80
+                        name={'magnify'}
81
+                        size={26}
81 82
                         color={ThemeManager.getCurrentThemeVariables().toolbarBtnColor}/>
82 83
                     <Input
83 84
                         ref="searchInput"
@@ -116,9 +117,10 @@ export default class CustomHeader extends React.Component<Props> {
116 117
                 <Touchable
117 118
                     style={{padding: 6}}
118 119
                     onPress={this.onPressBack}>
119
-                    <CustomMaterialIcon
120
+                    <MaterialCommunityIcons
120 121
                         color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
121
-                        icon={Platform.OS === 'ios' ? 'chevron-left' : "arrow-left"}/>
122
+                        name={Platform.OS === 'ios' ? 'chevron-left' : "arrow-left"}
123
+                        size={26}/>
122 124
                 </Touchable>;
123 125
         else
124 126
             button = this.props.leftButton;

+ 5
- 2
components/CustomIntroSlider.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {LinearGradient} from "expo-linear-gradient";
5 5
 import {Image, StyleSheet, View} from "react-native";
6
-import CustomMaterialIcon from "./CustomMaterialIcon";
6
+import {MaterialCommunityIcons} from "@expo/vector-icons";
7 7
 import {Text} from "native-base";
8 8
 import i18n from 'i18n-js';
9 9
 import AppIntroSlider from "react-native-app-intro-slider";
@@ -131,7 +131,10 @@ export default class CustomIntroSlider extends React.Component<Props> {
131 131
             >
132 132
                 {item.image !== undefined ?
133 133
                     <Image source={item.image} style={styles.image}/>
134
-                    : <CustomMaterialIcon icon={item.icon} color={'#fff'} fontSize={200} width={200}/>}
134
+                    : <MaterialCommunityIcons
135
+                        name={item.icon}
136
+                        color={'#fff'}
137
+                        size={200}/>}
135 138
                 <View style={{marginTop: 20}}>
136 139
                     <Text style={styles.title}>{item.title}</Text>
137 140
                     <Text style={styles.text}>{item.text}</Text>

+ 0
- 61
components/CustomMaterialIcon.js View File

@@ -1,61 +0,0 @@
1
-// @flow
2
-
3
-import * as React from 'react';
4
-import {Icon} from "native-base";
5
-import ThemeManager from '../utils/ThemeManager';
6
-
7
-type Props = {
8
-    active: boolean,
9
-    icon: string,
10
-    color: ?string,
11
-    fontSize: number,
12
-    width: number | string,
13
-}
14
-
15
-/**
16
- * Custom component defining a material icon using native base
17
- *
18
- * @prop active {boolean} Whether to set the icon color to active
19
- * @prop icon {string} The icon string to use from MaterialCommunityIcons
20
- * @prop color {string} The icon color. Use default theme color if unspecified
21
- * @prop fontSize {number} The icon size. Use 26 if unspecified
22
- * @prop width {number} The icon width. Use 30 if unspecified
23
- */
24
-export default class CustomMaterialIcon extends React.Component<Props> {
25
-
26
-    static defaultProps = {
27
-        active: false,
28
-        color: undefined,
29
-        fontSize: 26,
30
-        width: 30,
31
-    };
32
-
33
-    shouldComponentUpdate(nextProps: Props): boolean {
34
-        return nextProps.icon !== this.props.icon ||
35
-            nextProps.active !== this.props.active ||
36
-            nextProps.width !== this.props.width ||
37
-            nextProps.fontSize !== this.props.fontSize ||
38
-            nextProps.color !== this.props.color;
39
-    }
40
-
41
-    render() {
42
-        // console.log("rendering icon " + this.props.icon);
43
-        return (
44
-            <Icon
45
-                active
46
-                name={this.props.icon}
47
-                type={'MaterialCommunityIcons'}
48
-                style={{
49
-                    color:
50
-                        this.props.color !== undefined ?
51
-                            this.props.color :
52
-                            this.props.active ?
53
-                                ThemeManager.getCurrentThemeVariables().brandPrimary :
54
-                                ThemeManager.getCurrentThemeVariables().customMaterialIconColor,
55
-                    fontSize: this.props.fontSize,
56
-                    width: this.props.width
57
-                }}
58
-            />
59
-        );
60
-    }
61
-}

+ 7
- 6
components/DashboardItem.js View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {Body, Card, CardItem, H3, Left, Text, Thumbnail} from "native-base";
5
-import CustomMaterialIcon from "./CustomMaterialIcon";
5
+import {MaterialCommunityIcons} from "@expo/vector-icons";
6 6
 import {View} from "react-native";
7 7
 import ThemeManager from "../utils/ThemeManager";
8 8
 import HTML from "react-native-render-html";
@@ -132,7 +132,9 @@ export default class DashboardItem extends React.Component<Props> {
132 132
                                     }}>
133 133
                                         {i18n.t("homeScreen.dashboard.seeMore")}
134 134
                                     </Text>
135
-                                    <CustomMaterialIcon icon={'chevron-right'}/>
135
+                                    <MaterialCommunityIcons
136
+                                        name={'chevron-right'}
137
+                                        size={26}/>
136 138
                                 </View>
137 139
                             </LinearGradient>
138 140
                         </Body>
@@ -145,15 +147,14 @@ export default class DashboardItem extends React.Component<Props> {
145 147
 
146 148
     getIcon() {
147 149
         return (
148
-            <CustomMaterialIcon
149
-                icon={this.props.icon}
150
+            <MaterialCommunityIcons
151
+                name={this.props.icon}
150 152
                 color={
151 153
                     this.props.isAvailable ?
152 154
                         this.props.color :
153 155
                         ThemeManager.getCurrentThemeVariables().textDisabledColor
154 156
                 }
155
-                fontSize={this.props.isSquare ? 50 : 40}
156
-                width={this.props.isSquare ? 50 : 40}/>
157
+                size={this.props.isSquare ? 50 : 40}/>
157 158
         );
158 159
     }
159 160
 

+ 10
- 26
components/Sidebar.js View File

@@ -1,17 +1,15 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {Dimensions, FlatList, Image, Linking, Platform, StyleSheet} from 'react-native';
5
-import {Badge, Container, Left, ListItem, Right, Text} from "native-base";
4
+import {Dimensions, FlatList, Image,Platform, StyleSheet} from 'react-native';
5
+import {Container, Left, ListItem, Text} from "native-base";
6 6
 import i18n from "i18n-js";
7
-import CustomMaterialIcon from '../components/CustomMaterialIcon';
7
+import {MaterialCommunityIcons} from "@expo/vector-icons";
8 8
 import ThemeManager from "../utils/ThemeManager";
9 9
 import * as WebBrowser from 'expo-web-browser';
10 10
 
11 11
 const deviceWidth = Dimensions.get("window").width;
12 12
 
13
-const drawerCover = require("../assets/drawer-cover.png");
14
-
15 13
 type Props = {
16 14
     navigation: Object,
17 15
 };
@@ -134,7 +132,7 @@ export default class SideBar extends React.Component<Props, State> {
134 132
 
135 133
     getRenderItem({item}: Object) {
136 134
         const onListItemPress = this.onListItemPress.bind(this, item);
137
-
135
+        // return <View/>;
138 136
         if (item.icon !== undefined) {
139 137
             return (
140 138
                 <ListItem
@@ -144,29 +142,15 @@ export default class SideBar extends React.Component<Props, State> {
144 142
                     onPress={onListItemPress}
145 143
                 >
146 144
                     <Left>
147
-                        <CustomMaterialIcon
148
-                            icon={item.icon}
149
-                            active={this.state.active === item.route}
145
+                        <MaterialCommunityIcons
146
+                            name={item.icon}
147
+                            size={26}
148
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}
150 149
                         />
151 150
                         <Text style={styles.text}>
152 151
                             {item.name}
153 152
                         </Text>
154 153
                     </Left>
155
-                    {item.types &&
156
-                    <Right style={{flex: 1}}>
157
-                        <Badge
158
-                            style={{
159
-                                borderRadius: 3,
160
-                                height: 25,
161
-                                width: 72,
162
-                                backgroundColor: item.bg
163
-                            }}
164
-                        >
165
-                            <Text
166
-                                style={styles.badgeText}
167
-                            >{`${item.types} Types`}</Text>
168
-                        </Badge>
169
-                    </Right>}
170 154
                 </ListItem>
171 155
             );
172 156
         } else {
@@ -180,12 +164,12 @@ export default class SideBar extends React.Component<Props, State> {
180 164
     }
181 165
 
182 166
     render() {
183
-        // console.log("rendering SideBar");
167
+        console.log("rendering SideBar");
184 168
         return (
185 169
             <Container style={{
186 170
                 backgroundColor: ThemeManager.getCurrentThemeVariables().sideMenuBgColor,
187 171
             }}>
188
-                <Image source={drawerCover} style={styles.drawerCover}/>
172
+                <Image source={require("../assets/drawer-cover.png")} style={styles.drawerCover}/>
189 173
                 <FlatList
190 174
                     data={this.dataSet}
191 175
                     extraData={this.state}

+ 4
- 5
components/WebSectionList.js View File

@@ -4,7 +4,7 @@ import * as React from 'react';
4 4
 import {H3, Spinner, View} from "native-base";
5 5
 import ThemeManager from '../utils/ThemeManager';
6 6
 import WebDataManager from "../utils/WebDataManager";
7
-import CustomMaterialIcon from "./CustomMaterialIcon";
7
+import {MaterialCommunityIcons} from "@expo/vector-icons";
8 8
 import i18n from "i18n-js";
9 9
 import {RefreshControl, SectionList} from "react-native";
10 10
 
@@ -150,10 +150,9 @@ export default class WebSectionList extends React.Component<Props, State> {
150 150
                     {this.state.refreshing ?
151 151
                         <Spinner/>
152 152
                         :
153
-                        <CustomMaterialIcon
154
-                            icon={item.icon}
155
-                            fontSize={100}
156
-                            width={100}
153
+                        <MaterialCommunityIcons
154
+                            name={item.icon}
155
+                            size={100}
157 156
                             color={ThemeManager.getCurrentThemeVariables().fetchedDataSectionListErrorText}/>}
158 157
                 </View>
159 158
 

+ 7
- 6
components/WebViewScreen.js View File

@@ -5,7 +5,7 @@ import {Linking, Platform, View} from 'react-native';
5 5
 import {Body, Footer, Left, Right, Spinner, Tab, TabHeading, Tabs, Text} from 'native-base';
6 6
 import WebView from "react-native-webview";
7 7
 import Touchable from "react-native-platform-touchable";
8
-import CustomMaterialIcon from "../components/CustomMaterialIcon";
8
+import {MaterialCommunityIcons} from "@expo/vector-icons";
9 9
 import ThemeManager from "../utils/ThemeManager";
10 10
 import BaseContainer from "../components/BaseContainer";
11 11
 
@@ -59,9 +59,10 @@ export default class WebViewScreen extends React.Component<Props> {
59 59
             <Touchable
60 60
                 style={{padding: 6}}
61 61
                 onPress={clickAction}>
62
-                <CustomMaterialIcon
62
+                <MaterialCommunityIcons
63 63
                     color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
64
-                    icon={icon}/>
64
+                    name={icon}
65
+                    size={26}/>
65 66
             </Touchable>
66 67
         );
67 68
     }
@@ -144,10 +145,10 @@ export default class WebViewScreen extends React.Component<Props> {
144 145
             tabbedView.push(
145 146
                 <Tab heading={
146 147
                     <TabHeading>
147
-                        <CustomMaterialIcon
148
-                            icon={this.props.data[i]['icon']}
148
+                        <MaterialCommunityIcons
149
+                            name={this.props.data[i]['icon']}
149 150
                             color={ThemeManager.getCurrentThemeVariables().tabIconColor}
150
-                            fontSize={20}
151
+                            size={20}
151 152
                         />
152 153
                         <Text>{this.props.data[i]['name']}</Text>
153 154
                     </TabHeading>}

+ 21
- 43
navigation/DrawerNavigator.js View File

@@ -11,6 +11,7 @@ import AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen";
11 11
 import DebugScreen from '../screens/DebugScreen';
12 12
 import Sidebar from "../components/Sidebar";
13 13
 import {createStackNavigator, TransitionPresets} from "@react-navigation/stack";
14
+import PerfHomeScreen from '../screens/PerfHomeScreen';
14 15
 
15 16
 const AboutStack = createStackNavigator();
16 17
 
@@ -84,47 +85,24 @@ export default function DrawerNavigator() {
84 85
         </Drawer.Navigator>
85 86
     );
86 87
 }
87
-//
88
-// // Create a stack to use animations
89
-// function createDrawerStackWithInitialRoute(initialRoute: string) {
90
-//     return createStackNavigator({
91
-//             Main: createMaterialBottomTabNavigatorWithInitialRoute(initialRoute),
92
-//             SettingsScreen: {screen: SettingsScreen},
93
-//             AboutScreen: AboutStack,
94
-//             SelfMenuScreen: {screen: SelfMenuScreen},
95
-//             TutorInsaScreen: {screen: TutorInsaScreen},
96
-//             AmicaleScreen: {screen: AmicaleScreen},
97
-//             WiketudScreen: {screen: WiketudScreen},
98
-//             ElusEtudScreen: {screen: ElusEtudScreen},
99
-//             BlueMindScreen: {screen: BlueMindScreen},
100
-//             EntScreen: {screen: EntScreen},
101
-//             AvailableRoomScreen: {screen: AvailableRoomScreen},
102
-//         },
103
-//         {
104
-//             initialRouteName: "Main",
105
-//             mode: 'card',
106
-//             headerMode: "none",
107
-//             defaultNavigationOptions: {
108
-//                 gestureEnabled: true,
109
-//                 cardOverlayEnabled: true,
110
-//                 ...TransitionPresets.SlideFromRightIOS,
111
-//             },
112
-//         });
113
-// }
114 88
 
115
-// /**
116
-//  * Creates the drawer navigation stack
117
-//  */
118
-// function createDrawerNavigatorWithInitialRoute(initialRoute: string) {
119
-//     return createDrawerNavigator({
120
-//         Main: createDrawerStackWithInitialRoute(initialRoute),
121
-//     }, {
122
-//         contentComponent: Sidebar,
123
-//         initialRouteName: 'Main',
124
-//         backBehavior: 'initialRoute',
125
-//         drawerType: 'front',
126
-//         useNativeAnimations: true,
127
-//     });
128
-// }
129
-//
130
-// export {createDrawerNavigatorWithInitialRoute};
89
+const basicStack = createStackNavigator();
90
+
91
+function DrawerNavigator1() {
92
+    return (
93
+        <basicStack.Navigator
94
+            initialRouteName={'Main'}
95
+            mode='card'
96
+            screenOptions={{
97
+                gestureEnabled: true,
98
+                cardOverlayEnabled: true,
99
+                ...TransitionPresets.SlideFromRightIOS,
100
+            }}
101
+        >
102
+            <basicStack.Screen
103
+                name="Main"
104
+                component={TabNavigator}
105
+            />
106
+        </basicStack.Navigator>
107
+    );
108
+}

+ 5
- 8
navigation/MainTabNavigator.js View File

@@ -3,6 +3,7 @@ import {createStackNavigator, TransitionPresets} from '@react-navigation/stack';
3 3
 import {createMaterialBottomTabNavigator} from "@react-navigation/material-bottom-tabs";
4 4
 
5 5
 import HomeScreen from '../screens/HomeScreen';
6
+import PerfHomeScreen from '../screens/PerfHomeScreen';
6 7
 import PlanningScreen from '../screens/PlanningScreen';
7 8
 import PlanningDisplayScreen from '../screens/PlanningDisplayScreen';
8 9
 import ProxiwashScreen from '../screens/Proxiwash/ProxiwashScreen';
@@ -11,12 +12,8 @@ import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
11 12
 import ProximoListScreen from "../screens/Proximo/ProximoListScreen";
12 13
 import ProximoAboutScreen from "../screens/Proximo/ProximoAboutScreen";
13 14
 import PlanexScreen from '../screens/Websites/PlanexScreen';
14
-import CustomMaterialIcon from "../components/CustomMaterialIcon";
15
+import {MaterialCommunityIcons} from "@expo/vector-icons";
15 16
 import ThemeManager from "../utils/ThemeManager";
16
-import AboutScreen from "../screens/About/AboutScreen";
17
-import AboutDependenciesScreen from "../screens/About/AboutDependenciesScreen";
18
-import DebugScreen from "../screens/DebugScreen";
19
-import SettingsScreen from "../screens/SettingsScreen";
20 17
 import AsyncStorageManager from "../utils/AsyncStorageManager";
21 18
 
22 19
 const TAB_ICONS = {
@@ -145,12 +142,12 @@ export default function TabNavigator() {
145 142
         <Tab.Navigator
146 143
             initialRouteName={AsyncStorageManager.getInstance().preferences.defaultStartScreen.current}
147 144
             barStyle={{backgroundColor: ThemeManager.getCurrentThemeVariables().brandPrimary}}
148
-            screenOptions={({ route }) => ({
149
-                tabBarIcon: ({ focused, color, size }) => {
145
+            screenOptions={({route}) => ({
146
+                tabBarIcon: ({focused, color, size}) => {
150 147
                     let icon = TAB_ICONS[route.name];
151 148
                     // tintColor is ignoring activeColor and inactiveColor for some reason
152 149
                     color = focused ? "#f0edf6" : "#4e1108";
153
-                    return <CustomMaterialIcon icon={icon} color={color}/>;
150
+                    return <MaterialCommunityIcons name={icon} color={color} size={26}/>;
154 151
                 },
155 152
             })}
156 153
         >

+ 1
- 0
package.json View File

@@ -8,6 +8,7 @@
8 8
     "eject": "expo eject"
9 9
   },
10 10
   "dependencies": {
11
+    "@expo/vector-icons": "~10.0.0",
11 12
     "@react-native-community/masked-view": "0.1.5",
12 13
     "@react-navigation/bottom-tabs": "^5.1.1",
13 14
     "@react-navigation/drawer": "^5.1.1",

+ 19
- 13
screens/About/AboutScreen.js View File

@@ -7,7 +7,7 @@ import CustomHeader from "../../components/CustomHeader";
7 7
 import i18n from "i18n-js";
8 8
 import appJson from '../../app';
9 9
 import packageJson from '../../package';
10
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
10
+import {MaterialCommunityIcons} from "@expo/vector-icons";
11 11
 import AsyncStorageManager from "../../utils/AsyncStorageManager";
12 12
 import {Modalize} from "react-native-modalize";
13 13
 import ThemeManager from "../../utils/ThemeManager";
@@ -227,11 +227,10 @@ export default class AboutScreen extends React.Component<Props, State> {
227 227
             <Card>
228 228
                 <CardItem>
229 229
                     <Left>
230
-                        <CustomMaterialIcon
231
-                            icon={'account-multiple'}
232
-                            fontSize={40}
233
-                            width={40}
234
-                            color={ThemeManager.getCurrentThemeVariables().brandPrimary}/>
230
+                        <MaterialCommunityIcons
231
+                            name='account-multiple'
232
+                            size={40}
233
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
235 234
                         <Body>
236 235
                             <H1>{i18n.t('aboutScreen.team')}</H1>
237 236
                         </Body>
@@ -290,13 +289,18 @@ export default class AboutScreen extends React.Component<Props, State> {
290 289
                 <CardItem button
291 290
                           onPress={item.onPressCallback}>
292 291
                     <Left>
293
-                        <CustomMaterialIcon icon={item.icon}/>
292
+                        <MaterialCommunityIcons
293
+                            name={item.icon}
294
+                            size={26}
295
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
294 296
                         <Text>{item.text}</Text>
295 297
                     </Left>
296 298
                     {item.showChevron ?
297 299
                         <Right>
298
-                            <CustomMaterialIcon icon="chevron-right"
299
-                                                fontSize={20}/>
300
+                            <MaterialCommunityIcons
301
+                                name={'chevron-right'}
302
+                                size={26}
303
+                                color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
300 304
                         </Right>
301 305
                         :
302 306
                         <Right/>
@@ -344,8 +348,9 @@ export default class AboutScreen extends React.Component<Props, State> {
344 348
                             marginRight: 'auto',
345 349
                         }}
346 350
                         onPress={onPressMail}>
347
-                        <CustomMaterialIcon
348
-                            icon={'email'}
351
+                        <MaterialCommunityIcons
352
+                            name={'email'}
353
+                            size={26}
349 354
                             color={'#fff'}/>
350 355
                         <Text>{i18n.t('aboutScreen.bugsMail')}</Text>
351 356
                     </Button>
@@ -356,8 +361,9 @@ export default class AboutScreen extends React.Component<Props, State> {
356 361
                             marginRight: 'auto',
357 362
                         }}
358 363
                         onPress={onPressGit}>
359
-                        <CustomMaterialIcon
360
-                            icon={'git'}
364
+                        <MaterialCommunityIcons
365
+                            name={'git'}
366
+                            size={26}
361 367
                             color={'#fff'}/>
362 368
                         <Text>{i18n.t('aboutScreen.bugsGit')}</Text>
363 369
                     </Button>

+ 2
- 2
screens/DebugScreen.js View File

@@ -23,7 +23,7 @@ import {
23 23
 import CustomHeader from "../components/CustomHeader";
24 24
 import ThemeManager from '../utils/ThemeManager';
25 25
 import i18n from "i18n-js";
26
-import CustomMaterialIcon from "../components/CustomMaterialIcon";
26
+import {MaterialCommunityIcons} from "@expo/vector-icons";
27 27
 import {Alert, Clipboard, View} from "react-native";
28 28
 import AsyncStorageManager from "../utils/AsyncStorageManager";
29 29
 import NotificationsManager from "../utils/NotificationsManager";
@@ -64,7 +64,7 @@ export default class DebugScreen extends React.Component<Props, State> {
64 64
             >
65 65
                 {icon !== undefined ?
66 66
                     <Left>
67
-                        <CustomMaterialIcon icon={icon}/>
67
+                        <MaterialCommunityIcons name={icon} size={26}/>
68 68
                     </Left>
69 69
                     : <View/>
70 70
                 }

+ 4
- 4
screens/HomeScreen.js View File

@@ -4,7 +4,7 @@ import * as React from 'react';
4 4
 import {Image, TouchableOpacity, View} from 'react-native';
5 5
 import {Body, Button, Card, CardItem, Left, Text, Thumbnail} from 'native-base';
6 6
 import i18n from "i18n-js";
7
-import CustomMaterialIcon from '../components/CustomMaterialIcon';
7
+import {MaterialCommunityIcons} from "@expo/vector-icons";
8 8
 import Autolink from 'react-native-autolink';
9 9
 import ThemeManager from "../utils/ThemeManager";
10 10
 import DashboardItem from "../components/DashboardItem";
@@ -551,10 +551,10 @@ export default class HomeScreen extends React.Component<Props> {
551 551
                     <Left>
552 552
                         <Button transparent
553 553
                                 onPress={onOutLinkPress}>
554
-                            <CustomMaterialIcon
555
-                                icon="facebook"
554
+                            <MaterialCommunityIcons
555
+                                name="facebook"
556 556
                                 color="#57aeff"
557
-                                width={20}/>
557
+                                size={26}/>
558 558
                             <Text>En savoir plus</Text>
559 559
                         </Button>
560 560
                     </Left>

+ 7
- 3
screens/Proximo/ProximoAboutScreen.js View File

@@ -5,7 +5,7 @@ import {Image, View} from 'react-native';
5 5
 import {Card, CardItem, Container, Content, H2, Left, Text} from 'native-base';
6 6
 import CustomHeader from "../../components/CustomHeader";
7 7
 import i18n from "i18n-js";
8
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
8
+import {MaterialCommunityIcons} from "@expo/vector-icons";
9 9
 
10 10
 type Props = {
11 11
     navigation: Object,
@@ -39,7 +39,9 @@ export default class ProximoAboutScreen extends React.Component<Props> {
39 39
                     <Card>
40 40
                         <CardItem>
41 41
                             <Left>
42
-                                <CustomMaterialIcon icon={'clock-outline'}/>
42
+                                <MaterialCommunityIcons
43
+                                    name={'clock-outline'}
44
+                                    size={30}/>
43 45
                                 <H2>{i18n.t('proximoScreen.openingHours')}</H2>
44 46
                             </Left>
45 47
                         </CardItem>
@@ -50,7 +52,9 @@ export default class ProximoAboutScreen extends React.Component<Props> {
50 52
                     <Card>
51 53
                         <CardItem>
52 54
                             <Left>
53
-                                <CustomMaterialIcon icon={'cash'}/>
55
+                                <MaterialCommunityIcons
56
+                                    name={'cash'}
57
+                                    size={30}/>
54 58
                                 <H2>{i18n.t('proximoScreen.paymentMethods')}</H2>
55 59
                             </Left>
56 60
                         </CardItem>

+ 12
- 7
screens/Proximo/ProximoListScreen.js View File

@@ -7,7 +7,7 @@ import {FlatList, Image, Platform, View} from "react-native";
7 7
 import Touchable from 'react-native-platform-touchable';
8 8
 import Menu, {MenuItem} from 'react-native-material-menu';
9 9
 import i18n from "i18n-js";
10
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
10
+import {MaterialCommunityIcons} from "@expo/vector-icons";
11 11
 import ThemeManager from "../../utils/ThemeManager";
12 12
 import {Modalize} from 'react-native-modalize';
13 13
 
@@ -182,11 +182,15 @@ export default class ProximoListScreen extends React.Component<Props, State> {
182 182
      */
183 183
     setupSortIcons(mode: string, isReverse: boolean) {
184 184
         const downSortIcon =
185
-            <CustomMaterialIcon
186
-                icon={'sort-descending'}/>;
185
+            <MaterialCommunityIcons
186
+                name={'sort-descending'}
187
+                color={'#000'}
188
+                size={26}/>;
187 189
         const upSortIcon =
188
-            <CustomMaterialIcon
189
-                icon={'sort-ascending'}/>;
190
+            <MaterialCommunityIcons
191
+                name={'sort-ascending'}
192
+                color={'#000'}
193
+                size={26}/>;
190 194
         switch (mode) {
191 195
             case sortMode.price:
192 196
                 this.setState({sortNameIcon: ''});
@@ -297,9 +301,10 @@ export default class ProximoListScreen extends React.Component<Props, State> {
297 301
                     <Touchable
298 302
                         style={{padding: 6}}
299 303
                         onPress={this.onSortMenuPress}>
300
-                        <CustomMaterialIcon
304
+                        <MaterialCommunityIcons
301 305
                             color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
302
-                            icon={'sort'}/>
306
+                            name={'sort'}
307
+                            size={26}/>
303 308
                     </Touchable>
304 309
                 }
305 310
             >

+ 16
- 11
screens/Proximo/ProximoMainScreen.js View File

@@ -4,7 +4,7 @@ import * as React from 'react';
4 4
 import {Platform, View} from 'react-native'
5 5
 import {Body, Left, ListItem, Right, Text} from 'native-base';
6 6
 import i18n from "i18n-js";
7
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
7
+import {MaterialCommunityIcons} from "@expo/vector-icons";
8 8
 import ThemeManager from "../../utils/ThemeManager";
9 9
 import Touchable from "react-native-platform-touchable";
10 10
 import BaseContainer from "../../components/BaseContainer";
@@ -155,16 +155,18 @@ export default class ProximoMainScreen extends React.Component<Props, State> {
155 155
                 <Touchable
156 156
                     style={{padding: 6}}
157 157
                     onPress={this.onPressSearchBtn}>
158
-                    <CustomMaterialIcon
159
-                        color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
160
-                        icon="magnify"/>
158
+                    <MaterialCommunityIcons
159
+                        name="magnify"
160
+                        size={26}
161
+                        color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}/>
161 162
                 </Touchable>
162 163
                 <Touchable
163 164
                     style={{padding: 6}}
164 165
                     onPress={this.onPressAboutBtn}>
165
-                    <CustomMaterialIcon
166
-                        color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
167
-                        icon="information"/>
166
+                    <MaterialCommunityIcons
167
+                        name="information"
168
+                        size={26}
169
+                        color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}/>
168 170
                 </Touchable>
169 171
             </View>
170 172
         );
@@ -184,9 +186,9 @@ export default class ProximoMainScreen extends React.Component<Props, State> {
184 186
                     onPress={onPress}
185 187
                 >
186 188
                     <Left>
187
-                        <CustomMaterialIcon
188
-                            icon={item.type.icon}
189
-                            fontSize={30}
189
+                        <MaterialCommunityIcons
190
+                            name={item.type.icon}
191
+                            size={30}
190 192
                             color={ThemeManager.getCurrentThemeVariables().brandPrimary}
191 193
                         />
192 194
                     </Left>
@@ -199,7 +201,10 @@ export default class ProximoMainScreen extends React.Component<Props, State> {
199 201
                         </Text>
200 202
                     </Body>
201 203
                     <Right>
202
-                        <CustomMaterialIcon icon="chevron-right"/>
204
+                        <MaterialCommunityIcons
205
+                            icon="chevron-right"
206
+                            size={26}
207
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
203 208
                     </Right>
204 209
                 </ListItem>
205 210
             );

+ 19
- 11
screens/Proxiwash/ProxiwashAboutScreen.js View File

@@ -5,7 +5,7 @@ import {Image, View} from 'react-native';
5 5
 import {Body, Card, CardItem, Container, Content, H2, H3, Left, Tab, TabHeading, Tabs, Text} from 'native-base';
6 6
 import CustomHeader from "../../components/CustomHeader";
7 7
 import i18n from "i18n-js";
8
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
8
+import {MaterialCommunityIcons} from "@expo/vector-icons";
9 9
 import ThemeManager from "../../utils/ThemeManager";
10 10
 
11 11
 type Props = {
@@ -32,10 +32,10 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
32 32
                     <Tab
33 33
                         heading={
34 34
                             <TabHeading>
35
-                                <CustomMaterialIcon
36
-                                    icon={'information'}
35
+                                <MaterialCommunityIcons
36
+                                    name={'information'}
37 37
                                     color={ThemeManager.getCurrentThemeVariables().tabIconColor}
38
-                                    fontSize={20}
38
+                                    size={20}
39 39
                                 />
40 40
                                 <Text>{i18n.t('proxiwashScreen.informationTab')}</Text>
41 41
                             </TabHeading>
@@ -60,7 +60,9 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
60 60
                             <Card>
61 61
                                 <CardItem>
62 62
                                     <Left>
63
-                                        <CustomMaterialIcon icon={'tumble-dryer'}/>
63
+                                        <MaterialCommunityIcons
64
+                                            name={'tumble-dryer'}
65
+                                            size={26}/>
64 66
                                         <H2>{i18n.t('proxiwashScreen.dryer')}</H2>
65 67
                                     </Left>
66 68
                                 </CardItem>
@@ -80,7 +82,9 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
80 82
                             <Card>
81 83
                                 <CardItem>
82 84
                                     <Left>
83
-                                        <CustomMaterialIcon icon={'washing-machine'}/>
85
+                                        <MaterialCommunityIcons
86
+                                            name={'washing-machine'}
87
+                                            size={26}/>
84 88
                                         <H2>{i18n.t('proxiwashScreen.washer')}</H2>
85 89
                                     </Left>
86 90
                                 </CardItem>
@@ -102,10 +106,10 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
102 106
                     <Tab
103 107
                         heading={
104 108
                             <TabHeading>
105
-                                <CustomMaterialIcon
106
-                                    icon={'cash'}
109
+                                <MaterialCommunityIcons
110
+                                    name={'cash'}
107 111
                                     color={ThemeManager.getCurrentThemeVariables().tabIconColor}
108
-                                    fontSize={20}
112
+                                    size={20}
109 113
                                 />
110 114
                                 <Text>{i18n.t('proxiwashScreen.paymentTab')}</Text>
111 115
                             </TabHeading>
@@ -116,7 +120,9 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
116 120
                             <Card>
117 121
                                 <CardItem>
118 122
                                     <Left>
119
-                                        <CustomMaterialIcon icon={'coins'}/>
123
+                                        <MaterialCommunityIcons
124
+                                            name={'coins'}
125
+                                            size={26}/>
120 126
                                         <H2>{i18n.t('proxiwashScreen.tariffs')}</H2>
121 127
                                     </Left>
122 128
                                 </CardItem>
@@ -130,7 +136,9 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
130 136
                             <Card>
131 137
                                 <CardItem>
132 138
                                     <Left>
133
-                                        <CustomMaterialIcon icon={'cash'}/>
139
+                                        <MaterialCommunityIcons
140
+                                            name={'cash'}
141
+                                            size={26}/>
134 142
                                         <H2>{i18n.t('proxiwashScreen.paymentMethods')}</H2>
135 143
                                     </Left>
136 144
                                 </CardItem>

+ 16
- 12
screens/Proxiwash/ProxiwashScreen.js View File

@@ -5,7 +5,7 @@ import {Alert, Platform, View} from 'react-native';
5 5
 import {Body, Card, CardItem, Left, Right, Text} from 'native-base';
6 6
 import ThemeManager from '../../utils/ThemeManager';
7 7
 import i18n from "i18n-js";
8
-import CustomMaterialIcon from "../../components/CustomMaterialIcon";
8
+import {MaterialCommunityIcons} from "@expo/vector-icons";
9 9
 import WebSectionList from "../../components/WebSectionList";
10 10
 import NotificationsManager from "../../utils/NotificationsManager";
11 11
 import PlatformTouchable from "react-native-platform-touchable";
@@ -288,9 +288,10 @@ export default class ProxiwashScreen extends React.Component<Props, State> {
288 288
             <Touchable
289 289
                 style={{padding: 6}}
290 290
                 onPress={this.onAboutPress}>
291
-                <CustomMaterialIcon
291
+                <MaterialCommunityIcons
292 292
                     color={Platform.OS === 'ios' ? ThemeManager.getCurrentThemeVariables().brandPrimary : "#fff"}
293
-                    icon="information"/>
293
+                    name="information"
294
+                    size={26}/>
294 295
             </Touchable>
295 296
         );
296 297
     }
@@ -320,7 +321,7 @@ export default class ProxiwashScreen extends React.Component<Props, State> {
320 321
      * @param section The object describing the current SectionList section
321 322
      * @returns {React.Node}
322 323
      */
323
-    getRenderItem({item, section} : Object) {
324
+    getRenderItem({item, section}: Object) {
324 325
         let isMachineRunning = MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"];
325 326
         let machineName = (section.title === i18n.t('proxiwashScreen.dryers') ? i18n.t('proxiwashScreen.dryer') : i18n.t('proxiwashScreen.washer')) + ' n°' + item.number;
326 327
         let isDryer = section.title === i18n.t('proxiwashScreen.dryers');
@@ -361,18 +362,19 @@ export default class ProxiwashScreen extends React.Component<Props, State> {
361 362
                         <View/>
362 363
                     </PlatformTouchable>
363 364
                     <Left style={{marginLeft: 10}}>
364
-                        <CustomMaterialIcon
365
-                            icon={isDryer ? 'tumble-dryer' : 'washing-machine'}
366
-                            fontSize={30}
365
+                        <MaterialCommunityIcons
366
+                            name={isDryer ? 'tumble-dryer' : 'washing-machine'}
367
+                            size={30}
368
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}
367 369
                         />
368 370
                         <Body>
369 371
                             <Text>
370 372
                                 {machineName + ' '}
371 373
                                 {this.isMachineWatched(item.number) ?
372
-                                    <CustomMaterialIcon
373
-                                        icon='bell-ring'
374
+                                    <MaterialCommunityIcons
375
+                                        name='bell-ring'
374 376
                                         color={ThemeManager.getCurrentThemeVariables().brandPrimary}
375
-                                        fontSize={20}
377
+                                        size={20}
376 378
                                     /> : ''}
377 379
                             </Text>
378 380
                             <Text note>
@@ -386,8 +388,10 @@ export default class ProxiwashScreen extends React.Component<Props, State> {
386 388
                         >
387 389
                             {stateStrings[MACHINE_STATES[item.state]]}
388 390
                         </Text>
389
-                        <CustomMaterialIcon icon={stateIcons[MACHINE_STATES[item.state]]}
390
-                                            fontSize={25}
391
+                        <MaterialCommunityIcons
392
+                            name={stateIcons[MACHINE_STATES[item.state]]}
393
+                            size={25}
394
+                            color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}
391 395
                         />
392 396
                     </Right>
393 397
                 </CardItem>

+ 10
- 4
screens/SettingsScreen.js View File

@@ -18,8 +18,8 @@ import {
18 18
 import CustomHeader from "../components/CustomHeader";
19 19
 import ThemeManager from '../utils/ThemeManager';
20 20
 import i18n from "i18n-js";
21
-import {NavigationActions, StackActions} from "react-navigation";
22
-import CustomMaterialIcon from "../components/CustomMaterialIcon";
21
+import {NavigationActions, StackActions} from "@react-navigation/native";
22
+import {MaterialCommunityIcons} from "@expo/vector-icons";
23 23
 import AsyncStorageManager from "../utils/AsyncStorageManager";
24 24
 import NotificationsManager from "../utils/NotificationsManager";
25 25
 
@@ -69,7 +69,10 @@ export default class SettingsScreen extends React.Component<Props, State> {
69 69
                 thumbnail
70 70
             >
71 71
                 <Left>
72
-                    <CustomMaterialIcon icon={icon}/>
72
+                    <MaterialCommunityIcons
73
+                        name={icon}
74
+                        size={26}
75
+                        color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
73 76
                 </Left>
74 77
                 <Body>
75 78
                     <Text>
@@ -201,7 +204,10 @@ export default class SettingsScreen extends React.Component<Props, State> {
201 204
                 onPress={onPressCallback}
202 205
             >
203 206
                 <Left>
204
-                    <CustomMaterialIcon icon={icon}/>
207
+                    <MaterialCommunityIcons
208
+                        name={icon}
209
+                        size={26}
210
+                        color={ThemeManager.getCurrentThemeVariables().customMaterialIconColor}/>
205 211
                 </Left>
206 212
                 <Body>
207 213
                     <Text>

Loading…
Cancel
Save