From 55c991ee40aadfc56897ef4585b43415129c38bf Mon Sep 17 00:00:00 2001 From: johnshaughnessy <johnfshaughnessy@gmail.com> Date: Tue, 4 Sep 2018 13:14:34 -0700 Subject: [PATCH] Pass configuration flag to 2d-hud.js --- src/react-components/2d-hud.js | 4 ++-- src/react-components/ui-root.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/react-components/2d-hud.js b/src/react-components/2d-hud.js index 7ccaf1cdb..effa07f29 100644 --- a/src/react-components/2d-hud.js +++ b/src/react-components/2d-hud.js @@ -38,9 +38,9 @@ TopHUD.propTypes = { }; const mediaPickerInput = "media-picker-input"; -const BottomHUD = ({ onCreateObject, onMediaPicked }) => ( +const BottomHUD = ({ onCreateObject, showImageOnlyButton, onMediaPicked }) => ( <div> - {onMediaPicked ? ( + {showImageOnlyButton ? ( <div> <input id={mediaPickerInput} diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js index 50093fde8..30880cee9 100644 --- a/src/react-components/ui-root.js +++ b/src/react-components/ui-root.js @@ -910,7 +910,8 @@ class UIRoot extends Component { )} <TwoDHUD.BottomHUD onCreateObject={() => this.setState({ infoDialogType: InfoDialog.dialogTypes.create_object })} - onMediaPicked={AFRAME.utils.device.isMobile() ? this.handleCreateObject : null} + showImageOnlyButton={AFRAME.utils.device.isMobile()} + onMediaPicked={this.handleCreateObject} /> </div> ) : null} -- GitLab