Skip to content

Commit

Permalink
feat: repurpose as open edx footer (#46)
Browse files Browse the repository at this point in the history
* feat: simplify prop api and bake in many values

* feat: refactor build and dev server

BREAKING CHANGE: The footer is now  transpiled from es6 preserving modules. To use this package in a project it must now be transpiled by the requiring project via webpack or other configuration

* feat: make this the open edx footer

BREAKING CHANGE: This footer now serves as the Open edX footer. For the edX footer see edx/frontend-component-footer-edx on github
  • Loading branch information
Adam Butterworth authored and davidjoy committed Sep 30, 2019
1 parent 31e255e commit 83bad3d
Show file tree
Hide file tree
Showing 35 changed files with 11,428 additions and 21,124 deletions.
28 changes: 0 additions & 28 deletions .babelrc

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
coverage
dist
node_modules
Expand Down
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
language: node_js
node_js:
- 8
cache:
directories:
- "~/.npm"
node_js: 12
install:
- npm install
script:
- npm run lint
- npm run i18n_extract
- npm run test
- npm run build
- npm run is-es5
after_success:
- npm run travis-deploy-once "npm run semantic-release"
- npx semantic-release
- npm run coveralls
env:
global:
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transi
# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl

build:
rm -rf ./dist
./node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/__mocks__,**/__snapshots__,**/setupTest.js --copy-files
@# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want.
@rm -rf dist/**/*.test.jsx
@rm -rf dist/**/__snapshots__
@rm -rf dist/__mocks__

requirements:
npm install

Expand Down
31 changes: 25 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ frontend-component-footer
|semantic-release|

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

At this time, this component is hard-coded to match the legacy LMS site footer, including all of its links. As implemented, this component should probably be called the ``frontend-component-lms-footer``.
component for use when building Open edX frontend applications.

Usage
-----
Expand All @@ -16,9 +14,30 @@ To install frontend-component-footer into your project::

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

The component expects properties specifying the various URLs that are
linked in the footer. See the sample app in `src/index.jsx <src/index.jsx>`__ for an example
of how the SiteFooter component can be specified.
Component Usage::

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

...

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

- handleAllTrackEvents (required)
- onLanguageSelected (optional)
- supportedLanguages (optional)

Styles (project.scss)::

@import '@edx/frontend-component-footer/src/footer.scss';


Requirements
------------
Expand Down
35 changes: 35 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// These preset packages are included by frontend-build.
// TODO: Add to frontend-build and leverage that config.
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
],
env: {
i18n: {
plugins: [
[
'react-intl',
{
messagesDir: './temp/babel-plugin-react-intl',
moduleSourceName: '@edx/frontend-i18n',
},
],
],
},
test: {
presets: [
'@babel/preset-env',
],
},
},
};
15 changes: 0 additions & 15 deletions config/webpack.common.config.js

This file was deleted.

115 changes: 0 additions & 115 deletions config/webpack.dev.config.js

This file was deleted.

71 changes: 0 additions & 71 deletions config/webpack.prod.config.js

This file was deleted.

Loading

0 comments on commit 83bad3d

Please sign in to comment.