Skip to content

Commit c74ab08

Browse files
committed
refactor: simplify course exit pliugin slot
1 parent a4a1c83 commit c74ab08

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

  • src
    • courseware/course/course-exit
    • plugin-slots/CourseExitPluginSlots/CourseExitViewCoursesPluginSlot

src/courseware/course/course-exit/CourseExit.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useEffect } from 'react';
22

3-
import { getConfig } from '@edx/frontend-platform';
43
import { useSelector } from 'react-redux';
54
import { Navigate } from 'react-router-dom';
65

@@ -61,7 +60,7 @@ const CourseExit = () => {
6160

6261
return (
6362
<>
64-
<CourseExitViewCoursesPluginSlot href={`${getConfig().LMS_BASE_URL}/dashboard`} />
63+
<CourseExitViewCoursesPluginSlot />
6564
{body}
6665
</>
6766
);

src/plugin-slots/CourseExitPluginSlots/CourseExitViewCoursesPluginSlot/index.jsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Button } from '@openedx/paragon';
22
import PropTypes from 'prop-types';
3+
import { getConfig } from '@edx/frontend-platform';
34
import { PluginSlot } from '@openedx/frontend-plugin-framework';
45
import { useIntl } from '@edx/frontend-platform/i18n';
56
import messages from '../../../courseware/course/course-exit/messages';
@@ -24,14 +25,15 @@ ViewCoursesLink.propTypes = {
2425
}).isRequired,
2526
};
2627

27-
const CourseExitViewCoursesPluginSlot = ({ href }) => (
28-
<PluginSlot id="course_exit_view_courses_slot">
29-
<ViewCoursesLink content={{ href }} />
30-
</PluginSlot>
31-
);
32-
33-
CourseExitViewCoursesPluginSlot.propTypes = {
34-
href: PropTypes.string.isRequired,
28+
const CourseExitViewCoursesPluginSlot = () => {
29+
const href = `${getConfig().LMS_BASE_URL}/dashboard`;
30+
return (
31+
<PluginSlot id="course_exit_view_courses_slot">
32+
<ViewCoursesLink content={{ href }} />
33+
</PluginSlot>
34+
);
3535
};
3636

37+
CourseExitViewCoursesPluginSlot.propTypes = {};
38+
3739
export default CourseExitViewCoursesPluginSlot;

0 commit comments

Comments
 (0)