From a5cda9e304456d8e0853154369a73fc1b394cb99 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 21 Nov 2020 18:08:10 +0100 Subject: style that mobile close button --- .../frontend/app/views/viewer/nav/eflux.chrome.js | 32 +++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/nav/eflux.chrome.js') diff --git a/animism-align/frontend/app/views/viewer/nav/eflux.chrome.js b/animism-align/frontend/app/views/viewer/nav/eflux.chrome.js index e58e2e1..bc7e4e7 100644 --- a/animism-align/frontend/app/views/viewer/nav/eflux.chrome.js +++ b/animism-align/frontend/app/views/viewer/nav/eflux.chrome.js @@ -7,6 +7,7 @@ import { import { PlayButton } from './viewer.icons' import actions from 'app/actions' import { URLS } from 'app/constants' +import { isHandheld } from 'app/utils' const PLAY_MESSAGES = { not_started: 'Start the Exhibition', @@ -66,6 +67,7 @@ class EfluxChrome extends Component { if (navStyle) className += ' ' + navStyle if (navGradient) className += ' gradient' if (transcriptOpen) className += ' transcript-open' + if (isFullscreen) className += ' is-fullscreen' return (
@@ -81,20 +83,9 @@ class EfluxChrome extends Component {
{growlMessage}
+ {isFullscreen && fullscreenVisible && isHandheld && this.renderCloseButton()}
- {isFullscreen && fullscreenVisible && -
this.handleMouseEnter('close')} - onMouseLeave={() => this.handleMouseLeave('close')} - onClick={() => { - actions.viewer.toggleFullscreenVisible(false) - this.handleMouseLeave('close') - }} - > - {EfluxClose} -
- } + {isFullscreen && fullscreenVisible && !isHandheld && this.renderCloseButton()} this.handleMouseEnter('play')} onMouseLeave={() => this.handleMouseLeave('play')} @@ -143,6 +134,21 @@ class EfluxChrome extends Component {
) } + renderCloseButton() { + return ( +
this.handleMouseEnter('close')} + onMouseLeave={() => this.handleMouseLeave('close')} + onClick={() => { + actions.viewer.toggleFullscreenVisible(false) + this.handleMouseLeave('close') + }} + > + {EfluxClose} +
+ ) + } } const mapStateToProps = state => ({ -- cgit v1.2.3-70-g09d2