Advertisement
Guest User

Untitled

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