Coder Social home page Coder Social logo

kuyesu / frontend-component-footer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openedx/frontend-component-footer

0.0 0.0 0.0 1.61 MB

Site footer component for edX frontend apps.

License: GNU Affero General Public License v3.0

JavaScript 86.96% HTML 1.21% Makefile 10.46% SCSS 1.37%

frontend-component-footer's Introduction

frontend-component-footer

Build Status Codecov npm_version npm_downloads license semantic-release

Overview

A generic footer for Open edX micro-frontend applications. It includes a logo and an optional language selector dropdown.

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.

Environment Variables

This component requires that the following environment variable be set by the consuming micro-frontend.

  • LOGO_TRADEMARK_URL - This is a URL to a logo for use in the footer. This is a different environment variable than LOGO_URL (used in frontend-component-header) to accommodate sites that would like to have additional trademark information on a logo in the footer, such as a (tm) or (r) symbol.

Installation

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

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

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

Usage

This library has the following exports:

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

<Footer /> component props

  • onLanguageSelected: Provides the footer with an event handler for when the user selects a language from its dropdown.
  • supportedLanguages: An array of objects representing available languages. See example below for object shape.

Examples

Component Usage Example:

import Footer, { messages } from '@edx/frontend-component-footer';

...

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

Development

Install dependencies:

npm i

Start the development server:

npm start

Build a production distribution:

npm run build

frontend-component-footer's People

Contributors

renovate-bot avatar robrap avatar davidjoy avatar stvstnfrd avatar albemarle avatar tuchfarber avatar adamstankiewicz avatar caplan188 avatar renovate[bot] avatar christopappas avatar jawayria avatar abutterworth avatar douglashall avatar chavesj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.