Skip to content

Commit

Permalink
feat(FEC-9596): add missing tooltips in replay overlay and vrStereo (#…
Browse files Browse the repository at this point in the history
…480)

* Added tooltips to pre-playback-play-overlay and vr-stereo
* Replaced localizer with @withText in both
* moved font-family css selector higher in the DOM so it effects all the DOM and removed unneeded CSS due to it's previous selector
* fixed playbackGuiWWrapper misspelling
  • Loading branch information
RoyBregman committed Jan 27, 2020
1 parent e398fe7 commit bd983ee
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 37 deletions.
1 change: 0 additions & 1 deletion src/components/cast-on-tv/_cast-on-tv.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
opacity: 0;

span {
font-family: $font-family;
font-weight: lighter;
color: white;
}
Expand Down
1 change: 0 additions & 1 deletion src/components/cast-overlay/_cast-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
bottom: 0;
left: 89px;
height: 128px;
font-family: $font-family;
font-weight: lighter;

.cast-status {
Expand Down
1 change: 0 additions & 1 deletion src/components/error-overlay/_error-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
align-items: center;
flex-direction: column;
height: 100%;
font-family: $font-family;

.copy-url-row{
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
left: 0;
width: 100%;
height: 100%;
font-family: $font-family;
display: flex;
align-items: center;
justify-content: center;
Expand Down
1 change: 0 additions & 1 deletion src/components/playlist-countdown/_playlist-countdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
}
.player {
.playlist-countdown {
font-family: $font-family;
height: 72px;
position: absolute;
right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {bindActions} from '../../utils/bind-actions';
import {default as Icon, IconType} from '../icon';
import {KeyMap} from '../../utils/key-map';
import {actions as loadingActions} from '../../reducers/loading';
import {Localizer, Text} from 'preact-i18n';
import {withText} from 'preact-i18n';
import {withPlayer} from '../player';
import {withEventDispatcher} from 'components/event-dispatcher';
import {withLogger} from 'components/logger';
import {Tooltip} from 'components/tooltip';

/**
* mapping state to props
Expand All @@ -32,6 +33,10 @@ const COMPONENT_NAME = 'PrePlaybackPlayOverlay';
@withPlayer
@withLogger(COMPONENT_NAME)
@withEventDispatcher(COMPONENT_NAME)
@withText({
startOverText: 'controls.startOver',
playText: 'controls.play'
})
/**
* PrePlaybackPlayOverlay component
*
Expand Down Expand Up @@ -63,23 +68,20 @@ class PrePlaybackPlayOverlay extends Component {
if ((!props.prePlayback && (!props.isPlaybackEnded || (props.playlist && props.playlist.next))) || props.loading) {
return undefined;
}
const labelText = props.isPlaybackEnded ? props.startOverText : props.playText;
return (
<div className={style.prePlaybackPlayOverlay} onMouseOver={e => e.stopPropagation()} onClick={() => this.handleClick()}>
{
<Localizer>
<a
className={style.prePlaybackPlayButton}
tabIndex="0"
aria-label={<Text id={props.isPlaybackEnded ? 'controls.startOver' : 'controls.play'} />}
onKeyDown={e => {
if (e.keyCode === KeyMap.ENTER) {
this.handleClick();
}
}}>
{props.isPlaybackEnded ? <Icon type={IconType.StartOver} /> : <Icon type={IconType.Play} />}
</a>
</Localizer>
}
<a
className={style.prePlaybackPlayButton}
tabIndex="0"
aria-label={labelText}
onKeyDown={e => {
if (e.keyCode === KeyMap.ENTER) {
this.handleClick();
}
}}>
<Tooltip label={labelText}>{props.isPlaybackEnded ? <Icon type={IconType.StartOver} /> : <Icon type={IconType.Play} />}</Tooltip>
</a>
</div>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/tooltip/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
.player .tooltip {
position: relative;
display: inline-block;
height: 100%;
width: 100%;
.tooltip-label {
visibility: hidden;
background-color: $tooltip-bg-color;
Expand All @@ -23,6 +25,7 @@
width: max-content;
display: table;


&:after {
content: '';
position: absolute;
Expand Down
12 changes: 8 additions & 4 deletions src/components/vr-stereo/vr-stereo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@flow
import style from '../../styles/style.scss';
import {h, Component} from 'preact';
import {Localizer, Text} from 'preact-i18n';
import {withText} from 'preact-i18n';
import {default as Icon, IconType} from '../icon';
import {KeyMap} from '../../utils/key-map';
import {actions as engineActions} from '../../reducers/engine';
Expand All @@ -10,6 +10,7 @@ import {connect} from 'preact-redux';
import {actions as shellActions} from '../../reducers/shell';
import {withPlayer} from '../player';
import {withLogger} from 'components/logger';
import {Tooltip} from 'components/tooltip';

/**
* mapping state to props
Expand All @@ -30,6 +31,9 @@ const COMPONENT_NAME = 'VrStereo';
)
@withPlayer
@withLogger(COMPONENT_NAME)
@withText({
vrStereoText: 'controls.vrStereo'
})
/**
* VrStereo component
*
Expand Down Expand Up @@ -79,10 +83,10 @@ class VrStereo extends Component {
}
return (
<div className={[style.controlButtonContainer, style.controlVrStereo].join(' ')}>
<Localizer>
<Tooltip label={this.props.vrStereoText}>
<button
tabIndex="0"
aria-label={<Text id={'controls.vrStereo'} />}
aria-label={this.props.vrStereoText}
className={this.props.vrStereoMode ? [style.controlButton, style.vrStereoMode].join(' ') : style.controlButton}
onClick={() => this.onClick()}
onKeyDown={e => {
Expand All @@ -93,7 +97,7 @@ class VrStereo extends Component {
<Icon type={IconType.vrStereo} />
<Icon type={IconType.vrStereoFull} />
</button>
</Localizer>
</Tooltip>
</div>
);
}
Expand Down
1 change: 0 additions & 1 deletion src/styles/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@

select {
font-size: 15px;
font-family: $font-family;
color: #fff;
-webkit-appearance: none;
border: 0;
Expand Down
12 changes: 5 additions & 7 deletions src/styles/_shell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
user-select: none;
-webkit-tap-highlight-color: transparent;

.playback-gui-wrapper {
font-family: $font-family;
}

&:-webkit-full-screen {
width: 100%;
height: 100%;
Expand All @@ -31,16 +35,10 @@
opacity: 0;
overflow: hidden;
font-size: 0;
font-family: $font-family;

label {
margin-bottom: 0;
}

input,
textarea {
font-family: $font-family;
}
}
:global(.overlay-portal) {
position: absolute;
Expand All @@ -64,7 +62,7 @@
}

.player.nav {
* {
* {
&:focus {
outline: 1px solid $tab-focus-color !important;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PRESET_NAME = 'Error';
*/
export function ErrorUI(): React$Element<any> {
return (
<div className={style.playbackGuiWWrapper}>
<div className={style.playbackGuiWrapper}>
<ErrorOverlay />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/idle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PRESET_NAME = 'Idle';
*/
export function IdleUI(): React$Element<any> {
return (
<div className={style.playbackGuiWWrapper}>
<div className={style.playbackGuiWrapper}>
<Loading />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/live.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const PRESET_NAME = 'Live';
export function LiveUI(props: any): React$Element<any> {
props.updateIsKeyboardEnabled(true);
return (
<Container className={style.playbackGuiWWrapper} name={'VideoOverlay'} preAppendTo={'Backdrop'}>
<Container className={style.playbackGuiWrapper} name={'VideoOverlay'} preAppendTo={'Backdrop'}>
<Loading />
<Container className={style.playerGui} name={'PlayerGUI'} id="player-gui">
<OverlayPortal />
Expand Down
2 changes: 1 addition & 1 deletion src/ui-presets/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const PRESET_NAME = 'Playback';
function PlaybackUI(props: any): React$Element<any> {
props.updateIsKeyboardEnabled(true);
return (
<Container className={style.playbackGuiWWrapper} name={'VideoOverlay'} preAppendTo={'Backdrop'}>
<Container className={style.playbackGuiWrapper} name={'VideoOverlay'} preAppendTo={'Backdrop'}>
<Loading />
<Container className={style.playerGui} name={'PlayerGUI'} id="player-gui">
<OverlayPortal />
Expand Down

0 comments on commit bd983ee

Please sign in to comment.