MatchEventsLarge.jsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // styling
  2. import styled from 'styled-components/macro';
  3. // components
  4. import Spring from '@components/Spring';
  5. import ClubInfo from '@components/ClubInfo';
  6. import Score from '@ui/Score';
  7. import MatchTrack from '@ui/MatchTrack';
  8. import MatchEventText from '@ui/MatchEventText';
  9. import MatchProgress from '@ui/MatchProgress';
  10. // hooks
  11. import useMeasure from 'react-use-measure';
  12. const Header = styled.div`
  13. .main {
  14. display: none;
  15. // tablet portrait
  16. @media screen and (min-width: 768px) {
  17. display: flex;
  18. }
  19. }
  20. `;
  21. const MatchEventsLarge = () => {
  22. const [ref, {width}] = useMeasure();
  23. const events = [
  24. {type: 'goal', minute: 6, count: 1},
  25. {type: 'goal', minute: 20, count: 1},
  26. {type: 'substitution', minute: 30, count: 2},
  27. {type: 'goal', minute: 47, count: 1},
  28. {type: 'goal', minute: 60, count: 1},
  29. {type: 'substitution', minute: 70, count: 2},
  30. ]
  31. return (
  32. <Spring className="card d-flex flex-column">
  33. <Header className="d-flex align-items-center justify-content-between card-padded p-relative">
  34. <ClubInfo id="bayern"/>
  35. <Score team1={0} team2={2}/>
  36. <ClubInfo id="barcelona" wrapperClass="flex-row-reverse text-right"/>
  37. </Header>
  38. <div className="d-flex flex-column g-20 flex-1 p-relative card-padded"
  39. ref={ref}
  40. style={{paddingTop: 20}}>
  41. <MatchProgress currentMinute={79} containerWidth={width}/>
  42. <MatchEventText minute={79} text="Bayern attacks on the left"/>
  43. <MatchTrack events={events} currentMinute={79}/>
  44. </div>
  45. </Spring>
  46. )
  47. }
  48. export default MatchEventsLarge