-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy pathindex.jsx
More file actions
51 lines (46 loc) · 1.51 KB
/
index.jsx
File metadata and controls
51 lines (46 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React from 'react';
import PropTypes from 'prop-types';
import { PluginSlot } from '@openedx/frontend-plugin-framework';
import HeaderNavigations from 'CourseAuthoring/course-unit/header-navigations/HeaderNavigations';
import { COURSE_BLOCK_NAMES } from 'CourseAuthoring/constants';
const CourseUnitHeaderActionsSlot = ({
headerNavigationsActions,
category,
unitTitle,
verticalBlocks,
}) => {
const isUnitVerticalType = category === COURSE_BLOCK_NAMES.vertical.id;
return (
<PluginSlot
id="org.openedx.frontend.authoring.course_unit_header_actions.v1"
idAliases={['course_unit_header_actions_slot']}
pluginProps={{
headerNavigationsActions,
category,
unitTitle,
isUnitVerticalType,
verticalBlocks,
}}
>
<HeaderNavigations headerNavigationsActions={headerNavigationsActions} category={category} />
</PluginSlot>
);
};
CourseUnitHeaderActionsSlot.propTypes = {
headerNavigationsActions: PropTypes.shape({
handleViewLive: PropTypes.func.isRequired,
handlePreview: PropTypes.func.isRequired,
handleEdit: PropTypes.func.isRequired,
}).isRequired,
category: PropTypes.string.isRequired,
unitTitle: PropTypes.string.isRequired,
verticalBlocks: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
blockId: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
blockType: PropTypes.string.isRequired,
}),
).isRequired,
};
export default CourseUnitHeaderActionsSlot;