diff --git a/frontend/app/components/Session_/Player/Controls/Controls.tsx b/frontend/app/components/Session_/Player/Controls/Controls.tsx index f55e54c04..bbf1b5ee8 100644 --- a/frontend/app/components/Session_/Player/Controls/Controls.tsx +++ b/frontend/app/components/Session_/Player/Controls/Controls.tsx @@ -1,22 +1,23 @@ import React from 'react'; import cn from 'classnames'; import { connect } from 'react-redux'; -import { STORAGE_TYPES, selectStorageType } from 'Player'; +import { selectStorageType, STORAGE_TYPES } from 'Player'; +import { PlayButton, PlayingState, FullScreenButton } from 'Player/components' import { Icon, Tooltip } from 'UI'; import { - fullscreenOn, - fullscreenOff, - toggleBottomBlock, - OVERVIEW, CONSOLE, - NETWORK, - STACKEVENTS, - STORAGE, - PROFILER, - PERFORMANCE, + fullscreenOff, + fullscreenOn, GRAPHQL, INSPECTOR, + NETWORK, + OVERVIEW, + PERFORMANCE, + PROFILER, + STACKEVENTS, + STORAGE, + toggleBottomBlock, } from 'Duck/components/player'; import { PlayerContext } from 'App/components/Session/playerContext'; import { observer } from 'mobx-react-lite'; @@ -138,53 +139,13 @@ function Controls(props: any) { }; const renderPlayBtn = () => { - let label; - let icon; - if (completed) { - icon = 'arrow-clockwise' as const; - label = 'Replay this session'; - } else if (playing) { - icon = 'pause-fill' as const; - label = 'Pause'; - } else { - icon = 'play-fill-new' as const; - label = 'Pause'; - label = 'Play'; - } + const state = completed ? PlayingState.Completed : playing ? PlayingState.Playing : PlayingState.Paused return ( - -
player.togglePlay()} - className="hover-main color-main cursor-pointer rounded hover:bg-gray-light-shade" - > - -
-
+ ); }; - const controlIcon = ( - icon: string, - size: number, - action: (args: any) => any, - isBackwards: boolean, - additionalClasses: string - ) => ( -
- -
- ); - const toggleBottomTools = (blockName: number) => { if (blockName === INSPECTOR) { // player.toggleInspectorMode(false); @@ -210,7 +171,6 @@ function Controls(props: any) { toggleSpeed={() => player.toggleSpeed()} toggleSkip={() => player.toggleSkip()} playButton={renderPlayBtn()} - controlIcon={controlIcon} skipIntervals={SKIP_INTERVALS} setSkipInterval={changeSkipInterval} currentInterval={skipInterval} @@ -301,13 +261,11 @@ function Controls(props: any) { )} - {controlIcon( - 'arrows-angle-extend', - 16, - props.fullscreenOn, - false, - 'rounded hover:bg-gray-light-shade color-gray-medium' - )} + diff --git a/frontend/app/components/Session_/Player/Controls/Time.js b/frontend/app/components/Session_/Player/Controls/Time.js index 5c2c0da0c..3a8bbfa2f 100644 --- a/frontend/app/components/Session_/Player/Controls/Time.js +++ b/frontend/app/components/Session_/Player/Controls/Time.js @@ -1,25 +1,15 @@ import React from 'react'; -import { Duration } from 'luxon'; -import styles from './time.module.css'; import { PlayerContext } from 'App/components/Session/playerContext'; import { observer } from 'mobx-react-lite'; - -const Time = ({ time, isCustom, format = 'm:ss', }) => ( -
- { Duration.fromMillis(time).toFormat(format) } -
-) - -Time.displayName = "Time"; +import { PlayTime } from 'Player/components' const ReduxTime = observer(({ format, name, isCustom }) => { const { store } = React.useContext(PlayerContext) const time = store.get()[name] - return