Skip to content

Commit bd97518

Browse files
committed
fix: plugin-slot fixes
1 parent c98005b commit bd97518

File tree

2 files changed

+19
-12
lines changed
  • src/plugin-slots/CourseExitPluginSlots

2 files changed

+19
-12
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import { useIntl } from '@edx/frontend-platform/i18n';
55
import messages from '../../../courseware/course/course-exit/messages';
66

77
interface Props {
8-
content: { href: string }
8+
href: string
99
}
1010

11-
const ViewCoursesLink: React.FC<Props> = ({ content }: Props) => {
11+
const ViewCoursesLink: React.FC<Props> = ({ href }: Props) => {
1212
const intl = useIntl();
1313
return (
1414
<div className="row w-100 mt-2 mb-4 justify-content-end">
1515
<Button
1616
variant="outline-primary"
17-
href={content.href}
17+
href={href}
1818
>
1919
{intl.formatMessage(messages.viewCoursesButton)}
2020
</Button>
@@ -25,8 +25,13 @@ const ViewCoursesLink: React.FC<Props> = ({ content }: Props) => {
2525
export const CourseExitViewCoursesPluginSlot: React.FC = () => {
2626
const href = `${getConfig().LMS_BASE_URL}/dashboard`;
2727
return (
28-
<PluginSlot id="org.openedx.frontend.learning.course_exit_view_courses.v1">
29-
<ViewCoursesLink content={{ href }} />
28+
<PluginSlot
29+
id="org.openedx.frontend.learning.course_exit_view_courses.v1"
30+
slotOptions={{
31+
mergeProps: true,
32+
}}
33+
>
34+
<ViewCoursesLink href={href} />
3035
</PluginSlot>
3136
);
3237
};

src/plugin-slots/CourseExitPluginSlots/DashboardFootnoteLinkPluginSlot/index.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ import { useContextId } from '../../../data/hooks';
1010

1111
interface LinkProps {
1212
variant: string;
13-
content: {
14-
destination: string;
15-
};
13+
destination: string;
1614
}
1715

18-
const DashboardFootnoteLink: React.FC<LinkProps> = ({ variant, content }: LinkProps) => {
16+
const DashboardFootnoteLink: React.FC<LinkProps> = ({ variant, destination }: LinkProps) => {
1917
const intl = useIntl();
2018
const courseId = useContextId();
2119
const { org } = useModel('courseHomeMeta', courseId);
2220
const { administrator } = getAuthenticatedUser();
23-
const { destination } = content;
2421
return (
2522
<Hyperlink
2623
style={{ textDecoration: 'underline' }}
@@ -40,8 +37,13 @@ interface PluginProps {
4037
export const DashboardFootnoteLinkPluginSlot: React.FC = ({ variant }: PluginProps) => {
4138
const destination = `${getConfig().LMS_BASE_URL}/dashboard`;
4239
return (
43-
<PluginSlot id="org.openedx.frontend.learning.course_exit_dashboard_footnote_link.v1">
44-
<DashboardFootnoteLink variant={variant} content={{ destination }} />
40+
<PluginSlot
41+
id="org.openedx.frontend.learning.course_exit_dashboard_footnote_link.v1"
42+
slotOptions={{
43+
mergeProps: true,
44+
}}
45+
>
46+
<DashboardFootnoteLink variant={variant} destination={destination} />
4547
</PluginSlot>
4648
);
4749
};

0 commit comments

Comments
 (0)