Skip to content

Latest commit

 

History

History

HeaderSlot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Header Slot

Slot ID: header_slot

Props:

  • courseOrg
  • courseNumber
  • courseTitle
  • showUserDropdown

Description

This slot is used to replace/modify/hide the entire learning header.

Example

The following env.config.jsx will replace the learning header entirely.

Screenshot of custom component

import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';

const config = {
  pluginSlots: {
    header_slot: {
      keepDefault: false,
      plugins: [
        {
          op: PLUGIN_OPERATIONS.Insert,
          widget: {
            id: 'custom_header_component',
            type: DIRECT_PLUGIN,
            RenderWidget: ({courseOrg, courseNumber, courseTitle, showUserDropdown}) => (
              <>
                <h1 style={{textAlign: 'center'}}>🌞</h1>
                <p style={{textAlign: 'center'}}>courseOrg: {courseOrg}</p>
                <p style={{textAlign: 'center'}}>courseNumber: {courseNumber}</p>
                <p style={{textAlign: 'center'}}>courseTitle: {courseTitle}</p>
                <p style={{textAlign: 'center'}}>showUserDropdown: {showUserDropdown ? '👍' : '👎'}</p>
                <h1 style={{textAlign: 'center'}}>🌚</h1>
              </>
            ),
          },
        },
      ]
    }
  },
}

export default config;