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
; const options = /* see `options` above */; <Consumption open options=options />
Non-React App
; const options = /* see `options` above */; ;