AA-203: Created progress page and receiving username, email, and enrollment status (#96)
Co-authored-by: Daphne Li-Chen <dli-chen@edx.org>
This commit is contained in:
27
src/course-home/progress-tab/ProgressTab.jsx
Normal file
27
src/course-home/progress-tab/ProgressTab.jsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
|
||||
import { useModel } from '../../generic/model-store';
|
||||
|
||||
export default function ProgressTab() {
|
||||
const {
|
||||
courseId,
|
||||
} = useSelector(state => state.courseHome);
|
||||
|
||||
const { administrator, username } = getAuthenticatedUser();
|
||||
|
||||
const {
|
||||
enrollmentMode,
|
||||
} = useModel('progress', courseId);
|
||||
|
||||
|
||||
return (
|
||||
<section>
|
||||
<h2 className="mb-4">
|
||||
the user is {username} and they are enrolled as an {enrollmentMode} learner
|
||||
{administrator
|
||||
&& <div>the user is admin</div>}
|
||||
</h2>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user