From ca6f66c6614ed58df5c411cfa72b74ae5efceb70 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Wed, 29 Apr 2020 08:49:09 +0200 Subject: [PATCH] Use react native vector icons instead of expo implementation --- android/app/build.gradle | 6 ++++++ ios/Campus/Info.plist | 4 ++++ ios/Podfile | 3 +++ package.json | 2 +- src/components/Overrides/CustomHeaderButton.js | 2 +- src/components/Overrides/CustomIntroSlider.js | 2 +- src/components/Screens/ErrorView.js | 2 +- src/components/Tabbar/TabIcon.js | 2 +- src/screens/Tetris/TetrisScreen.js | 2 +- 9 files changed, 19 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 6ccd3a3..1bbe0f1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,6 +83,12 @@ project.ext.react = [ apply from: '../../node_modules/react-native-unimodules/gradle.groovy' apply from: "../../node_modules/react-native/react.gradle" +project.ext.vectoricons = [ + iconFontNames: [ 'MaterialCommunityIcons.ttf'] // Name of the font files you want to copy +] + +apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" + /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices diff --git a/ios/Campus/Info.plist b/ios/Campus/Info.plist index e0a6f5a..91812ec 100644 --- a/ios/Campus/Info.plist +++ b/ios/Campus/Info.plist @@ -71,5 +71,9 @@ Automatic UIViewControllerBasedStatusBarAppearance + UIAppFonts + + MaterialCommunityIcons.ttf + diff --git a/ios/Podfile b/ios/Podfile index 1f333ce..dcf31d0 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -50,4 +50,7 @@ target 'Campus' do pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec" pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec" + # Vector Icons + pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' + end diff --git a/package.json b/package.json index d59e6c3..f4a3134 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ ] }, "dependencies": { - "@expo/vector-icons": "^10.0.0", "@react-native-community/masked-view": "0.1.6", "@react-navigation/bottom-tabs": "^5.1.1", "@react-navigation/drawer": "^5.1.1", @@ -51,6 +50,7 @@ "react-native-screens": "~2.2.0", "react-native-splash-screen": "^3.2.0", "react-native-unimodules": "~0.9.0", + "react-native-vector-icons": "^6.6.0", "react-native-web": "~0.11.7", "react-native-webview": "8.1.1", "react-navigation-collapsible": "^5.5.0", diff --git a/src/components/Overrides/CustomHeaderButton.js b/src/components/Overrides/CustomHeaderButton.js index 13ec84b..6d3316a 100644 --- a/src/components/Overrides/CustomHeaderButton.js +++ b/src/components/Overrides/CustomHeaderButton.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import {MaterialCommunityIcons} from "@expo/vector-icons"; +import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import {HeaderButton, HeaderButtons} from 'react-navigation-header-buttons'; import {withTheme} from "react-native-paper"; import * as Touchable from "react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android"; diff --git a/src/components/Overrides/CustomIntroSlider.js b/src/components/Overrides/CustomIntroSlider.js index 0c8ddfa..8db628e 100644 --- a/src/components/Overrides/CustomIntroSlider.js +++ b/src/components/Overrides/CustomIntroSlider.js @@ -2,7 +2,7 @@ import * as React from 'react'; import {Image, Platform, StatusBar, StyleSheet, View} from "react-native"; -import {MaterialCommunityIcons} from "@expo/vector-icons"; +import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import {Text} from "react-native-paper"; import i18n from 'i18n-js'; import AppIntroSlider from "react-native-app-intro-slider"; diff --git a/src/components/Screens/ErrorView.js b/src/components/Screens/ErrorView.js index 997bca1..10cdc05 100644 --- a/src/components/Screens/ErrorView.js +++ b/src/components/Screens/ErrorView.js @@ -3,7 +3,7 @@ import * as React from 'react'; import {Button, Subheading, withTheme} from 'react-native-paper'; import {StyleSheet, View} from "react-native"; -import {MaterialCommunityIcons} from "@expo/vector-icons"; +import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import i18n from 'i18n-js'; import {ERROR_TYPE} from "../../utils/WebData"; import * as Animatable from 'react-native-animatable'; diff --git a/src/components/Tabbar/TabIcon.js b/src/components/Tabbar/TabIcon.js index 99e9e21..8e4c0f6 100644 --- a/src/components/Tabbar/TabIcon.js +++ b/src/components/Tabbar/TabIcon.js @@ -3,7 +3,7 @@ import * as React from 'react'; import {View} from "react-native"; import {TouchableRipple, withTheme} from 'react-native-paper'; -import {MaterialCommunityIcons} from "@expo/vector-icons"; +import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import * as Animatable from "react-native-animatable"; type Props = { diff --git a/src/screens/Tetris/TetrisScreen.js b/src/screens/Tetris/TetrisScreen.js index 3d064ae..ea05a27 100644 --- a/src/screens/Tetris/TetrisScreen.js +++ b/src/screens/Tetris/TetrisScreen.js @@ -3,7 +3,7 @@ import * as React from 'react'; import {Alert, View} from 'react-native'; import {IconButton, Text, withTheme} from 'react-native-paper'; -import {MaterialCommunityIcons} from "@expo/vector-icons"; +import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons"; import GameLogic from "./GameLogic"; import Grid from "./components/Grid"; import Preview from "./components/Preview";