From e1ed1ab759798f3e1336f885142787a3cdabca1f Mon Sep 17 00:00:00 2001 From: Fabian Meyer Date: Thu, 7 Jun 2018 10:43:25 +0200 Subject: [PATCH] Add platform specific handling of font files --- Icon.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Icon.js b/Icon.js index 5ab1ada..52664ea 100644 --- a/Icon.js +++ b/Icon.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Text, StyleSheet } from 'react-native'; +import { Platform, Text, StyleSheet } from 'react-native'; import Icons from './FontAwesomeIcons'; @@ -23,9 +23,10 @@ class Icon extends Component { } } +const fontFamily = Platform.OS === 'ios' ? 'FontAwesome' : 'fontawesome-webfont'; const styles = StyleSheet.create({ icon: { - fontFamily: 'FontAwesome', + fontFamily: fontFamily, backgroundColor: 'transparent', }, });