From 3741768a3a8e3ce4cd63aa92a327904c62b8cccd Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 13 Sep 2016 16:40:15 +0100 Subject: [PATCH 1/2] Add modal dialog on new room button https://github.com/vector-im/vector-web/issues/2178 --- src/components/structures/MatrixChat.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index c83da2b8f0..b24d93091c 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -364,7 +364,19 @@ module.exports = React.createClass({ //this._setPage(this.PageTypes.CreateRoom); //this.notifyNewScreen('new'); - createRoom().done(); + var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog"); + Modal.createDialog(TextInputDialog, { + title: "Create Room", + description: "Name your new room, or leave it nameless", + button: "Create Room", + onFinished: (should_create, name) => { + if (should_create) { + const createOpts = {}; + if (name) createOpts.name = name; + createRoom({createOpts}).done(); + } + } + }); break; case 'view_room_directory': this._setPage(this.PageTypes.RoomDirectory); From 5450e93df1f6197be28fd256a662211d2ebec382 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 13 Sep 2016 16:56:53 +0100 Subject: [PATCH 2/2] Verbiage --- src/components/structures/MatrixChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index b24d93091c..e1eda409d5 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -367,7 +367,7 @@ module.exports = React.createClass({ var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog"); Modal.createDialog(TextInputDialog, { title: "Create Room", - description: "Name your new room, or leave it nameless", + description: "Room name (optional)", button: "Create Room", onFinished: (should_create, name) => { if (should_create) {