@artistanbul/frontend-component-header-sumac 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +93 -0
- package/README.rst +193 -0
- package/dist/Avatar.js +43 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Header.js +130 -0
- package/dist/Header.js.map +1 -0
- package/dist/Header.messages.js +110 -0
- package/dist/Header.messages.js.map +1 -0
- package/dist/Header.test.jsx +104 -0
- package/dist/Icons.js +52 -0
- package/dist/Icons.js.map +1 -0
- package/dist/Logo.js +28 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Menu/Menu.js +321 -0
- package/dist/Menu/Menu.js.map +1 -0
- package/dist/Menu/index.js +3 -0
- package/dist/Menu/index.js.map +1 -0
- package/dist/Menu/menu.scss +45 -0
- package/dist/__snapshots__/Header.test.jsx.snap +445 -0
- package/dist/desktop-header/DesktopHeader.js +174 -0
- package/dist/desktop-header/DesktopHeader.js.map +1 -0
- package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js +51 -0
- package/dist/desktop-header/DesktopHeaderMainOrSecondaryMenu.js.map +1 -0
- package/dist/desktop-header/DesktopHeaderUserMenu.js +49 -0
- package/dist/desktop-header/DesktopHeaderUserMenu.js.map +1 -0
- package/dist/desktop-header/DesktopLoggedOutItems.js +22 -0
- package/dist/desktop-header/DesktopLoggedOutItems.js.map +1 -0
- package/dist/generic/messages.js +15 -0
- package/dist/generic/messages.js.map +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/images/omnikampus/artistanbul-logo.png +0 -0
- package/dist/images/omnikampus/omnikampus-just-logo.png +0 -0
- package/dist/images/omnikampus/omnikampus-logo.png +0 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/index.scss +248 -0
- package/dist/learning-header/AnonymousUserMenu.js +25 -0
- package/dist/learning-header/AnonymousUserMenu.js.map +1 -0
- package/dist/learning-header/AuthenticatedUserDropdown.js +57 -0
- package/dist/learning-header/AuthenticatedUserDropdown.js.map +1 -0
- package/dist/learning-header/LearningHeader.js +61 -0
- package/dist/learning-header/LearningHeader.js.map +1 -0
- package/dist/learning-header/LearningHeaderCourseInfo.js +24 -0
- package/dist/learning-header/LearningHeaderCourseInfo.js.map +1 -0
- package/dist/learning-header/LearningHeaderHelpLink.js +13 -0
- package/dist/learning-header/LearningHeaderHelpLink.js.map +1 -0
- package/dist/learning-header/LearningHeaderUserMenuItems.js +20 -0
- package/dist/learning-header/LearningHeaderUserMenuItems.js.map +1 -0
- package/dist/learning-header/LearningLoggedOutButtons.js +24 -0
- package/dist/learning-header/LearningLoggedOutButtons.js.map +1 -0
- package/dist/learning-header/messages.js +40 -0
- package/dist/learning-header/messages.js.map +1 -0
- package/dist/mobile-header/MobileHeader.js +192 -0
- package/dist/mobile-header/MobileHeader.js.map +1 -0
- package/dist/mobile-header/MobileHeaderMainMenu.js +46 -0
- package/dist/mobile-header/MobileHeaderMainMenu.js.map +1 -0
- package/dist/mobile-header/MobileHeaderUserMenu.js +38 -0
- package/dist/mobile-header/MobileHeaderUserMenu.js.map +1 -0
- package/dist/mobile-header/MobileLoggedOutItems.js +27 -0
- package/dist/mobile-header/MobileLoggedOutItems.js.map +1 -0
- package/dist/plugin-slots/CourseInfoSlot/README.md +125 -0
- package/dist/plugin-slots/CourseInfoSlot/images/add_custom_components_before_and_after_course_info.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/images/replace_course_info_with_custom_component.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/images/replace_course_title.png +0 -0
- package/dist/plugin-slots/CourseInfoSlot/index.js +31 -0
- package/dist/plugin-slots/CourseInfoSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopHeaderSlot/README.md +41 -0
- package/dist/plugin-slots/DesktopHeaderSlot/images/desktop_header_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopHeaderSlot/index.js +15 -0
- package/dist/plugin-slots/DesktopHeaderSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/README.md +134 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/images/desktop_logged_out_items_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/README.md +134 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/images/desktop_main_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopMainMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/README.md +129 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/images/desktop_secondary_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopSecondaryMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/README.md +141 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/images/desktop_user_menu_modify_items.png +0 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/index.js +19 -0
- package/dist/plugin-slots/DesktopUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningHelpSlot/README.md +41 -0
- package/dist/plugin-slots/LearningHelpSlot/images/learning_help_custom_component.png +0 -0
- package/dist/plugin-slots/LearningHelpSlot/index.js +10 -0
- package/dist/plugin-slots/LearningHelpSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/README.md +132 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/images/learning_logged_out_items_modified_items.png +0 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js +17 -0
- package/dist/plugin-slots/LearningLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/LearningUserMenuSlot/README.md +130 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/images/learning_user_menu_modified_items.png +0 -0
- package/dist/plugin-slots/LearningUserMenuSlot/index.js +17 -0
- package/dist/plugin-slots/LearningUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/LogoSlot/README.md +69 -0
- package/dist/plugin-slots/LogoSlot/index.js +26 -0
- package/dist/plugin-slots/LogoSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileHeaderSlot/README.md +41 -0
- package/dist/plugin-slots/MobileHeaderSlot/images/mobile_header_custom_component.png +0 -0
- package/dist/plugin-slots/MobileHeaderSlot/index.js +15 -0
- package/dist/plugin-slots/MobileHeaderSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/README.md +134 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_component.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_modify_items.png +0 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js +19 -0
- package/dist/plugin-slots/MobileLoggedOutItemsSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileMainMenuSlot/README.md +134 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_component.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/images/mobile_main_menu_modify_items.png +0 -0
- package/dist/plugin-slots/MobileMainMenuSlot/index.js +19 -0
- package/dist/plugin-slots/MobileMainMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/MobileUserMenuSlot/README.md +142 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_component.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_custom_components_before_after.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/images/mobile_user_menu_modify_items.png +0 -0
- package/dist/plugin-slots/MobileUserMenuSlot/index.js +19 -0
- package/dist/plugin-slots/MobileUserMenuSlot/index.js.map +1 -0
- package/dist/plugin-slots/README.md +15 -0
- package/dist/setupTest.js +125 -0
- package/dist/studio-header/BrandNav.js +24 -0
- package/dist/studio-header/BrandNav.js.map +1 -0
- package/dist/studio-header/CourseLockUp.js +46 -0
- package/dist/studio-header/CourseLockUp.js.map +1 -0
- package/dist/studio-header/HeaderBody.js +143 -0
- package/dist/studio-header/HeaderBody.js.map +1 -0
- package/dist/studio-header/MobileHeader.js +79 -0
- package/dist/studio-header/MobileHeader.js.map +1 -0
- package/dist/studio-header/MobileMenu.js +46 -0
- package/dist/studio-header/MobileMenu.js.map +1 -0
- package/dist/studio-header/NavDropdownMenu.js +32 -0
- package/dist/studio-header/NavDropdownMenu.js.map +1 -0
- package/dist/studio-header/StudioHeader.js +79 -0
- package/dist/studio-header/StudioHeader.js.map +1 -0
- package/dist/studio-header/StudioHeader.scss +49 -0
- package/dist/studio-header/UserMenu.js +55 -0
- package/dist/studio-header/UserMenu.js.map +1 -0
- package/dist/studio-header/index.js +3 -0
- package/dist/studio-header/index.js.map +1 -0
- package/dist/studio-header/messages.js +55 -0
- package/dist/studio-header/messages.js.map +1 -0
- package/dist/studio-header/utils.js +26 -0
- package/dist/studio-header/utils.js.map +1 -0
- package/dist/test-utils.js +26 -0
- package/dist/test-utils.js.map +1 -0
- package/package.json +79 -0
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import LearningHeaderUserMenuItems, { learningHeaderUserMenuDataShape } from '../../learning-header/LearningHeaderUserMenuItems';
|
4
|
+
var LearningUserMenuSlot = function LearningUserMenuSlot(_ref) {
|
5
|
+
var items = _ref.items;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "learning_user_menu_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(LearningHeaderUserMenuItems, {
|
12
|
+
items: items
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
LearningUserMenuSlot.propTypes = learningHeaderUserMenuDataShape;
|
16
|
+
export default LearningUserMenuSlot;
|
17
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","LearningHeaderUserMenuItems","learningHeaderUserMenuDataShape","LearningUserMenuSlot","_ref","items","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/LearningUserMenuSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport LearningHeaderUserMenuItems, { learningHeaderUserMenuDataShape } from '../../learning-header/LearningHeaderUserMenuItems';\n\nconst LearningUserMenuSlot = ({\n items,\n}) => (\n <PluginSlot\n id=\"learning_user_menu_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <LearningHeaderUserMenuItems items={items} />\n </PluginSlot>\n);\n\nLearningUserMenuSlot.propTypes = learningHeaderUserMenuDataShape;\n\nexport default LearningUserMenuSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,2BAA2B,IAAIC,+BAA+B,QAAQ,mDAAmD;AAEhI,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA;EAAA,IACxBC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,oBAELN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,yBAAyB;IAC5BC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,2BAA2B;IAACI,KAAK,EAAEA;EAAM,CAAE,CAClC,CAAC;AAAA,CACd;AAEDF,oBAAoB,CAACO,SAAS,GAAGR,+BAA+B;AAEhE,eAAeC,oBAAoB","ignoreList":[]}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Logo Slot
|
2
|
+
|
3
|
+
### Slot ID: `logo_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the logo.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify URL
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the link href for the logo.
|
14
|
+
|
15
|
+
```jsx
|
16
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
17
|
+
|
18
|
+
const modifyLogoHref = ( widget ) => {
|
19
|
+
widget.content.href = "https://openedx.org/";
|
20
|
+
return widget;
|
21
|
+
};
|
22
|
+
|
23
|
+
const config = {
|
24
|
+
pluginSlots: {
|
25
|
+
logo_slot: {
|
26
|
+
keepDefault: true,
|
27
|
+
plugins: [
|
28
|
+
{
|
29
|
+
op: PLUGIN_OPERATIONS.Modify,
|
30
|
+
widgetId: 'default_contents',
|
31
|
+
fn: modifyLogoHref,
|
32
|
+
},
|
33
|
+
]
|
34
|
+
},
|
35
|
+
},
|
36
|
+
}
|
37
|
+
|
38
|
+
export default config;
|
39
|
+
```
|
40
|
+
|
41
|
+
### Custom Component
|
42
|
+
|
43
|
+
The following `env.config.jsx` will replace the logo entirely (in this case with a centered πΊοΈ `h1`)
|
44
|
+
|
45
|
+
```jsx
|
46
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
47
|
+
|
48
|
+
const config = {
|
49
|
+
pluginSlots: {
|
50
|
+
logo_slot: {
|
51
|
+
keepDefault: false,
|
52
|
+
plugins: [
|
53
|
+
{
|
54
|
+
op: PLUGIN_OPERATIONS.Insert,
|
55
|
+
widget: {
|
56
|
+
id: 'custom_logo_component',
|
57
|
+
type: DIRECT_PLUGIN,
|
58
|
+
RenderWidget: () => (
|
59
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
60
|
+
),
|
61
|
+
},
|
62
|
+
},
|
63
|
+
]
|
64
|
+
}
|
65
|
+
},
|
66
|
+
}
|
67
|
+
|
68
|
+
export default config;
|
69
|
+
```
|
@@ -0,0 +1,26 @@
|
|
1
|
+
var _excluded = ["href", "src", "alt"];
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
5
|
+
import React from 'react';
|
6
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
7
|
+
import Logo, { logoDataShape } from '../../Logo';
|
8
|
+
var LogoSlot = function LogoSlot(_ref) {
|
9
|
+
var href = _ref.href,
|
10
|
+
src = _ref.src,
|
11
|
+
alt = _ref.alt,
|
12
|
+
attributes = _objectWithoutProperties(_ref, _excluded);
|
13
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
14
|
+
id: "logo_slot",
|
15
|
+
slotOptions: {
|
16
|
+
mergeProps: true
|
17
|
+
}
|
18
|
+
}, /*#__PURE__*/React.createElement(Logo, _extends({
|
19
|
+
href: href,
|
20
|
+
src: src,
|
21
|
+
alt: alt
|
22
|
+
}, attributes)));
|
23
|
+
};
|
24
|
+
LogoSlot.propTypes = logoDataShape;
|
25
|
+
export default LogoSlot;
|
26
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","Logo","logoDataShape","LogoSlot","_ref","href","src","alt","attributes","_objectWithoutProperties","_excluded","createElement","id","slotOptions","mergeProps","_extends","propTypes"],"sources":["../../../src/plugin-slots/LogoSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport Logo, { logoDataShape } from '../../Logo';\n\nconst LogoSlot = ({\n href, src, alt, ...attributes\n}) => (\n <PluginSlot\n id=\"logo_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <Logo href={href} src={src} alt={alt} {...attributes} />\n </PluginSlot>\n);\n\nLogoSlot.propTypes = logoDataShape;\n\nexport default LogoSlot;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,IAAI,IAAIC,aAAa,QAAQ,YAAY;AAEhD,IAAMC,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA;EAAA,IACZC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAEC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IAAKC,UAAU,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA;EAAA,oBAE7BX,KAAA,CAAAY,aAAA,CAACX,UAAU;IACTY,EAAE,EAAC,WAAW;IACdC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFf,KAAA,CAAAY,aAAA,CAACV,IAAI,EAAAc,QAAA;IAACV,IAAI,EAAEA,IAAK;IAACC,GAAG,EAAEA,GAAI;IAACC,GAAG,EAAEA;EAAI,GAAKC,UAAU,CAAG,CAC7C,CAAC;AAAA,CACd;AAEDL,QAAQ,CAACa,SAAS,GAAGd,aAAa;AAElC,eAAeC,QAAQ","ignoreList":[]}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Mobile Header Slot
|
2
|
+
|
3
|
+
### Slot ID: `mobile_header_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the entire mobile header.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Custom Component
|
12
|
+
|
13
|
+
The following `env.config.jsx` will replace the mobile header entirely (in this case with a centered πΊοΈ `h1`)
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const config = {
|
21
|
+
pluginSlots: {
|
22
|
+
mobile_header_slot: {
|
23
|
+
keepDefault: false,
|
24
|
+
plugins: [
|
25
|
+
{
|
26
|
+
op: PLUGIN_OPERATIONS.Insert,
|
27
|
+
widget: {
|
28
|
+
id: 'custom_mobile_header_component',
|
29
|
+
type: DIRECT_PLUGIN,
|
30
|
+
RenderWidget: () => (
|
31
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
32
|
+
),
|
33
|
+
},
|
34
|
+
},
|
35
|
+
]
|
36
|
+
}
|
37
|
+
},
|
38
|
+
}
|
39
|
+
|
40
|
+
export default config;
|
41
|
+
```
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import MobileHeader, { mobileHeaderDataShape } from '../../mobile-header/MobileHeader';
|
4
|
+
var MobileHeaderSlot = function MobileHeaderSlot(_ref) {
|
5
|
+
var props = _ref.props;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "mobile_header_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(MobileHeader, props));
|
12
|
+
};
|
13
|
+
MobileHeaderSlot.propTypes = mobileHeaderDataShape;
|
14
|
+
export default MobileHeaderSlot;
|
15
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","MobileHeader","mobileHeaderDataShape","MobileHeaderSlot","_ref","props","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/MobileHeaderSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport MobileHeader, { mobileHeaderDataShape } from '../../mobile-header/MobileHeader';\n\nconst MobileHeaderSlot = ({\n props,\n}) => (\n <PluginSlot\n id=\"mobile_header_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <MobileHeader {...props} />\n </PluginSlot>\n);\n\nMobileHeaderSlot.propTypes = mobileHeaderDataShape;\n\nexport default MobileHeaderSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,YAAY,IAAIC,qBAAqB,QAAQ,kCAAkC;AAEtF,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA;EAAA,IACpBC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,oBAELN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,oBAAoB;IACvBC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,YAAY,EAAKI,KAAQ,CAChB,CAAC;AAAA,CACd;AAEDF,gBAAgB,CAACO,SAAS,GAAGR,qBAAqB;AAElD,eAAeC,gBAAgB","ignoreList":[]}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# Mobile Logged Out Items Slot
|
2
|
+
|
3
|
+
### Slot ID: `mobile_logged_out_items_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the mobile user menu when logged out.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in mobile user menu when logged out.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyLoggedOutItems = ( widget ) => {
|
21
|
+
widget.content.items = [
|
22
|
+
{
|
23
|
+
type: 'item',
|
24
|
+
href: 'https://openedx.org/',
|
25
|
+
content: 'openedx.org',
|
26
|
+
},
|
27
|
+
{
|
28
|
+
type: 'item',
|
29
|
+
href: 'https://docs.openedx.org/en/latest/',
|
30
|
+
content: 'Documentation',
|
31
|
+
},
|
32
|
+
{
|
33
|
+
type: 'item',
|
34
|
+
href: 'https://discuss.openedx.org/',
|
35
|
+
content: 'Forums',
|
36
|
+
}
|
37
|
+
];
|
38
|
+
return widget;
|
39
|
+
};
|
40
|
+
|
41
|
+
const config = {
|
42
|
+
pluginSlots: {
|
43
|
+
mobile_logged_out_items_slot: {
|
44
|
+
keepDefault: true,
|
45
|
+
plugins: [
|
46
|
+
{
|
47
|
+
op: PLUGIN_OPERATIONS.Modify,
|
48
|
+
widgetId: 'default_contents',
|
49
|
+
fn: modifyLoggedOutItems,
|
50
|
+
},
|
51
|
+
]
|
52
|
+
},
|
53
|
+
},
|
54
|
+
}
|
55
|
+
|
56
|
+
export default config;
|
57
|
+
```
|
58
|
+
|
59
|
+
### Replace Items with Custom Component
|
60
|
+
|
61
|
+
The following `env.config.jsx` will replace the items in mobile user menu when logged out entirely (in this case with a centered πΊοΈ `h1`)
|
62
|
+
|
63
|
+

|
64
|
+
|
65
|
+
```jsx
|
66
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
67
|
+
|
68
|
+
const config = {
|
69
|
+
pluginSlots: {
|
70
|
+
mobile_logged_out_items_slot: {
|
71
|
+
keepDefault: false,
|
72
|
+
plugins: [
|
73
|
+
{
|
74
|
+
op: PLUGIN_OPERATIONS.Insert,
|
75
|
+
widget: {
|
76
|
+
id: 'custom_logged_out_items_component',
|
77
|
+
type: DIRECT_PLUGIN,
|
78
|
+
RenderWidget: () => (
|
79
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
80
|
+
),
|
81
|
+
},
|
82
|
+
},
|
83
|
+
]
|
84
|
+
},
|
85
|
+
},
|
86
|
+
}
|
87
|
+
|
88
|
+
export default config;
|
89
|
+
```
|
90
|
+
|
91
|
+
### Add Custom Components before and after Items
|
92
|
+
|
93
|
+
The following `env.config.jsx` will place custom components before and after the items in mobile user menu when logged out (in this case centered `h1`s with π and π).
|
94
|
+
|
95
|
+

|
96
|
+
|
97
|
+
```jsx
|
98
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
99
|
+
|
100
|
+
const config = {
|
101
|
+
pluginSlots: {
|
102
|
+
mobile_logged_out_items_slot: {
|
103
|
+
keepDefault: true,
|
104
|
+
plugins: [
|
105
|
+
{
|
106
|
+
op: PLUGIN_OPERATIONS.Insert,
|
107
|
+
widget: {
|
108
|
+
id: 'custom_before_logged_out_items_component',
|
109
|
+
type: DIRECT_PLUGIN,
|
110
|
+
priority: 10,
|
111
|
+
RenderWidget: () => (
|
112
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
113
|
+
),
|
114
|
+
},
|
115
|
+
},
|
116
|
+
{
|
117
|
+
op: PLUGIN_OPERATIONS.Insert,
|
118
|
+
widget: {
|
119
|
+
id: 'custom_after_logged_out_items_component',
|
120
|
+
type: DIRECT_PLUGIN,
|
121
|
+
priority: 90,
|
122
|
+
RenderWidget: () => (
|
123
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
124
|
+
),
|
125
|
+
},
|
126
|
+
},
|
127
|
+
]
|
128
|
+
},
|
129
|
+
},
|
130
|
+
}
|
131
|
+
|
132
|
+
export default config;
|
133
|
+
```
|
134
|
+
|
Binary file
|
Binary file
|
package/dist/plugin-slots/MobileLoggedOutItemsSlot/images/mobile_logged_out_items_modify_items.png
ADDED
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import MobileLoggedOutItems, { mobileHeaderLoggedOutItemsDataShape } from '../../mobile-header/MobileLoggedOutItems';
|
4
|
+
var MobileLoggedOutItemsSlot = function MobileLoggedOutItemsSlot(_ref) {
|
5
|
+
var items = _ref.items;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "mobile_logged_out_items_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(MobileLoggedOutItems, {
|
12
|
+
items: items
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
MobileLoggedOutItemsSlot.propTypes = {
|
16
|
+
items: mobileHeaderLoggedOutItemsDataShape
|
17
|
+
};
|
18
|
+
export default MobileLoggedOutItemsSlot;
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","MobileLoggedOutItems","mobileHeaderLoggedOutItemsDataShape","MobileLoggedOutItemsSlot","_ref","items","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/MobileLoggedOutItemsSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport MobileLoggedOutItems, { mobileHeaderLoggedOutItemsDataShape } from '../../mobile-header/MobileLoggedOutItems';\n\nconst MobileLoggedOutItemsSlot = ({\n items,\n}) => (\n <PluginSlot\n id=\"mobile_logged_out_items_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <MobileLoggedOutItems items={items} />\n </PluginSlot>\n);\n\nMobileLoggedOutItemsSlot.propTypes = {\n items: mobileHeaderLoggedOutItemsDataShape,\n};\n\nexport default MobileLoggedOutItemsSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,oBAAoB,IAAIC,mCAAmC,QAAQ,0CAA0C;AAEpH,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA;EAAA,IAC5BC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,oBAELN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,8BAA8B;IACjCC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,oBAAoB;IAACI,KAAK,EAAEA;EAAM,CAAE,CAC3B,CAAC;AAAA,CACd;AAEDF,wBAAwB,CAACO,SAAS,GAAG;EACnCL,KAAK,EAAEH;AACT,CAAC;AAED,eAAeC,wBAAwB","ignoreList":[]}
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# Mobile Main Menu Slot
|
2
|
+
|
3
|
+
### Slot ID: `mobile_main_menu_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the mobile main menu.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in the mobile main menu.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyMainMenu = ( widget ) => {
|
21
|
+
widget.content.menu = [
|
22
|
+
{
|
23
|
+
type: 'item',
|
24
|
+
href: 'https://openedx.org/',
|
25
|
+
content: 'openedx.org',
|
26
|
+
},
|
27
|
+
{
|
28
|
+
type: 'item',
|
29
|
+
href: 'https://docs.openedx.org/en/latest/',
|
30
|
+
content: 'Documentation',
|
31
|
+
},
|
32
|
+
{
|
33
|
+
type: 'item',
|
34
|
+
href: 'https://discuss.openedx.org/',
|
35
|
+
content: 'Forums',
|
36
|
+
}
|
37
|
+
];
|
38
|
+
return widget;
|
39
|
+
};
|
40
|
+
|
41
|
+
const config = {
|
42
|
+
pluginSlots: {
|
43
|
+
mobile_main_menu_slot: {
|
44
|
+
keepDefault: true,
|
45
|
+
plugins: [
|
46
|
+
{
|
47
|
+
op: PLUGIN_OPERATIONS.Modify,
|
48
|
+
widgetId: 'default_contents',
|
49
|
+
fn: modifyMainMenu,
|
50
|
+
},
|
51
|
+
]
|
52
|
+
},
|
53
|
+
},
|
54
|
+
}
|
55
|
+
|
56
|
+
export default config;
|
57
|
+
```
|
58
|
+
|
59
|
+
### Replace Menu with Custom Component
|
60
|
+
|
61
|
+
The following `env.config.jsx` will replace the mobile main menu entirely (in this case with a centered πΊοΈ `h1`)
|
62
|
+
|
63
|
+

|
64
|
+
|
65
|
+
```jsx
|
66
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
67
|
+
|
68
|
+
const config = {
|
69
|
+
pluginSlots: {
|
70
|
+
mobile_main_menu_slot: {
|
71
|
+
keepDefault: false,
|
72
|
+
plugins: [
|
73
|
+
{
|
74
|
+
op: PLUGIN_OPERATIONS.Insert,
|
75
|
+
widget: {
|
76
|
+
id: 'custom_main_menu_component',
|
77
|
+
type: DIRECT_PLUGIN,
|
78
|
+
RenderWidget: () => (
|
79
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
80
|
+
),
|
81
|
+
},
|
82
|
+
},
|
83
|
+
]
|
84
|
+
},
|
85
|
+
},
|
86
|
+
}
|
87
|
+
|
88
|
+
export default config;
|
89
|
+
```
|
90
|
+
|
91
|
+
### Add Custom Components before and after Menu
|
92
|
+
|
93
|
+
The following `env.config.jsx` will place custom components before and after the mobile main menu (in this case centered `h1`s with π and π).
|
94
|
+
|
95
|
+

|
96
|
+
|
97
|
+
```jsx
|
98
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
99
|
+
|
100
|
+
const config = {
|
101
|
+
pluginSlots: {
|
102
|
+
mobile_main_menu_slot: {
|
103
|
+
keepDefault: true,
|
104
|
+
plugins: [
|
105
|
+
{
|
106
|
+
op: PLUGIN_OPERATIONS.Insert,
|
107
|
+
widget: {
|
108
|
+
id: 'custom_before_main_menu_component',
|
109
|
+
type: DIRECT_PLUGIN,
|
110
|
+
priority: 10,
|
111
|
+
RenderWidget: () => (
|
112
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
113
|
+
),
|
114
|
+
},
|
115
|
+
},
|
116
|
+
{
|
117
|
+
op: PLUGIN_OPERATIONS.Insert,
|
118
|
+
widget: {
|
119
|
+
id: 'custom_after_main_menu_component',
|
120
|
+
type: DIRECT_PLUGIN,
|
121
|
+
priority: 90,
|
122
|
+
RenderWidget: () => (
|
123
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
124
|
+
),
|
125
|
+
},
|
126
|
+
},
|
127
|
+
]
|
128
|
+
},
|
129
|
+
},
|
130
|
+
}
|
131
|
+
|
132
|
+
export default config;
|
133
|
+
```
|
134
|
+
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
3
|
+
import MobileHeaderMainMenu, { mobileHeaderMainMenuDataShape } from '../../mobile-header/MobileHeaderMainMenu';
|
4
|
+
var MobileMainMenuSlot = function MobileMainMenuSlot(_ref) {
|
5
|
+
var menu = _ref.menu;
|
6
|
+
return /*#__PURE__*/React.createElement(PluginSlot, {
|
7
|
+
id: "mobile_main_menu_slot",
|
8
|
+
slotOptions: {
|
9
|
+
mergeProps: true
|
10
|
+
}
|
11
|
+
}, /*#__PURE__*/React.createElement(MobileHeaderMainMenu, {
|
12
|
+
menu: menu
|
13
|
+
}));
|
14
|
+
};
|
15
|
+
MobileMainMenuSlot.propTypes = {
|
16
|
+
menu: mobileHeaderMainMenuDataShape
|
17
|
+
};
|
18
|
+
export default MobileMainMenuSlot;
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PluginSlot","MobileHeaderMainMenu","mobileHeaderMainMenuDataShape","MobileMainMenuSlot","_ref","menu","createElement","id","slotOptions","mergeProps","propTypes"],"sources":["../../../src/plugin-slots/MobileMainMenuSlot/index.jsx"],"sourcesContent":["import React from 'react';\nimport { PluginSlot } from '@openedx/frontend-plugin-framework';\nimport MobileHeaderMainMenu, { mobileHeaderMainMenuDataShape } from '../../mobile-header/MobileHeaderMainMenu';\n\nconst MobileMainMenuSlot = ({\n menu,\n}) => (\n <PluginSlot\n id=\"mobile_main_menu_slot\"\n slotOptions={{\n mergeProps: true,\n }}\n >\n <MobileHeaderMainMenu menu={menu} />\n </PluginSlot>\n);\n\nMobileMainMenuSlot.propTypes = {\n menu: mobileHeaderMainMenuDataShape,\n};\n\nexport default MobileMainMenuSlot;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,oCAAoC;AAC/D,OAAOC,oBAAoB,IAAIC,6BAA6B,QAAQ,0CAA0C;AAE9G,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA;EAAA,IACtBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;EAAA,oBAEJN,KAAA,CAAAO,aAAA,CAACN,UAAU;IACTO,EAAE,EAAC,uBAAuB;IAC1BC,WAAW,EAAE;MACXC,UAAU,EAAE;IACd;EAAE,gBAEFV,KAAA,CAAAO,aAAA,CAACL,oBAAoB;IAACI,IAAI,EAAEA;EAAK,CAAE,CACzB,CAAC;AAAA,CACd;AAEDF,kBAAkB,CAACO,SAAS,GAAG;EAC7BL,IAAI,EAAEH;AACR,CAAC;AAED,eAAeC,kBAAkB","ignoreList":[]}
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# Mobile User Menu Slot
|
2
|
+
|
3
|
+
### Slot ID: `mobile_user_menu_slot`
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This slot is used to replace/modify/hide the mobile user menu.
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
### Modify Items
|
12
|
+
|
13
|
+
The following `env.config.jsx` will modify the items in the mobile user menu.
|
14
|
+
|
15
|
+

|
16
|
+
|
17
|
+
```jsx
|
18
|
+
import { PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
19
|
+
|
20
|
+
const modifyUserMenu = ( widget ) => {
|
21
|
+
widget.content.menu = [
|
22
|
+
{
|
23
|
+
items: [
|
24
|
+
{
|
25
|
+
type: 'item',
|
26
|
+
href: 'https://openedx.org/',
|
27
|
+
content: 'openedx.org',
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'item',
|
31
|
+
href: 'https://docs.openedx.org/en/latest/',
|
32
|
+
content: 'Documentation',
|
33
|
+
},
|
34
|
+
]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
items: [
|
38
|
+
{
|
39
|
+
type: 'item',
|
40
|
+
href: 'https://discuss.openedx.org/',
|
41
|
+
content: 'Forums',
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
];
|
46
|
+
return widget;
|
47
|
+
};
|
48
|
+
|
49
|
+
const config = {
|
50
|
+
pluginSlots: {
|
51
|
+
mobile_user_menu_slot: {
|
52
|
+
keepDefault: true,
|
53
|
+
plugins: [
|
54
|
+
{
|
55
|
+
op: PLUGIN_OPERATIONS.Modify,
|
56
|
+
widgetId: 'default_contents',
|
57
|
+
fn: modifyUserMenu,
|
58
|
+
},
|
59
|
+
]
|
60
|
+
},
|
61
|
+
},
|
62
|
+
}
|
63
|
+
|
64
|
+
export default config;
|
65
|
+
```
|
66
|
+
|
67
|
+
### Replace Menu with Custom Component
|
68
|
+
|
69
|
+
The following `env.config.jsx` will replace the mobile main user entirely (in this case with a centered πΊοΈ `h1`)
|
70
|
+
|
71
|
+

|
72
|
+
|
73
|
+
```jsx
|
74
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
75
|
+
|
76
|
+
const config = {
|
77
|
+
pluginSlots: {
|
78
|
+
mobile_user_menu_slot: {
|
79
|
+
keepDefault: false,
|
80
|
+
plugins: [
|
81
|
+
{
|
82
|
+
op: PLUGIN_OPERATIONS.Insert,
|
83
|
+
widget: {
|
84
|
+
id: 'custom_user_menu_component',
|
85
|
+
type: DIRECT_PLUGIN,
|
86
|
+
RenderWidget: () => (
|
87
|
+
<h1 style={{textAlign: 'center'}}>πΊοΈ</h1>
|
88
|
+
),
|
89
|
+
},
|
90
|
+
},
|
91
|
+
]
|
92
|
+
},
|
93
|
+
},
|
94
|
+
}
|
95
|
+
|
96
|
+
export default config;
|
97
|
+
```
|
98
|
+
|
99
|
+
### Add Custom Components before and after Menu
|
100
|
+
|
101
|
+
The following `env.config.jsx` will place custom components before and after the mobile user menu (in this case centered `h1`s with π and π).
|
102
|
+
|
103
|
+

|
104
|
+
|
105
|
+
```jsx
|
106
|
+
import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
|
107
|
+
|
108
|
+
const config = {
|
109
|
+
pluginSlots: {
|
110
|
+
mobile_user_menu_slot: {
|
111
|
+
keepDefault: true,
|
112
|
+
plugins: [
|
113
|
+
{
|
114
|
+
op: PLUGIN_OPERATIONS.Insert,
|
115
|
+
widget: {
|
116
|
+
id: 'custom_before_user_menu_component',
|
117
|
+
type: DIRECT_PLUGIN,
|
118
|
+
priority: 10,
|
119
|
+
RenderWidget: () => (
|
120
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
121
|
+
),
|
122
|
+
},
|
123
|
+
},
|
124
|
+
{
|
125
|
+
op: PLUGIN_OPERATIONS.Insert,
|
126
|
+
widget: {
|
127
|
+
id: 'custom_after_user_menu_component',
|
128
|
+
type: DIRECT_PLUGIN,
|
129
|
+
priority: 90,
|
130
|
+
RenderWidget: () => (
|
131
|
+
<h1 style={{textAlign: 'center'}}>π</h1>
|
132
|
+
),
|
133
|
+
},
|
134
|
+
},
|
135
|
+
]
|
136
|
+
},
|
137
|
+
},
|
138
|
+
}
|
139
|
+
|
140
|
+
export default config;
|
141
|
+
```
|
142
|
+
|
Binary file
|