mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 22:13:00 +00:00
update admin for bs5
- more consistent use of react-bootstrap - reusable MainContainer, MainCol for consistent layout
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import React, { useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { Button } from "react-bootstrap";
|
||||
import { Button, Col } from "react-bootstrap";
|
||||
import PropTypes from "prop-types";
|
||||
import ErrorAlert from "../../util/error";
|
||||
|
||||
const AddUser = (props) => {
|
||||
const [users, setUsers] = useState([]),
|
||||
@@ -28,26 +29,9 @@ const AddUser = (props) => {
|
||||
return (
|
||||
<>
|
||||
<div className="container" data-testid="container">
|
||||
{errorAlert != null ? (
|
||||
<div className="row">
|
||||
<div className="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
||||
<div className="alert alert-danger">
|
||||
{errorAlert}
|
||||
<button
|
||||
type="button"
|
||||
className="close"
|
||||
onClick={() => setErrorAlert(null)}
|
||||
>
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<ErrorAlert errorAlert={errorAlert} setErrorAlert={setErrorAlert} />
|
||||
<div className="row">
|
||||
<div className="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
|
||||
<Col md={{ span: 10, offset: 1 }} lg={{ span: 8, offset: 2 }}>
|
||||
<div className="card">
|
||||
<div className="card-header">
|
||||
<h4>Add Users</h4>
|
||||
@@ -90,10 +74,10 @@ const AddUser = (props) => {
|
||||
</Button>
|
||||
</Link>
|
||||
<span> </span>
|
||||
<button
|
||||
<Button
|
||||
id="submit"
|
||||
data-testid="submit"
|
||||
className="btn btn-primary"
|
||||
variant="primary"
|
||||
onClick={() => {
|
||||
addUsers(users, admin)
|
||||
.then((data) =>
|
||||
@@ -114,10 +98,10 @@ const AddUser = (props) => {
|
||||
}}
|
||||
>
|
||||
Add Users
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
Reference in New Issue
Block a user