diff --git a/res/css/_components.scss b/res/css/_components.scss index 62cdb4533e..0e40b40a29 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -68,6 +68,7 @@ @import "./views/groups/_GroupUserSettings.scss"; @import "./views/login/_InteractiveAuthEntryComponents.scss"; @import "./views/login/_ServerConfig.scss"; +@import "./views/messages/_CreateEvent.scss"; @import "./views/messages/_DateSeparator.scss"; @import "./views/messages/_MEmoteBody.scss"; @import "./views/messages/_MFileBody.scss"; diff --git a/res/css/views/messages/_CreateEvent.scss b/res/css/views/messages/_CreateEvent.scss new file mode 100644 index 0000000000..c095fc26af --- /dev/null +++ b/res/css/views/messages/_CreateEvent.scss @@ -0,0 +1,37 @@ +/* +Copyright 2018 New Vector 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_CreateEvent { + background-color: $info-plinth-bg-color; + padding-left: 20px; + padding-right: 20px; + padding-top: 10px; + padding-bottom: 10px; +} + +.mx_CreateEvent_image { + float: left; + padding-right: 20px; + width: 72px; + height: 34px; +} + +.mx_CreateEvent_header { + font-weight: bold; +} + +.mx_CreateEvent_link { +} diff --git a/res/img/room-continuation.svg b/res/img/room-continuation.svg new file mode 100644 index 0000000000..dc7e15462a --- /dev/null +++ b/res/img/room-continuation.svg @@ -0,0 +1,6 @@ + + diff --git a/src/components/views/messages/RoomCreate.js b/src/components/views/messages/RoomCreate.js new file mode 100644 index 0000000000..0bb832f8ea --- /dev/null +++ b/src/components/views/messages/RoomCreate.js @@ -0,0 +1,63 @@ +/* +Copyright 2018 New Vector 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. +*/ + +import React from 'react'; +import PropTypes from 'prop-types'; + +import dis from '../../../dispatcher'; +import { makeEventPermalink } from '../../../matrix-to'; +import { _t } from '../../../languageHandler'; + +module.exports = React.createClass({ + displayName: 'RoomCreate', + + propTypes: { + /* the MatrixEvent to show */ + mxEvent: PropTypes.object.isRequired, + }, + + _onLinkClicked: function(e) { + e.preventDefault(); + + const predecessor = this.props.mxEvent.getContent()['predecessor']; + + dis.dispatch({ + action: 'view_room', + event_id: predecessor['event_id'], + highlighted: true, + room_id: predecessor['room_id'], + }); + }, + + render: function() { + const predecessor = this.props.mxEvent.getContent()['predecessor']; + if (predecessor === undefined) { + return
; // We should never have been instaniated in this case + } + return