import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import { browserIcon, osIcon, deviceTypeIcon } from 'App/iconNames'; import { formatTimeOrDate } from 'App/date'; import { sessions as sessionsRoute, assist as assistRoute, liveSession as liveSessionRoute, withSiteId } from 'App/routes'; import { Icon, CountryFlag, IconButton, BackLink, Popup, Link } from 'UI'; import { toggleFavorite, setSessionPath } from 'Duck/sessions'; import cn from 'classnames'; import { connectPlayer } from 'Player'; // import HeaderInfo from './HeaderInfo'; import SharePopup from '../shared/SharePopup/SharePopup'; import { fetchList as fetchListIntegration } from 'Duck/integrations/actions'; import { countries } from 'App/constants'; import SessionMetaList from 'Shared/SessionItem/SessionMetaList'; import stl from './playerBlockHeader.css'; import Issues from './Issues/Issues'; import Autoplay from './Autoplay'; import AssistActions from '../Assist/components/AssistActions'; import AssistTabs from '../Assist/components/AssistTabs'; import SessionInfoItem from './SessionInfoItem' const SESSIONS_ROUTE = sessionsRoute(); const ASSIST_ROUTE = assistRoute(); @connectPlayer(state => ({ width: state.width, height: state.height, live: state.live, loading: state.cssLoading || state.messagesLoading, })) @connect((state, props) => { const isAssist = window.location.pathname.includes('/assist/'); const session = state.getIn([ 'sessions', 'current' ]); return { isAssist, session, sessionPath: state.getIn([ 'sessions', 'sessionPath' ]), loading: state.getIn([ 'sessions', 'toggleFavoriteRequest', 'loading' ]), disabled: state.getIn([ 'components', 'targetDefiner', 'inspectorMode' ]) || props.loading, jiraConfig: state.getIn([ 'issues', 'list' ]).first(), issuesFetched: state.getIn([ 'issues', 'issuesFetched' ]), local: state.getIn(['sessions', 'timezone']), funnelRef: state.getIn(['funnels', 'navRef']), siteId: state.getIn([ 'user', 'siteId' ]), metaList: state.getIn(['customFields', 'list']).map(i => i.key), closedLive: !!state.getIn([ 'sessions', 'errors' ]) || (isAssist && !session.live), } }, { toggleFavorite, fetchListIntegration, setSessionPath }) @withRouter export default class PlayerBlockHeader extends React.PureComponent { componentDidMount() { if (!this.props.issuesFetched) this.props.fetchListIntegration('issues') } getDimension = (width, height) => { return width && height ? (