prettier applied to all files in src/

This commit is contained in:
dannyrb committed 2019-05-29 08:39:54 -04:00
1 parent 433bb219b0
commit fb7c229b43
69 files changed
+1128 -1116

No files matched your search

+31 -31
View File
@@ -1,19 +1,19 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import React, { Component } from 'react';
import PropTypes from 'prop-types';
// import asyncComponent from './components/AsyncComponent.js'
import IHEInvokeImageDisplay from './routes/IHEInvokeImageDisplay.js'
import ViewerRouting from './routes/ViewerRouting.js'
import StudyListRouting from './studylist/StudyListRouting.js'
import StandaloneRouting from './routes/StandaloneRouting.js'
import CallbackPage from './CallbackPage.js'
import { withRouter } from 'react-router'
import { Route, Switch } from 'react-router-dom'
import { connect } from 'react-redux'
import { ViewerbaseDragDropContext } from 'react-viewerbase'
import IHEInvokeImageDisplay from './routes/IHEInvokeImageDisplay.js';
import ViewerRouting from './routes/ViewerRouting.js';
import StudyListRouting from './studylist/StudyListRouting.js';
import StandaloneRouting from './routes/StandaloneRouting.js';
import CallbackPage from './CallbackPage.js';
import { withRouter } from 'react-router';
import { Route, Switch } from 'react-router-dom';
import { connect } from 'react-redux';
import { ViewerbaseDragDropContext } from 'react-viewerbase';
import './OHIFStandaloneViewer.css'
import './variables.css'
import './theme-tide.css'
import './OHIFStandaloneViewer.css';
import './variables.css';
import './theme-tide.css';
// Dynamic Import Routes (CodeSplitting)
// const IHEInvokeImageDisplay = asyncComponent(() =>
@@ -29,35 +29,35 @@ import './theme-tide.css'
// const CallbackPage = asyncComponent(() => import('./CallbackPage.js'))
//
const reload = () => window.location.reload()
const reload = () => window.location.reload();
class OHIFStandaloneViewer extends Component {
static propTypes = {
history: PropTypes.object.isRequired,
user: PropTypes.object,
}
};
componentDidMount() {
this.unlisten = this.props.history.listen((location, action) => {
if (this.props.setContext) {
this.props.setContext(window.location.pathname)
this.props.setContext(window.location.pathname);
}
})
});
}
componentWillUnmount() {
this.unlisten()
this.unlisten();
}
render() {
const { user, userManager } = this.props
const { user, userManager } = this.props;
const userNotLoggedIn = userManager && (!user || user.expired)
const userNotLoggedIn = userManager && (!user || user.expired);
if (userNotLoggedIn) {
const pathname = this.props.location.pathname
const pathname = this.props.location.pathname;
if (pathname !== '/callback') {
sessionStorage.setItem('ohif-redirect-to', pathname)
sessionStorage.setItem('ohif-redirect-to', pathname);
}
return (
@@ -70,13 +70,13 @@ class OHIFStandaloneViewer extends Component {
/>
<Route
component={() => {
userManager.signinRedirect()
userManager.signinRedirect();
return null
return null;
}}
/>
</Switch>
)
);
}
return (
@@ -97,21 +97,21 @@ class OHIFStandaloneViewer extends Component {
/>
<Route render={() => <div> Sorry, this page does not exist. </div>} />
</Switch>
)
);
}
}
const mapStateToProps = state => {
return {
user: state.oidc.user,
}
}
};
};
const ConnectedOHIFStandaloneViewer = connect(
mapStateToProps,
null
)(OHIFStandaloneViewer)
)(OHIFStandaloneViewer);
export default ViewerbaseDragDropContext(
withRouter(ConnectedOHIFStandaloneViewer)
)
);