content-types-rogan-test

0.1.1-test • Public • Published

Consumption

How is this app used?

This app is currently served in MediaWiki and on feeds and posts.

MediaWiki

On MediaWiki the app is served via the TriviaQuizzes extension which replaces the Recent Wiki Activity module in the right rail. All parts of the application are built in the content-types repo. See the README for more information.

FEPO

On feeds and posts the application is bundled as a seperate chunk that is lazy loaded. The entry points are built in FEPO itself rather than this repo. See PostDetailsContainer for more information.

Quick start

    yarn                            // install deps
    yarn consumption:start          // start developing
    yarn consumption:build          // create dist files
    yarn consumption:lint           // lint
    yarn consumption:lint:fix       // fix lint

Usage

Clients need to pass the options object either to the component or function initializing the library.

const options = {
    environment: 'fepo', // or `media-wiki`
    pageType: 'Feed', // one of: `Feed`, `Post Details`, `Article`
    community: {
        id: 1001, // initial quiz is loaded from this site id
        dbName: 'foo',
    },
    user: {
        id: 1234,
        isGDPRApproved: true, // any other value than true will assume `false`
    },
    theme: {
        primaryColor: 'rgb(172, 50, 50)',
        backgroundColor: 'rgb(50, 1, 10)',
    },
};

All but community and pageType options are optional.

Integration with React apps

import Consumption from '@wikia/content-types/consumption.lib';
 
const options = {
    /* see `options` above */
};
 
<Consumption open options={options} />
 

Non-React App

import consumption from '@wikia/content-types/consumption.browser';
 
const options = {
    /* see `options` above */
};
 
consumption('#where_to_put_the_rail_module', options);

Creation

Readme

Keywords

none

Package Sidebar

Install

npm i content-types-rogan-test

Weekly Downloads

1

Version

0.1.1-test

License

UNLICENSED

Unpacked Size

33 MB

Total Files

726

Last publish

Collaborators

  • jrogan