feat: Add certificate status component to the new progress page (#415)
Much of the logic is copied from the course exit certificate states. AA-719
This commit is contained in:
committed by
GitHub
parent
ce69d57dc8
commit
ef635b2a9b
66
src/shared/links.jsx
Normal file
66
src/shared/links.jsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import React from 'react';
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { getAuthenticatedUser } from '@edx/frontend-platform/auth';
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { Hyperlink } from '@edx/paragon';
|
||||
|
||||
import messages from '../courseware/course/course-exit/messages';
|
||||
|
||||
function IntlDashboardLink({ intl }) {
|
||||
return (
|
||||
<Hyperlink
|
||||
className="text-gray-700"
|
||||
style={{ textDecoration: 'underline' }}
|
||||
destination={`${getConfig().LMS_BASE_URL}/dashboard`}
|
||||
>
|
||||
{intl.formatMessage(messages.dashboardLink)}
|
||||
</Hyperlink>
|
||||
);
|
||||
}
|
||||
|
||||
IntlDashboardLink.propTypes = {
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
function IntlIdVerificationSupportLink({ intl }) {
|
||||
if (!getConfig().SUPPORT_URL_ID_VERIFICATION) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Hyperlink
|
||||
className="text-gray-700"
|
||||
style={{ textDecoration: 'underline' }}
|
||||
destination={getConfig().SUPPORT_URL_ID_VERIFICATION}
|
||||
>
|
||||
{intl.formatMessage(messages.idVerificationSupportLink)}
|
||||
</Hyperlink>
|
||||
);
|
||||
}
|
||||
|
||||
IntlIdVerificationSupportLink.propTypes = {
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
function IntlProfileLink({ intl }) {
|
||||
const { username } = getAuthenticatedUser();
|
||||
|
||||
return (
|
||||
<Hyperlink
|
||||
className="text-gray-700"
|
||||
style={{ textDecoration: 'underline' }}
|
||||
destination={`${getConfig().LMS_BASE_URL}/u/${username}`}
|
||||
>
|
||||
{intl.formatMessage(messages.profileLink)}
|
||||
</Hyperlink>
|
||||
);
|
||||
}
|
||||
|
||||
IntlProfileLink.propTypes = {
|
||||
intl: intlShape.isRequired,
|
||||
};
|
||||
|
||||
const DashboardLink = injectIntl(IntlDashboardLink);
|
||||
const IdVerificationSupportLink = injectIntl(IntlIdVerificationSupportLink);
|
||||
const ProfileLink = injectIntl(IntlProfileLink);
|
||||
|
||||
export { DashboardLink, IdVerificationSupportLink, ProfileLink };
|
||||
Reference in New Issue
Block a user