项目作者: PradeepJaiswar

项目描述 :
React component for showing live football match timer
高级语言: JavaScript
项目地址: git://github.com/PradeepJaiswar/live-football-match-timer.git


Live football match timer

React component for showing live football match timer

Pre-requisites

Install Dependencies

npm install

Run example App

npm start

Open localhost:9000

Example

  1. import MatchTimer from 'live-football-match-timer';
  2. const config = {
  3. matchDate: '2018/12/12',
  4. id: '23',
  5. startTime: '13:00',
  6. };
  7. class YourComponent extends React.Component {
  8. constructor(props, context) {
  9. super(props, context);
  10. this.state = {
  11. };
  12. }
  13. render() {
  14. return (
  15. <div >
  16. <MatchTimer config={config} ></MatchTimer>
  17. </div>
  18. );
  19. }
  20. }

Config

You can custmize config param pass to component

Required params

Name Type Default Description
matchDate string - Match date in YYYY/MM/DD format
id string - Unique match identifier
startTime string - match start time in 24 hour format hh:mm

Optinal params

Name Type Default Description
eachHalfTime number 45 Each half Time
halfBreakTime number 15 -
firstHalfExtraTime number 0 -
secondHalfExtraTime number 0 -
containerClass string null Container div class for component
TimerClass string null Timer span class
macthStatusTextClass string null Extra match status info div class for text Live/HT/FT and extra time with seconds