53 lines
1.3 KiB
JavaScript
53 lines
1.3 KiB
JavaScript
import { Ionicons } from "@expo/vector-icons";
|
|
import { AppLoading } from "expo";
|
|
import * as Font from "expo-font";
|
|
import React from "react";
|
|
import { StatusBar as rnStatusBar, StyleSheet } from "react-native";
|
|
import { Provider } from "react-redux";
|
|
import { PersistGate } from "redux-persist/integration/react";
|
|
import ScreenMainComponent from "./components/screen-main/screen-main.component";
|
|
import { persistor, store } from "./redux/store";
|
|
import "./translations/i18n";
|
|
|
|
export default class App extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
isReady: false,
|
|
};
|
|
}
|
|
|
|
async componentDidMount() {
|
|
await Font.loadAsync({
|
|
Roboto: require("native-base/Fonts/Roboto.ttf"),
|
|
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
|
|
...Ionicons.font,
|
|
});
|
|
this.setState({ isReady: true });
|
|
}
|
|
|
|
render() {
|
|
if (!this.state.isReady) {
|
|
return <AppLoading />;
|
|
}
|
|
|
|
return (
|
|
<Provider store={store}>
|
|
<PersistGate persistor={persistor}>
|
|
<ScreenMainComponent />
|
|
</PersistGate>
|
|
</Provider>
|
|
);
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: "#fff",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
paddingTop: Platform.OS === "android" ? rnStatusBar.currentHeight : 0,
|
|
},
|
|
});
|