Browse Source

Use react native vector icons instead of expo implementation

Arnaud Vergnet 3 years ago
parent
commit
ca6f66c661

+ 6
- 0
android/app/build.gradle View File

@@ -83,6 +83,12 @@ project.ext.react = [
83 83
 apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
84 84
 apply from: "../../node_modules/react-native/react.gradle"
85 85
 
86
+project.ext.vectoricons = [
87
+    iconFontNames: [ 'MaterialCommunityIcons.ttf'] // Name of the font files you want to copy
88
+]
89
+
90
+apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
91
+
86 92
 /**
87 93
  * Set this to true to create two separate APKs instead of one:
88 94
  *   - An APK that only works on ARM devices

+ 4
- 0
ios/Campus/Info.plist View File

@@ -71,5 +71,9 @@
71 71
 	<string>Automatic</string>
72 72
 	<key>UIViewControllerBasedStatusBarAppearance</key>
73 73
 	<false/>
74
+	<key>UIAppFonts</key>
75
+    <array>
76
+      <string>MaterialCommunityIcons.ttf</string>
77
+    </array>
74 78
 </dict>
75 79
 </plist>

+ 3
- 0
ios/Podfile View File

@@ -50,4 +50,7 @@ target 'Campus' do
50 50
   pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
51 51
   pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
52 52
 
53
+  # Vector Icons
54
+  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
55
+
53 56
 end

+ 1
- 1
package.json View File

@@ -18,7 +18,6 @@
18 18
     ]
19 19
   },
20 20
   "dependencies": {
21
-    "@expo/vector-icons": "^10.0.0",
22 21
     "@react-native-community/masked-view": "0.1.6",
23 22
     "@react-navigation/bottom-tabs": "^5.1.1",
24 23
     "@react-navigation/drawer": "^5.1.1",
@@ -51,6 +50,7 @@
51 50
     "react-native-screens": "~2.2.0",
52 51
     "react-native-splash-screen": "^3.2.0",
53 52
     "react-native-unimodules": "~0.9.0",
53
+    "react-native-vector-icons": "^6.6.0",
54 54
     "react-native-web": "~0.11.7",
55 55
     "react-native-webview": "8.1.1",
56 56
     "react-navigation-collapsible": "^5.5.0",

+ 1
- 1
src/components/Overrides/CustomHeaderButton.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {MaterialCommunityIcons} from "@expo/vector-icons";
4
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
5 5
 import {HeaderButton, HeaderButtons} from 'react-navigation-header-buttons';
6 6
 import {withTheme} from "react-native-paper";
7 7
 import * as Touchable from "react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android";

+ 1
- 1
src/components/Overrides/CustomIntroSlider.js View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {Image, Platform, StatusBar, StyleSheet, View} from "react-native";
5
-import {MaterialCommunityIcons} from "@expo/vector-icons";
5
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
6 6
 import {Text} from "react-native-paper";
7 7
 import i18n from 'i18n-js';
8 8
 import AppIntroSlider from "react-native-app-intro-slider";

+ 1
- 1
src/components/Screens/ErrorView.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {Button, Subheading, withTheme} from 'react-native-paper';
5 5
 import {StyleSheet, View} from "react-native";
6
-import {MaterialCommunityIcons} from "@expo/vector-icons";
6
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
7 7
 import i18n from 'i18n-js';
8 8
 import {ERROR_TYPE} from "../../utils/WebData";
9 9
 import * as Animatable from 'react-native-animatable';

+ 1
- 1
src/components/Tabbar/TabIcon.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {View} from "react-native";
5 5
 import {TouchableRipple, withTheme} from 'react-native-paper';
6
-import {MaterialCommunityIcons} from "@expo/vector-icons";
6
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
7 7
 import * as Animatable from "react-native-animatable";
8 8
 
9 9
 type Props = {

+ 1
- 1
src/screens/Tetris/TetrisScreen.js View File

@@ -3,7 +3,7 @@
3 3
 import * as React from 'react';
4 4
 import {Alert, View} from 'react-native';
5 5
 import {IconButton, Text, withTheme} from 'react-native-paper';
6
-import {MaterialCommunityIcons} from "@expo/vector-icons";
6
+import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
7 7
 import GameLogic from "./GameLogic";
8 8
 import Grid from "./components/Grid";
9 9
 import Preview from "./components/Preview";

Loading…
Cancel
Save