Add stub handler for image snapshot

pull/21833/head
Richard Lewis 2017-12-03 11:25:15 +00:00
parent 26c6c25a4c
commit 3a89b90e57
1 changed files with 18 additions and 0 deletions

View File

@ -221,6 +221,10 @@ export default React.createClass({
}, "mx_IntegrationsManager"); }, "mx_IntegrationsManager");
}, },
_onSnapshotClick(e) {
console.log("Snapshot widget ID ", this.props.id);
},
/* If user has permission to modify widgets, delete the widget, /* If user has permission to modify widgets, delete the widget,
* otherwise revoke access for the widget to load in the user's browser * otherwise revoke access for the widget to load in the user's browser
*/ */
@ -379,11 +383,25 @@ export default React.createClass({
deleteClasses += ' mx_AppTileMenuBarWidgetDelete'; deleteClasses += ' mx_AppTileMenuBarWidgetDelete';
} }
// Picture snapshot
const showPictureSnapshotButton = true; // FIXME - Make this dynamic
const showPictureSnapshotIcon = 'img/camera_green.svg';
return ( return (
<div className={this.props.fullWidth ? "mx_AppTileFullWidth" : "mx_AppTile"} id={this.props.id}> <div className={this.props.fullWidth ? "mx_AppTileFullWidth" : "mx_AppTile"} id={this.props.id}>
<div ref="menu_bar" className="mx_AppTileMenuBar" onClick={this.onClickMenuBar}> <div ref="menu_bar" className="mx_AppTileMenuBar" onClick={this.onClickMenuBar}>
<b>{ this.formatAppTileName() }</b> <b>{ this.formatAppTileName() }</b>
<span className="mx_AppTileMenuBarWidgets"> <span className="mx_AppTileMenuBarWidgets">
{ /* Snapshot widget */ }
{ showPictureSnapshotButton && <TintableSvgButton
src={showPictureSnapshotIcon}
className="mx_AppTileMenuBarWidget mx_AppTileMenuBarWidgetPadding"
title={_t('Picture')}
onClick={this._onSnapshotClick}
width="10"
height="10"
/> }
{ /* Edit widget */ } { /* Edit widget */ }
{ showEditButton && <TintableSvgButton { showEditButton && <TintableSvgButton
src="img/edit_green.svg" src="img/edit_green.svg"