2017-03-05 18:09:01 -06:00
|
|
|
//@flow
|
2020-03-29 19:47:33 +00:00
|
|
|
import rxjsconfig from 'recompose/rxjsObservableConfig';
|
|
|
|
|
import setObservableConfig from 'recompose/setObservableConfig';
|
|
|
|
|
setObservableConfig(rxjsconfig);
|
2017-03-25 21:05:55 -05:00
|
|
|
|
2020-03-29 19:47:33 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { StatusBar } from 'react-native';
|
|
|
|
|
import { ThemeContext, getTheme } from 'react-native-material-ui';
|
|
|
|
|
import { NativeRouter, Route, Redirect, AndroidBackButton, Switch } from 'react-router-native';
|
|
|
|
|
import Nav from './pages/Nav';
|
2020-04-17 22:50:23 -05:00
|
|
|
import ProductDetail from './pages/ProductDetail';
|
2020-03-29 19:47:33 +00:00
|
|
|
import PlaceDetail from './pages/PlaceDetail';
|
2020-04-17 22:50:23 -05:00
|
|
|
import CreateProduct from './pages/CreateProduct';
|
2020-03-29 19:47:33 +00:00
|
|
|
import LoginPage from './pages/LoginPage';
|
|
|
|
|
import LandingPage from './pages/LandingPage';
|
|
|
|
|
import ZipcodePage from './pages/ZipcodePage';
|
|
|
|
|
import { AppContainer } from './components/AppContainer';
|
2018-08-05 11:42:40 -05:00
|
|
|
|
2020-03-29 19:47:33 +00:00
|
|
|
import theme from './ui-theme';
|
|
|
|
|
|
|
|
|
|
console.disableYellowBox = true;
|
2017-03-05 18:09:01 -06:00
|
|
|
|
|
|
|
|
export default class App extends Component {
|
2020-03-29 19:47:33 +00:00
|
|
|
static displayName = 'App';
|
2017-04-24 19:58:18 -05:00
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<NativeRouter>
|
2017-09-10 19:20:26 -05:00
|
|
|
<AndroidBackButton>
|
2019-09-21 15:45:07 +00:00
|
|
|
<ThemeContext.Provider value={getTheme(theme)}>
|
2018-11-10 11:41:53 -06:00
|
|
|
<AppContainer>
|
2018-04-28 09:44:56 -05:00
|
|
|
<StatusBar backgroundColor={theme.statusBarColor} />
|
2020-03-29 19:47:33 +00:00
|
|
|
<Redirect from="/" to="/landing" replace />
|
2018-04-22 11:29:08 -05:00
|
|
|
<Switch>
|
|
|
|
|
<Route path="/landing" component={LandingPage} />
|
2018-08-19 20:02:43 -05:00
|
|
|
<Route path="/list/:type" component={Nav} />
|
2020-04-17 22:50:23 -05:00
|
|
|
<Route path="/product/:id" component={ProductDetail} />
|
2018-08-05 12:05:59 -05:00
|
|
|
<Route path="/place/:id" component={PlaceDetail} />
|
|
|
|
|
<Route path="/login" component={LoginPage} />
|
2018-08-19 20:02:43 -05:00
|
|
|
<Route path="/logout" component={LoginPage} />
|
2018-08-05 12:05:59 -05:00
|
|
|
<Route path="/zipcode" component={ZipcodePage} />
|
2020-04-17 22:50:23 -05:00
|
|
|
<Route path="/createProduct" component={CreateProduct} />
|
2018-04-22 11:29:08 -05:00
|
|
|
</Switch>
|
2018-11-10 11:41:53 -06:00
|
|
|
</AppContainer>
|
2019-09-21 15:45:07 +00:00
|
|
|
</ThemeContext.Provider>
|
2017-09-10 19:20:26 -05:00
|
|
|
</AndroidBackButton>
|
2017-04-24 19:58:18 -05:00
|
|
|
</NativeRouter>
|
|
|
|
|
);
|
|
|
|
|
}
|
2017-03-05 18:09:01 -06:00
|
|
|
}
|