2019-09-17 20:24:01 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { AppLoading } from 'expo';
|
|
|
|
import { Ionicons } from '@expo/vector-icons';
|
2020-06-04 18:46:15 +02:00
|
|
|
import * as Font from 'expo-font';
|
|
|
|
|
|
|
|
// Redux
|
|
|
|
import swimtrackerReducer from './state/Reducer';
|
|
|
|
import { createStore } from 'redux';
|
2020-06-28 18:55:58 +02:00
|
|
|
import { DeviceReduxCoupling } from './state/DeviceReduxCoupling';
|
2020-06-04 18:46:15 +02:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
|
|
|
import ThemedStackNavigation from './components/ThemedStackNavigation';
|
2020-07-25 14:06:39 +02:00
|
|
|
import NewAppMain from "./components/NewAppMain";
|
2020-06-04 18:46:15 +02:00
|
|
|
|
|
|
|
const store = createStore(swimtrackerReducer);
|
2019-09-17 20:24:01 +02:00
|
|
|
|
|
|
|
export default class App extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
isReady: false,
|
2020-05-17 15:57:26 +02:00
|
|
|
};
|
2019-09-17 20:24:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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 });
|
2020-07-15 15:53:16 +02:00
|
|
|
this.device = new DeviceReduxCoupling(store);
|
2019-09-17 20:24:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
if (!this.state.isReady) {
|
|
|
|
return <AppLoading />;
|
|
|
|
}
|
2020-07-25 14:06:39 +02:00
|
|
|
/*
|
2019-09-17 20:24:01 +02:00
|
|
|
return (
|
2020-06-04 18:46:15 +02:00
|
|
|
<Provider store={store}>
|
2020-07-15 15:53:16 +02:00
|
|
|
<ThemedStackNavigation />
|
2020-06-04 18:46:15 +02:00
|
|
|
</Provider>
|
2020-07-25 14:06:39 +02:00
|
|
|
);*/
|
|
|
|
return (
|
|
|
|
<Provider store={store}>
|
|
|
|
<NewAppMain />
|
|
|
|
</Provider>
|
2019-09-17 20:24:01 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|