From 49a4646c13b4b722d06f94f738fc3ad3d55f81e7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 21 Nov 2020 18:43:41 +0100 Subject: handheld warning modal at the end of the first chapter --- .../app/views/viewer/modals/modals.handheld.js | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 animism-align/frontend/app/views/viewer/modals/modals.handheld.js (limited to 'animism-align/frontend/app/views/viewer/modals/modals.handheld.js') diff --git a/animism-align/frontend/app/views/viewer/modals/modals.handheld.js b/animism-align/frontend/app/views/viewer/modals/modals.handheld.js new file mode 100644 index 0000000..a8b40b8 --- /dev/null +++ b/animism-align/frontend/app/views/viewer/modals/modals.handheld.js @@ -0,0 +1,43 @@ +import React, { Component } from 'react' +import { connect } from 'react-redux' + +import actions from 'app/actions' + +import { EfluxClose } from '../nav/eflux.icons' +import { Arrow } from '../nav/viewer.icons' + +class HandheldModal extends Component { + state = { + visible: false, + } + componentDidUpdate(prevProps) { + if (prevProps.showAtEndOfSection !== this.props.showAtEndOfSection && this.props.showAtEndOfSection) { + this.setState({ visible: true }) + } + } + render() { + const { showAtEndOfSection } = this.props + const { visible } = this.state + console.log(showAtEndOfSection, visible) + return ( +
+
+

+ {"The full episode is not currently supported on mobile devices."} +

+

+ {"To continue viewing, please switch to your computer."} +

+
this.setState({ visible: false })} className='ok'>OK
+
+
+ ) + } +} + +const mapStateToProps = state => ({ + showAtEndOfSection: state.viewer.onlyEnableFirstSection && state.viewer.atEndOfSection, +}) + +export default connect(mapStateToProps)(HandheldModal) + -- cgit v1.2.3-70-g09d2