From a35ab6bcef42dad3a498f7195a62da54a8fcaa2f Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 20 Feb 2016 13:36:48 +0000 Subject: [PATCH] tart up room directory --- src/components/structures/RoomDirectory.js | 61 +++++++++++++--------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 09c15a1cc9..b061661966 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -19,10 +19,17 @@ limitations under the License. var React = require('react'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); +var ContentRepo = require("matrix-js-sdk").ContentRepo; var Modal = require('matrix-react-sdk/lib/Modal'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); +var linkify = require('linkifyjs'); +var linkifyElement = require('linkifyjs/element'); +var linkifyMatrix = require('matrix-react-sdk/lib/linkify-matrix'); + +linkifyMatrix(linkify); + module.exports = React.createClass({ displayName: 'RoomDirectory', @@ -54,6 +61,8 @@ module.exports = React.createClass({ self.forceUpdate(); } }); + + //linkifyElement(this.refs.directory_table, linkifyMatrix.options); }, showRoom: function(roomId) { @@ -64,6 +73,8 @@ module.exports = React.createClass({ }, getRows: function(filter) { + var BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); + if (!this.state.publicRooms) return []; var rooms = this.state.publicRooms.filter(function(a) { @@ -83,36 +94,39 @@ module.exports = React.createClass({ if (rooms[i].world_readable) { guestRead = ( - [world readable] +
World readable
); - // World Readable } if (rooms[i].guest_can_join) { guestJoin = ( - [guests allowed] +
Guests can join
); - // Guests can join } perms = null; if (guestRead || guestJoin) { - perms =
{guestRead} {guestJoin}
; + perms =
{guestRead} {guestJoin}
; } - // rows.unshift( - - - { name } - { rooms[i].aliases[0] } - { rooms[i].num_joined_members } - - - {perms} { rooms[i].topic } - - + + + + + +
{ name }
  + { perms } +
{ rooms[i].topic }
+
{ rooms[i].aliases[0] }
+ + + { rooms[i].num_joined_members } + + ); } return rows; @@ -139,15 +153,14 @@ module.exports = React.createClass({ var RoomHeader = sdk.getComponent('rooms.RoomHeader'); return (
- +
- - - - - { this.getRows(this.state.roomAlias) } +
RoomAliasMembers
+ + { this.getRows(this.state.roomAlias) } +