From 0d0526600d1de4bfd0d3aa39fd2ebd4456f54d10 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Thu, 3 Dec 2020 16:03:48 -0800 Subject: [PATCH] use radio buttons for telemetry modal This indicates the current state, lets the user exit without changing state, and lets the user change state any time they want. This change also improves RTL support in the telemetry modal. --- src/components/gui/gui.jsx | 3 + .../telemetry-modal/telemetry-modal.css | 45 +++++---- .../telemetry-modal/telemetry-modal.jsx | 96 ++++++++++++------- src/lib/app-state-hoc.jsx | 2 + 4 files changed, 92 insertions(+), 54 deletions(-) diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index 518198c1c..a44604898 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -86,6 +86,7 @@ const GUIComponent = props => { isPlayerOnly, isRtl, isShared, + isTelemetryEnabled, loading, logo, renderLogin, @@ -161,6 +162,8 @@ const GUIComponent = props => { > {telemetryModalVisible ? ( ) }} />

+ + + + - @@ -134,6 +155,7 @@ class TelemetryModal extends React.PureComponent { TelemetryModal.propTypes = { intl: intlShape.isRequired, isRtl: PropTypes.bool, + isTelemetryEnabled: PropTypes.bool, // false=disabled, true=enabled, undefined=undecided onCancel: PropTypes.func, onOptIn: PropTypes.func.isRequired, onOptOut: PropTypes.func.isRequired, diff --git a/src/lib/app-state-hoc.jsx b/src/lib/app-state-hoc.jsx index c7c076e33..ff0ee0b5b 100644 --- a/src/lib/app-state-hoc.jsx +++ b/src/lib/app-state-hoc.jsx @@ -97,6 +97,7 @@ const AppStateHOC = function (WrappedComponent, localesOnly) { const { isFullScreen, // eslint-disable-line no-unused-vars isPlayerOnly, // eslint-disable-line no-unused-vars + isTelemetryEnabled, // eslint-disable-line no-unused-vars showTelemetryModal, // eslint-disable-line no-unused-vars ...componentProps } = this.props; @@ -114,6 +115,7 @@ const AppStateHOC = function (WrappedComponent, localesOnly) { AppStateWrapper.propTypes = { isFullScreen: PropTypes.bool, isPlayerOnly: PropTypes.bool, + isTelemetryEnabled: PropTypes.bool, showTelemetryModal: PropTypes.bool }; return AppStateWrapper;