Auth. guard now only renders child if authenticated.
This commit is contained in:
@@ -41,32 +41,31 @@ export default class Dashboard extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="page-root">
|
||||
<AuthenticationGuard />
|
||||
<React.Fragment>
|
||||
<h1></h1>
|
||||
<InputGroup className="w-50">
|
||||
<FormControl
|
||||
placeholder="Search for Matches"
|
||||
aria-label="Search Bar"
|
||||
aria-describedby="basic-addon2"
|
||||
/>
|
||||
<Button variant="outline-secondary" id="button-addon2">
|
||||
Search
|
||||
</Button>
|
||||
</InputGroup>
|
||||
<div className="p-4">
|
||||
<h2>Available Matches</h2>
|
||||
<MatchInfoCardDisplay recommendedmatches={this.state.displayedMatches} />
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<h2>Available Sports</h2>
|
||||
<SportInfoCardDisplay recommendedsports={this.state.displayedSports} />
|
||||
</div>
|
||||
|
||||
|
||||
</React.Fragment>
|
||||
</div>
|
||||
<AuthenticationGuard>
|
||||
<div className="page-root">
|
||||
<React.Fragment>
|
||||
<h1></h1>
|
||||
<InputGroup className="w-50">
|
||||
<FormControl
|
||||
placeholder="Search for Matches"
|
||||
aria-label="Search Bar"
|
||||
aria-describedby="basic-addon2"
|
||||
/>
|
||||
<Button variant="outline-secondary" id="button-addon2">
|
||||
Search
|
||||
</Button>
|
||||
</InputGroup>
|
||||
<div className="p-4">
|
||||
<h2>Available Matches</h2>
|
||||
<MatchInfoCardDisplay recommendedmatches={this.state.displayedMatches} />
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<h2>Available Sports</h2>
|
||||
<SportInfoCardDisplay recommendedsports={this.state.displayedSports} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
</AuthenticationGuard>
|
||||
);
|
||||
}
|
||||
}
|
@@ -177,38 +177,37 @@ export default class Admin extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="page-root">
|
||||
<AuthenticationGuard accessLevel={3} />
|
||||
<React.Fragment>
|
||||
|
||||
<div className='center'>
|
||||
<h1 id='title'>Administration</h1>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["black", "", ""] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[0],
|
||||
}} variant="outline-secondary">Matches</Button>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["", "black", ""] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[1],
|
||||
}} variant="outline-secondary">Users</Button>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["", "", "black"] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[2],
|
||||
}} variant="outline-secondary">Suspended Users</Button></div>
|
||||
<Table striped bordered hover>
|
||||
{this.renderTableHead()}
|
||||
<tbody>
|
||||
{this.renderTableData()}
|
||||
{/* {this.matchUserTableData()} */}
|
||||
</tbody>
|
||||
</Table>
|
||||
|
||||
</React.Fragment>
|
||||
<AuthenticationGuard accessLevel={3}>
|
||||
<React.Fragment>
|
||||
<div className='center'>
|
||||
<h1 id='title'>Administration</h1>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["black", "", ""] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[0],
|
||||
}} variant="outline-secondary">Matches</Button>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["", "black", ""] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[1],
|
||||
}} variant="outline-secondary">Users</Button>
|
||||
<Button onClick={() => {
|
||||
this.setState({ buttonColors: ["", "", "black"] });
|
||||
}} sx={{
|
||||
margin: 3,
|
||||
backgroundColor: this.state.buttonColors[2],
|
||||
}} variant="outline-secondary">Suspended Users</Button></div>
|
||||
<Table striped bordered hover>
|
||||
{this.renderTableHead()}
|
||||
<tbody>
|
||||
{this.renderTableData()}
|
||||
{/* {this.matchUserTableData()} */}
|
||||
</tbody>
|
||||
</Table>
|
||||
</React.Fragment>
|
||||
</AuthenticationGuard >
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user