-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.web.js
51 lines (42 loc) · 1.22 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
import { AppRegistry } from "react-native";
// Loaded Fonts with this approach: https://github.com/oblador/react-native-vector-icons#web-with-webpack
import App from "./App";
import { name as appName } from "./app.json";
import sfBold from "./assets/fonts/SFProText-Bold.ttf";
import sfMedium from "./assets/fonts/SFProText-Medium.ttf";
import sfRegular from "./assets/fonts/SFProText-Regular.ttf";
import sfSemiBold from "./assets/fonts/SFProText-Semibold.ttf";
if (module.hot) {
module.hot.accept();
}
AppRegistry.registerComponent(appName, () => App);
AppRegistry.runApplication(appName, {
initialProps: {},
rootTag: document.getElementById("app-root"),
});
const iconFontStyles = `
@font-face {
src: url(${sfRegular});
font-family: SFProText-Regular;
}
@font-face {
src: url(${sfMedium});
font-family: SFProText-Medium;
}
@font-face {
src: url(${sfSemiBold});
font-family: SFProText-Semibold;
}
@font-face {
src: url(${sfBold});
font-family: SFProText-Bold;
}
`;
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);