Hide class list behind edit class button
This commit is contained in:
parent
fb41b3b3d9
commit
87b71c00b9
|
@ -62,7 +62,8 @@ function AttendanceRow(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function InstructorClassAttendance(props) {
|
export function InstructorClassAttendance(props) {
|
||||||
const { clazz, token, refreshClass } = props;
|
const { clazz, token, refreshClass, user } = props;
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
const [input, setInput] = useState({});
|
const [input, setInput] = useState({});
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
@ -90,9 +91,10 @@ export function InstructorClassAttendance(props) {
|
||||||
<div>
|
<div>
|
||||||
<Header size='medium'>Instructor Panel</Header>
|
<Header size='medium'>Instructor Panel</Header>
|
||||||
|
|
||||||
|
{open || clazz.instructor === user.id ?
|
||||||
|
<div>
|
||||||
<Header size='small'>Student Emails</Header>
|
<Header size='small'>Student Emails</Header>
|
||||||
|
|
||||||
|
|
||||||
{clazz.students.length ?
|
{clazz.students.length ?
|
||||||
clazz.students
|
clazz.students
|
||||||
.filter(x => x.attendance_status !== 'Withdrawn')
|
.filter(x => x.attendance_status !== 'Withdrawn')
|
||||||
|
@ -130,6 +132,12 @@ export function InstructorClassAttendance(props) {
|
||||||
</Form.Button>
|
</Form.Button>
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
|
:
|
||||||
|
<Button onClick={() => setOpen(true)}>
|
||||||
|
Edit Class
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user