import React, { Component } from 'react' import { connect } from 'react-redux' import { TransitionGroup, CSSTransition } from 'react-transition-group' import actions from 'app/actions' import { floatInRange, floatLT } from 'app/utils' import { fullscreenComponents } from './components.fullscreen' class PlayerFullscreen extends Component { state = { elements: [], } componentDidMount() { this.setCurrentElements() } componentDidUpdate(prevProps) { if (this.props.audio.play_ts === prevProps.audio.play_ts) return this.setCurrentElements() } setCurrentElements() { const { audio, timeline } = this.props const { play_ts } = audio const elements = timeline.filter(element => ( floatInRange(element.start_ts, play_ts, element.fade_out_start_ts + 0.1) )) this.setState({ elements }) } render() { const { audio, media } = this.props const { play_ts } = audio const { elements } = this.state const className = elements.length ? "viewer-fullscreen active" : "viewer-fullscreen" // console.log(elements, play_ts) return (