Skip to content

edx/frontend-component-footer-edx

frontend-component-footer-edx

Build Status npm_version npm_downloads license semantic-release

frontend-component-footer-edx is a library containing a site footer component for use when building edX frontend applications.

Usage

To install frontend-component-footer-edx into your project:

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

Component Usage:

import Footer from '@edx/frontend-component-footer-edx';
import footerMessages from '@edx/frontend-component-footer-edx/src/i18n/index';

...

<Footer
   onLanguageSelected={(languageCode) => {/* set language */}}
   supportedLanguages={[
      { label: 'English', value: 'en'},
      { label: 'Español', value: 'es' },
   ]}
/>
  • onLanguageSelected (optional)
  • supportedLanguages (optional)

Requirements

This component uses @edx/frontend-i18n. Any containing app must provide @edx/frontend-i18n as a peer dependency, and be wrapped inside an IntlProvider element, whether or not your consuming application is actually localized. For a basic default locale (English) version, follow the IntlProvider example in the sample application in src/index.jsx.

Development

Start the dev server:

npm i && npm start

Build the component:

npm run build