Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import React, { Component } from "react";
  2. import PropTypes from "prop-types";
  3.  
  4. import AwardedScorePortal from "./awardedScorePortal";
  5.  
  6. class AwardedScore extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.awardedScore = null;
  10. }
  11.  
  12. componentDidMount() {
  13. this.startAnimation();
  14. }
  15.  
  16. startAnimation() {
  17. // animate awarded score
  18. }
  19.  
  20. render() {
  21. const { points } = this.props;
  22. return (
  23. <AwardedScorePortal>
  24. <div ref={elem => { this.awardedScore = elem; }}>
  25. <p>{points} points</p>
  26. </div>
  27. </AwardedScorePortal>
  28. );
  29. }
  30. }
  31.  
  32. AwardedScore.propTypes = {
  33. points: PropTypes.number
  34. };
  35.  
  36. export default AwardedScore;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement