import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withRouter } from 'react-router'; import { Route, Switch } from 'react-router-dom'; import { connect } from 'react-redux'; import { ViewerbaseDragDropContext } from 'react-viewerbase'; import ViewerRouting from "./ViewerRouting.js"; import StudyListRouting from './StudyListRouting.js'; import StandaloneRouting from './StandaloneRouting.js'; import IHEInvokeImageDisplay from './IHEInvokeImageDisplay.js'; import CallbackPage from './CallbackPage.js'; import userManager from "./userManager.js"; import './App.css'; import './variables.css'; import './theme-tide.css'; const reload = () => window.location.reload(); function setContext(context) { /*Rollbar.configure({ payload: { context } });*/ } function LoadingUser() { return (
Loading user...
); } class App extends Component { static propTypes = { history: PropTypes.object.isRequired, user: PropTypes.object } componentDidMount() { this.unlisten = this.props.history.listen((location, action) => { setContext(window.location.pathname); }); } componentWillUnmount() { this.unlisten(); } render() { const user = this.props.user; /*if (!user || user.expired) { // TODO: redirect to OAuth page if necessary return { userManager.signinRedirect(); }}/> ; }*/ return ( { userManager.signinRedirect(); }} />
Sorry, this page does not exist.
} />
); } } const mapStateToProps = state => { return { user: state.oidc.user, }; }; const ConnectedApp = connect( mapStateToProps, null )(App); export default ViewerbaseDragDropContext(withRouter(ConnectedApp));