import React from 'react';
import { BrowserRouter, Switch, Route } from 'react-router-dom';
import Loadable from 'react-loadable';
//other stuff
import Footer from './panels/footer.jsx';
import GA from './utilities/google_analytics.jsx';
//lazy route loading (with error handling)
const LazyRoute = (props) => {
const component = Loadable({
loader: props.component,
loading: (props) => {
if (props.error) {
return (
);
} else if (props.timedOut) {
return (
);
} else if (props.pastDelay) {
return (
);
} else {
return null;
}
},
timeout: 10000
});
return ;
};
//the app class
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
return (
{ GA.init() && }
import('./pages/home.jsx')} />
import('./pages/signup.jsx')} />
import('./pages/login.jsx')} />
import('./pages/password_change.jsx')} />
import('./pages/password_recover.jsx')} />
import('./pages/password_reset.jsx')} />
import('./pages/profile.jsx')} />
import('./pages/equipment.jsx')} />
import('./pages/ladder.jsx')} />
import('./pages/combat_log.jsx')} />
import('./pages/spying_log.jsx')} />
import('./pages/task_list.jsx')} />
import('./pages/patron_list.jsx')} />
import('./pages/news.jsx')} />
import('./pages/rules.jsx')} />
import('./pages/page_not_found.jsx')} />
);
}
}