Auth. guard now only renders child if authenticated.
This commit is contained in:
@@ -23,7 +23,11 @@ export default class AuthenticationGuard extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
return null;
|
||||
if (this.context.user) {
|
||||
return this.props.children;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,4 +37,5 @@ AuthenticationGuard.defaultProps = {
|
||||
|
||||
AuthenticationGuard.propTypes = {
|
||||
accessLevel: propTypes.number,
|
||||
children: propTypes.any
|
||||
};
|
@@ -11,7 +11,7 @@ export default class SportInfoCard extends React.Component {
|
||||
<Card style={{ width: "20rem" }}>
|
||||
<Card.Body>
|
||||
<Card.Title>{this.props.sport.name}</Card.Title>
|
||||
<Card.Subtitle className="mb-2 text-muted">{this.props.sport.minPlayers.toString()}</Card.Subtitle>
|
||||
<Card.Subtitle className="mb-2 text-muted">Requires a minimum of {this.props.sport.minPlayers.toString()} players.</Card.Subtitle>
|
||||
<Card.Text>
|
||||
{this.props.sport.description}
|
||||
</Card.Text>
|
||||
|
Reference in New Issue
Block a user