0.1.0 • Published 7 years ago

react-playbuzz v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

react-playbuzz Build Status codecov

React component to render an embeded PlayBuzz game. How to embed a PlayBuzz game

Install

To install and use this component:

yarn add react-playbuzz

or you can do it with npm also:

npm install react-playbuzz

Usage

Just import the PlayBuzz component from the react-playbuzz package and use it as a simple react component.

import React from 'react';
import ReactDOM from 'react-dom';
import PlayBuzz from 'react-playbuzz';

ReactDOM.render(
  <PlayBuzz
    url='http://www.playbuzz.com/peepersc10/who-is-your-favorite-super-hero'
    load={true}
    options={{
      shares: true
    }}
  />,
  document.getElementById('root')
);

Properties

NameTypeDescriptionSampleDefault
urlstringGame URL"http://www.playbuzz.com/peepersc10/who-is-your-favorite-super-hero"""
loadboolLoad playbuzz script async from cdn if its not already loadedtruefalse
heightintComponent height in pixels250null
recommendboolDisplay recommendations for more itemstruefalse
gameInfoboolDisplay item info (the thumbnail, name, description and editor)truefalse
commentsboolUse facebook commentstruefalse
sharesboolDisplay share buttons (will redirect to your page)truefalse

The load property add a script tag asynchronously to the end of the body tag: //cdn.playbuzz.com/widget/feed.js. Only if it is not already loaded.

Demo

To run a demonstration, clone this project, install it locally and start the demo server:

yarn
npm start

or

npm i
npm start

You may see a message: Listening at http://localhost:3000. Then go to your browser and check it out: http://localhost:3000/demo.

Testing

This projects uses jest, enzime and jsdom for testing. To run the tests:

npm test