diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 4ca3dded9c..d2b36cf4e1 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -26,9 +26,16 @@ var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); module.exports = React.createClass({ displayName: 'RightPanel', + propTypes: { + userId: React.PropTypes.string, // if showing an orphaned MemberInfo page, this is set + roomId: React.PropTypes.string, // if showing panels for a given room, this is set + collapsed: React.PropTypes.bool, + }, + Phase : { MemberList: 'MemberList', - FileList: 'FileList', + FilePanel: 'FilePanel', + NotificationPanel: 'NotificationPanel', MemberInfo: 'MemberInfo', }, @@ -61,7 +68,7 @@ module.exports = React.createClass({ }, onMemberListButtonClick: function() { - if (this.props.collapsed) { + if (this.props.collapsed || this.state.phase !== this.Phase.MemberList) { this.setState({ phase: this.Phase.MemberList }); dis.dispatch({ action: 'show_right_panel', @@ -74,6 +81,34 @@ module.exports = React.createClass({ } }, + onFileListButtonClick: function() { + if (this.props.collapsed || this.state.phase !== this.Phase.FilePanel) { + this.setState({ phase: this.Phase.FilePanel }); + dis.dispatch({ + action: 'show_right_panel', + }); + } + else { + dis.dispatch({ + action: 'hide_right_panel', + }); + } + }, + + onNotificationListButtonClick: function() { + if (this.props.collapsed || this.state.phase !== this.Phase.NotificationPanel) { + this.setState({ phase: this.Phase.NotificationPanel }); + dis.dispatch({ + action: 'show_right_panel', + }); + } + else { + dis.dispatch({ + action: 'hide_right_panel', + }); + } + }, + onRoomStateMember: function(ev, state, member) { // redraw the badge on the membership list if (this.state.phase == this.Phase.MemberList && member.roomId === this.props.roomId) { @@ -118,19 +153,25 @@ module.exports = React.createClass({ render: function() { var MemberList = sdk.getComponent('rooms.MemberList'); + var NotificationPanel = sdk.getComponent('structures.NotificationPanel'); + var FilePanel = sdk.getComponent('structures.FilePanel'); var TintableSvg = sdk.getComponent("elements.TintableSvg"); var buttonGroup; var panel; var filesHighlight; var membersHighlight; + var notificationsHighlight; if (!this.props.collapsed) { if (this.state.phase == this.Phase.MemberList || this.state.phase === this.Phase.MemberInfo) { membersHighlight =
; } - else if (this.state.phase == this.Phase.FileList) { + else if (this.state.phase == this.Phase.FilePanel) { filesHighlight =
; } + else if (this.state.phase == this.Phase.NotificationPanel) { + notificationsHighlight =
; + } } var membersBadge; @@ -138,7 +179,7 @@ module.exports = React.createClass({ var cli = MatrixClientPeg.get(); var room = cli.getRoom(this.props.roomId); if (room) { - membersBadge =
{ room.getJoinedMembers().length }
; + membersBadge = room.getJoinedMembers().length; } } @@ -146,14 +187,20 @@ module.exports = React.createClass({ buttonGroup =
- { membersBadge } +
{ membersBadge ? membersBadge :  }
{ membersHighlight }
-
- +
+
 
+ { filesHighlight }
+
+
 
+ + { notificationsHighlight } +
; } @@ -165,6 +212,12 @@ module.exports = React.createClass({ var MemberInfo = sdk.getComponent('rooms.MemberInfo'); panel = } + else if (this.state.phase == this.Phase.NotificationPanel) { + panel = + } + else if (this.state.phase == this.Phase.FilePanel) { + panel = + } } if (!panel) { diff --git a/src/skins/vector/css/hide.css b/src/skins/vector/css/hide.css deleted file mode 100644 index f84a35b313..0000000000 --- a/src/skins/vector/css/hide.css +++ /dev/null @@ -1,6 +0,0 @@ -.mx_RoomSettings_encrypt, -.mx_CreateRoom_encrypt, -.mx_RightPanel_filebutton -{ - display: none !important; -} diff --git a/src/skins/vector/css/matrix-react-sdk/structures/FilePanel.css b/src/skins/vector/css/matrix-react-sdk/structures/FilePanel.css new file mode 100644 index 0000000000..5e58d33ebb --- /dev/null +++ b/src/skins/vector/css/matrix-react-sdk/structures/FilePanel.css @@ -0,0 +1,118 @@ +/* +Copyright 2016 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_FilePanel { + -webkit-box-ordinal-group: 2; + -moz-box-ordinal-group: 2; + -ms-flex-order: 2; + -webkit-order: 2; + order: 2; + + -webkit-flex: 1 1 0; + flex: 1 1 0; + + width: 100%; + + overflow-y: auto; +} + +.mx_FilePanel .mx_RoomView_messageListWrapper { + margin-right: 20px; +} + +.mx_FilePanel .mx_RoomView_MessageList h2 { + display: none; +} + +/* FIXME: rather than having EventTile's default CSS be for MessagePanel, + we should make EventTile a base CSS class and customise it specifically + for usage in {Message,File,Notification}Panel. */ + +.mx_FilePanel .mx_EventTile_avatar { + display: none; +} + +/* Overrides for the attachment body tiles */ + +.mx_FilePanel .mx_EventTile .mx_MImageBody { + margin-right: 0px; +} + +.mx_FilePanel .mx_EventTile .mx_MImageBody_download { + display: flex; + font-size: 14px; + color: #acacac; +} + +.mx_FilePanel .mx_EventTile .mx_MImageBody_downloadLink { + flex: 1 1 auto; + color: #747474; + word-break: break-all; +} + +.mx_FilePanel .mx_EventTile .mx_MImageBody_size { + flex: 1 0 0; + font-size: 11px; + text-align: right; + white-space: nowrap; +} + +/* Overides for the sender details line */ + +.mx_FilePanel .mx_EventTile_senderDetails { + display: flex; + margin-top: -2px; +} + +.mx_FilePanel .mx_EventTile_senderDetailsLink { + text-decoration: none; +} + +.mx_FilePanel .mx_EventTile .mx_SenderProfile { + flex: 1 1 auto; + line-height: initial; + padding: 0px; + font-size: 11px; + opacity: 1.0; + color: #acacac; + word-break: break-all; +} + +.mx_FilePanel .mx_EventTile .mx_MessageTimestamp { + flex: 1 0 0; + text-align: right; + visibility: visible; + position: initial; + font-size: 11px; + opacity: 1.0; + color: #acacac; +} + +/* Overrides for the wrappers around the body tile */ + +.mx_FilePanel .mx_EventTile_line { + margin-right: 0px; + padding-left: 0px; +} + +.mx_FilePanel .mx_EventTile:hover .mx_EventTile_line { + background-color: #fff; +} + +.mx_FilePanel .mx_EventTile_selected .mx_EventTile_line { + padding-left: 0px; +} + diff --git a/src/skins/vector/css/matrix-react-sdk/structures/NotificationPanel.css b/src/skins/vector/css/matrix-react-sdk/structures/NotificationPanel.css new file mode 100644 index 0000000000..2a42e35f4b --- /dev/null +++ b/src/skins/vector/css/matrix-react-sdk/structures/NotificationPanel.css @@ -0,0 +1,102 @@ +/* +Copyright 2015, 2016 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_NotificationPanel { + -webkit-box-ordinal-group: 2; + -moz-box-ordinal-group: 2; + -ms-flex-order: 2; + -webkit-order: 2; + order: 2; + + -webkit-flex: 1 1 0; + flex: 1 1 0; + + width: 100%; + + overflow-y: auto; +} + +.mx_NotificationPanel .mx_RoomView_messageListWrapper { + margin-right: 20px; +} + +.mx_NotificationPanel .mx_RoomView_MessageList h2 { + margin-left: 0px; +} + +/* FIXME: rather than having EventTile's default CSS be for MessagePanel, + we should make EventTile a base CSS class and customise it specifically + for usage in {Message,File,Notification}Panel. */ + +.mx_NotificationPanel .mx_EventTile_roomName { + font-weight: bold; + font-size: 14px; +} + +.mx_NotificationPanel .mx_EventTile_roomName a { + color: #4a4a4a; +} + +.mx_NotificationPanel .mx_EventTile_avatar { + top: 8px; + left: 0px; +} + +.mx_NotificationPanel .mx_EventTile .mx_SenderProfile, +.mx_NotificationPanel .mx_EventTile .mx_MessageTimestamp { + color: #000; + opacity: 0.3; + font-size: 12px; + display: inline; + padding-left: 0px; +} + +.mx_NotificationPanel .mx_EventTile_senderDetails { + padding-left: 32px; + padding-top: 8px; + position: relative; +} + +.mx_NotificationPanel .mx_EventTile_roomName a, +.mx_NotificationPanel .mx_EventTile_senderDetails a { + text-decoration: none ! important; +} + +.mx_NotificationPanel .mx_EventTile .mx_MessageTimestamp { + visibility: visible; + position: initial; + display: inline; +} + +.mx_NotificationPanel .mx_EventTile_line { + margin-right: 0px; + padding-left: 32px; + padding-top: 0px; + padding-bottom: 0px; + padding-right: 0px; +} + +.mx_NotificationPanel .mx_EventTile:hover .mx_EventTile_line { + background-color: #fff; +} + +.mx_NotificationPanel .mx_EventTile_selected .mx_EventTile_line { + padding-left: 0px; +} + +.mx_NotificationPanel .mx_EventTile_content { + margin-right: 0px; +} \ No newline at end of file diff --git a/src/skins/vector/css/matrix-react-sdk/views/messages/MImageBody.css b/src/skins/vector/css/matrix-react-sdk/views/messages/MImageBody.css index 0b43a81b09..1134f2f6ff 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/messages/MImageBody.css +++ b/src/skins/vector/css/matrix-react-sdk/views/messages/MImageBody.css @@ -30,7 +30,6 @@ limitations under the License. .mx_MImageBody_download { color: #76cfa6; - cursor: pointer; } .mx_MImageBody_download a { diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css index 68f02f7c1a..78a8790b5e 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomSettings.css @@ -88,12 +88,14 @@ limitations under the License. height: 37px; border: 1px solid #979797; margin-right: 13px; + cursor: pointer; } .mx_RoomSettings .mx_RoomSettings_roomColor_selected { position: absolute; left: 10px; top: 4px; + cursor: default ! important; } .mx_RoomSettings .mx_RoomSettings_roomColorPrimary { diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomTile.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomTile.css index 87ce4abba9..623d578632 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomTile.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomTile.css @@ -63,7 +63,7 @@ limitations under the License. z-index: 2; } -.mx_RoomTile_avatar_container:hover:before, +.mx_RoomTile:hover .mx_RoomTile_avatar_container:before, .mx_RoomTile_avatar_container.mx_RoomTile_avatar_roomTagMenu:before { display: block; position: absolute; @@ -76,7 +76,7 @@ limitations under the License. z-index: 4; } -.mx_RoomTile_avatar_container:hover:after, +.mx_RoomTile:hover .mx_RoomTile_avatar_container:after, .mx_RoomTile_avatar_container.mx_RoomTile_avatar_roomTagMenu:after { display: block; position: absolute; @@ -90,11 +90,11 @@ limitations under the License. z-index: 1; } -.collapsed .mx_RoomTile_avatar_container:hover:before { +.collapsed .mx_RoomTile:hover .mx_RoomTile_avatar_container:before { display: none; } -.collapsed .mx_RoomTile_avatar_container:hover:after { +.collapsed .mx_RoomTile:hover .mx_RoomTile_avatar_container:after { display: none; } diff --git a/src/skins/vector/css/vector-web/structures/RightPanel.css b/src/skins/vector/css/vector-web/structures/RightPanel.css index 9567869e7d..211848f54e 100644 --- a/src/skins/vector/css/vector-web/structures/RightPanel.css +++ b/src/skins/vector/css/vector-web/structures/RightPanel.css @@ -46,15 +46,15 @@ limitations under the License. margin-top: 6px; float: left; background-color: #fff; - margin-left: -4px; + margin-left: 0px; } .mx_RightPanel_headerButton { cursor: pointer; display: table-cell; - vertical-align: middle; - padding-left: 15px; - padding-right: 15px; + vertical-align: top; + padding-left: 4px; + padding-right: 5px; text-align: center; position: relative; } diff --git a/src/skins/vector/img/icons-files.svg b/src/skins/vector/img/icons-files.svg new file mode 100644 index 0000000000..97ba4228e3 --- /dev/null +++ b/src/skins/vector/img/icons-files.svg @@ -0,0 +1,29 @@ + + + + 7C98C075-AB4D-45A3-85F9-CCD46F84DA7F + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/skins/vector/img/icons-notifications.svg b/src/skins/vector/img/icons-notifications.svg new file mode 100644 index 0000000000..0a248178fd --- /dev/null +++ b/src/skins/vector/img/icons-notifications.svg @@ -0,0 +1,28 @@ + + + + 5E723325-BD0B-454D-BE25-638AF09A97AC + Created with sketchtool. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file