5.3.2 • Published 20 hours ago

@edx/frontend-component-header v5.3.2

Weekly downloads
435
License
AGPL-3.0
Repository
github
Last release
20 hours ago

######################### frontend-component-header #########################

|Build Status| |Codecov| |npm_version| |npm_downloads| |license| |semantic-release|


Overview


A generic header for Open edX micro-frontend applications.


Requirements


This component uses @edx/frontend-platform services such as i18n, analytics, configuration, and the AppContext React component, and expects that it has been loaded into a micro-frontend that has been properly initialized via @edx/frontend-platform's initialize function. Please visit the frontend template application to see an example. <https://github.com/openedx/frontend-template-application/blob/master/src/index.jsx>_

Environment Variables

  • LMS_BASE_URL - The URL of the LMS of your Open edX instance.
  • LOGOUT_URL - The URL of the API endpoint which performs a user logout.
  • LOGIN_URL - The URL of the login page where a user can sign into their account.
  • SITE_NAME - The user-facing name of the site, used as alt text on the logo in the header. Defaults to "localhost" in development.
  • LOGO_URL - The URL of the site's logo. This logo is displayed in the header.
  • ORDER_HISTORY_URL - The URL of the order history page.
  • ACCOUNT_PROFILE_URL - The URL of the account profile page.
  • ACCOUNT_SETTINGS_URL - The URL of the account settings page.
  • AUTHN_MINIMAL_HEADER - A boolean flag which hides the main menu, user menu, and logged-out menu items when truthy. This is intended to be used in micro-frontends like frontend-app-authentication in which these menus are considered distractions from the user's task.

Installation


To install this header into your Open edX micro-frontend, run the following command in your MFE:

npm i --save @edx/frontend-component-header

This will make the component available to be imported into your application.


Usage


This library has the following exports:

  • (default): The header as a React component.
  • messages: Internationalization messages suitable for use with @edx/frontend-platform/i18n <https://edx.github.io/frontend-platform/module-Internationalization.html>_
  • dist/index.scss: A SASS file which contains style information for the component. It should be imported into the micro-frontend's own SCSS file.

Examples

  • An example of component and messages usage. <https://github.com/openedx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L21>_
  • An example of SCSS file usage. <https://github.com/openedx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L8>_

Development


Install dependencies::

npm ci

Start the development server::

npm start

Build a production distribution::

npm run build

.. |Build Status| image:: https://api.travis-ci.com/edx/frontend-component-header.svg?branch=master :target: https://travis-ci.com/edx/frontend-component-header .. |Codecov| image:: https://img.shields.io/codecov/c/github/edx/frontend-component-header :target: @edx/frontend-component-header .. |npm_version| image:: https://img.shields.io/npm/v/@edx/frontend-component-header.svg :target: @edx/frontend-component-header .. |npm_downloads| image:: https://img.shields.io/npm/dt/@edx/frontend-component-header.svg :target: @edx/frontend-component-header .. |license| image:: https://img.shields.io/npm/l/@edx/frontend-component-header.svg :target: @edx/frontend-component-header .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg :target: https://github.com/semantic-release/semantic-release

5.3.2

20 hours ago

5.3.1

13 days ago

5.3.0

28 days ago

5.2.0

1 month ago

5.1.1

1 month ago

5.1.0

2 months ago

5.0.2

4 months ago

5.0.1

4 months ago

5.0.0

4 months ago

4.11.1

5 months ago

4.10.2

5 months ago

4.11.0

5 months ago

4.9.4

6 months ago

4.9.3

7 months ago

4.9.0

7 months ago

4.7.2

7 months ago

4.7.1

7 months ago

4.9.2

7 months ago

4.9.1

7 months ago

4.4.1

10 months ago

4.2.3

11 months ago

4.4.0

11 months ago

4.6.1

8 months ago

4.4.3

10 months ago

4.6.0

9 months ago

4.4.2

10 months ago

4.10.1

6 months ago

4.10.0

6 months ago

4.8.1

7 months ago

4.8.0

7 months ago

4.4.4

10 months ago

4.5.0

10 months ago

4.3.1

11 months ago

4.7.0

8 months ago

4.5.2

9 months ago

4.5.1

9 months ago

4.3.0

11 months ago

4.2.2

11 months ago

4.2.1

11 months ago

3.7.5

1 year ago

3.7.3

1 year ago

3.7.2

1 year ago

4.0.4

11 months ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.3

1 year ago

4.2.0

11 months ago

4.0.2

1 year ago

3.6.5

1 year ago

3.6.4

1 year ago

3.6.3

1 year ago

3.7.1

1 year ago

3.7.0

1 year ago

4.1.0

11 months ago

3.6.2

1 year ago

3.6.1

1 year ago

3.6.0

1 year ago

3.4.0

2 years ago

3.2.2

2 years ago

3.3.0

2 years ago

3.2.1

2 years ago

3.5.0

1 year ago

3.4.1

2 years ago

3.1.3

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.5.0

2 years ago

2.4.6

2 years ago

2.4.3

2 years ago

2.4.5

2 years ago

2.4.4

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.2

2 years ago

2.3.0

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago