-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.web.js
53 lines (47 loc) · 1.25 KB
/
index.web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { AppRegistry } from 'react-native';
import App from './src/App';
import * as OfflinePluginRuntime from 'offline-plugin/runtime';
OfflinePluginRuntime.install();
AppRegistry.registerComponent('App', () => App);
AppRegistry.runApplication('App', {
rootTag: document.getElementById('react-root'),
});
// import fonts
const fonts = [
{
icon: require('react-native-vector-icons/Fonts/FontAwesome.ttf'),
family: 'FontAwesome',
},
{
icon: require('react-native-vector-icons/Fonts/MaterialIcons.ttf'),
family: 'Material Icons',
},
{
icon: require('react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf'),
family: 'Material Design Icons',
},
{
icon: require('react-native-vector-icons/Fonts/Entypo.ttf'),
family: 'Entypo',
},
{
icon: require('react-native-vector-icons/Fonts/Ionicons.ttf'),
family: 'Ionicons',
},
];
const iconFontStyles = fonts
.map(
font => `@font-face {
src: url(${font.icon});
font-family: ${font.family};
}`
)
.join('\n');
const style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = iconFontStyles;
} else {
style.appendChild(document.createTextNode(iconFontStyles));
}
document.head.appendChild(style);