diff --git a/src/components/views/dialogs/AddAppDialog.js b/src/components/views/dialogs/AddAppDialog.js index 6d722365e8..49e16820d6 100644 --- a/src/components/views/dialogs/AddAppDialog.js +++ b/src/components/views/dialogs/AddAppDialog.js @@ -46,10 +46,14 @@ export default React.createClass({ onFormSubmit: function(ev) { ev.preventDefault(); - this.props.onFinished(true, this.state.value); + this.props.onFinished(true, 'custom', this.state.value); return false; }, + onTileClick: function(value) { + this.props.onFinished(true, value, null); + }, + render: function() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const appCards = ModularWidgets.widgetTypes.map((widgetType, index) => @@ -58,7 +62,8 @@ export default React.createClass({ type={widgetType.type} icon={widgetType.icon} name={widgetType.name} - description={widgetType.description}/>, + description={widgetType.description} + onClick={this.onTileClick}/>, ); return ( diff --git a/src/components/views/elements/AppIconTile.js b/src/components/views/elements/AppIconTile.js index 282a33743c..32fcd74111 100644 --- a/src/components/views/elements/AppIconTile.js +++ b/src/components/views/elements/AppIconTile.js @@ -18,6 +18,14 @@ limitations under the License. import React from 'react'; class AppIconTile extends React.Component { + constructor(props) { + super(props); + this._onTileClick = this._onTileClick.bind(this); + } + + _onTileClick(props) { + this.props.onClick(this.props.type); + } render() { const contentClasses = ['mx_AppIconTile']; @@ -26,7 +34,7 @@ class AppIconTile extends React.Component { // } return ( -