|
1 | | -import React from 'react'; |
2 | 1 | import PropTypes from 'prop-types'; |
3 | | -import { useSelector } from 'react-redux'; |
4 | | - |
5 | | -import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; |
6 | | -import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n'; |
7 | | -import { Hyperlink } from '@openedx/paragon'; |
| 2 | +import { useIntl } from '@edx/frontend-platform/i18n'; |
8 | 3 | import { faCalendarAlt } from '@fortawesome/free-regular-svg-icons'; |
9 | | -import { getConfig } from '@edx/frontend-platform'; |
10 | | - |
11 | | -import { useModel } from '../../../generic/model-store'; |
12 | 4 |
|
| 5 | +import { DashboardFootnoteLinkPluginSlot } from '../../../plugin-slots/CourseExitPluginSlots'; |
13 | 6 | import Footnote from './Footnote'; |
14 | 7 | import messages from './messages'; |
15 | | -import { logClick } from './utils'; |
16 | 8 |
|
17 | 9 | const DashboardFootnote = ({ variant }) => { |
18 | 10 | const intl = useIntl(); |
19 | | - const { courseId } = useSelector(state => state.courseware); |
20 | | - const { org } = useModel('courseHomeMeta', courseId); |
21 | | - const { administrator } = getAuthenticatedUser(); |
22 | | - |
23 | | - const dashboardLink = ( |
24 | | - <Hyperlink |
25 | | - style={{ textDecoration: 'underline' }} |
26 | | - destination={`${getConfig().LMS_BASE_URL}/dashboard`} |
27 | | - className="text-reset" |
28 | | - onClick={() => logClick(org, courseId, administrator, 'dashboard_footnote', { variant })} |
29 | | - > |
30 | | - {intl.formatMessage(messages.dashboardLink)} |
31 | | - </Hyperlink> |
32 | | - ); |
| 11 | + const dashboardLink = (<DashboardFootnoteLinkPluginSlot variant={variant} />); |
33 | 12 |
|
34 | 13 | return ( |
35 | 14 | <Footnote |
36 | 15 | icon={faCalendarAlt} |
37 | | - text={( |
38 | | - <FormattedMessage |
39 | | - id="courseCelebration.dashboardInfo" // for historical reasons |
40 | | - defaultMessage="You can access this course and its materials on your {dashboardLink}." |
41 | | - description="Text that precedes link to learner's dashboard" |
42 | | - values={{ dashboardLink }} |
43 | | - /> |
44 | | - )} |
| 16 | + text={intl.formatMessage(messages.dashboardInfo, { dashboardLink })} |
45 | 17 | /> |
46 | 18 | ); |
47 | 19 | }; |
|
0 commit comments