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:
daphneli-chen
2020-07-08 16:00:25 -04:00
committed by GitHub
parent 7df50264cf
commit fe013f57c5
5 changed files with 55 additions and 1 deletions

View 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>
);
}