Authentication guard now takes in a access level prop.

This commit is contained in:
2022-04-07 13:51:38 -05:00
parent 0e218750f8
commit 525c2b6d5a
2 changed files with 46 additions and 31 deletions

View File

@@ -2,6 +2,7 @@ import React from "react";
import { Button, Table } from "react-bootstrap";
import "../styles/Admin.css";
import globals from "../globals";
import AuthenticationGuard from "../components/AuthenticationGuard";
export default class Admin extends React.Component {
constructor(props) {
@@ -175,37 +176,40 @@ export default class Admin extends React.Component {
render() {
return (
<React.Fragment>
<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>
<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>
</React.Fragment>
</div>
);
}
}