Webatrice updates (#4366)

This commit is contained in:
Jeremy Letto 2021-05-21 20:23:30 -05:00 committed by GitHub
parent 8db9475804
commit 0d05f9097d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 5517 additions and 20090 deletions

View file

@ -1,4 +1,4 @@
import React, { Component } from "react";
import React from "react";
import { connect } from "react-redux";
import { Redirect } from "react-router-dom";
@ -7,12 +7,10 @@ import { RouteEnum } from "types";
import { AuthenticationService } from "api";
class AuthGuard extends Component<AuthGuardProps> {
render() {
return !AuthenticationService.isConnected(this.props.state)
? <Redirect from="*" to={RouteEnum.SERVER} />
: "";
}
const AuthGuard = ({ state }: AuthGuardProps) => {
return !AuthenticationService.isConnected(state)
? <Redirect from="*" to={RouteEnum.SERVER} />
: <div></div>;
};
interface AuthGuardProps {
@ -23,4 +21,4 @@ const mapStateToProps = state => ({
state: ServerSelectors.getState(state),
});
export default connect(mapStateToProps)(AuthGuard);
export default connect(mapStateToProps)(AuthGuard);