swimtracker-app/App.js

49 lines
1.2 KiB
JavaScript

import React from 'react';
import { AppLoading } from 'expo';
import { Ionicons } from '@expo/vector-icons';
import * as Font from 'expo-font';
// Redux
import swimtrackerReducer from './state/Reducer';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import ThemedStackNavigation from './components/ThemedStackNavigation';
import DataProcessing from "./data_processing/DataProcessing";
const store = createStore(swimtrackerReducer);
const dataProcessing = new DataProcessing(store);
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}>
<ThemedStackNavigation/>
</Provider>
);
}
}