apply redesign to topunreadmessagebar
with placeholder for message count
This commit is contained in:
parent
0212df922a
commit
ac9902e52a
7 changed files with 54 additions and 59 deletions
|
@ -87,8 +87,12 @@ limitations under the License.
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_RoomView_body .mx_RoomView_topUnreadMessagesBar {
|
.mx_RoomView_body .mx_RoomView_timeline {
|
||||||
order: 1;
|
/* offset parent for mx_RoomView_topUnreadMessagesBar */
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_RoomView_body .mx_RoomView_messagePanel {
|
.mx_RoomView_body .mx_RoomView_messagePanel {
|
||||||
|
|
|
@ -15,39 +15,29 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.mx_TopUnreadMessagesBar {
|
.mx_TopUnreadMessagesBar {
|
||||||
margin: auto; /* centre horizontally */
|
z-index: 1000;
|
||||||
max-width: 960px;
|
position: absolute;
|
||||||
padding-top: 10px;
|
top: 24px;
|
||||||
padding-bottom: 10px;
|
right: 24px;
|
||||||
border-bottom: 1px solid $primary-hairline-color;
|
width: 38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_TopUnreadMessagesBar_scrollUp {
|
.mx_TopUnreadMessagesBar_scrollUp {
|
||||||
display: inline;
|
height: 38px;
|
||||||
cursor: pointer;
|
border-radius: 19px;
|
||||||
text-decoration: underline;
|
box-sizing: border-box;
|
||||||
}
|
background: $primary-bg-color;
|
||||||
|
border: 1.3px solid $roomtile-name-color;
|
||||||
.mx_TopUnreadMessagesBar_scrollUp img {
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 31px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_TopUnreadMessagesBar_scrollUp span {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mx_TopUnreadMessagesBar_close {
|
|
||||||
float: right;
|
|
||||||
padding-right: 14px;
|
|
||||||
padding-top: 3px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_MatrixChat_useCompactLayout {
|
.mx_TopUnreadMessagesBar_scrollUp:before {
|
||||||
.mx_TopUnreadMessagesBar {
|
content: "";
|
||||||
padding-top: 4px;
|
position: absolute;
|
||||||
padding-bottom: 4px;
|
width: 38px;
|
||||||
}
|
height: 38px;
|
||||||
|
mask: url('../../img/icon-jump-to-first-unread.svg');
|
||||||
|
mask-repeat: no-repeat;
|
||||||
|
mask-position: 9px 13px;
|
||||||
|
background: $roomtile-name-color;
|
||||||
}
|
}
|
||||||
|
|
16
res/img/icon-jump-to-first-unread.svg
Normal file
16
res/img/icon-jump-to-first-unread.svg
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
style="fill:none"
|
||||||
|
version="1.1"
|
||||||
|
viewBox="0 0 18.666187 8.7375818"
|
||||||
|
height="8.7375822"
|
||||||
|
width="18.666187">
|
||||||
|
<defs
|
||||||
|
id="defs8" />
|
||||||
|
<path
|
||||||
|
d="M 17.909095,7.981591 9.3330939,0.74997995 0.75709259,7.981591"
|
||||||
|
style="fill:none;stroke:#000000;stroke-width:1.29999995;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path2-8-3" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 559 B |
|
@ -1794,14 +1794,10 @@ module.exports = React.createClass({
|
||||||
let topUnreadMessagesBar = null;
|
let topUnreadMessagesBar = null;
|
||||||
if (this.state.showTopUnreadMessagesBar) {
|
if (this.state.showTopUnreadMessagesBar) {
|
||||||
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
||||||
topUnreadMessagesBar = (
|
topUnreadMessagesBar = (<TopUnreadMessagesBar
|
||||||
<div className="mx_RoomView_topUnreadMessagesBar">
|
onScrollUpClick={this.jumpToReadMarker}
|
||||||
<TopUnreadMessagesBar
|
onCloseClick={this.forgetReadMarker}
|
||||||
onScrollUpClick={this.jumpToReadMarker}
|
/>);
|
||||||
onCloseClick={this.forgetReadMarker}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
const statusBarAreaClass = classNames(
|
const statusBarAreaClass = classNames(
|
||||||
"mx_RoomView_statusArea",
|
"mx_RoomView_statusArea",
|
||||||
|
@ -1838,9 +1834,11 @@ module.exports = React.createClass({
|
||||||
<MainSplit panel={rightPanel} collapsedRhs={this.props.collapsedRhs}>
|
<MainSplit panel={rightPanel} collapsedRhs={this.props.collapsedRhs}>
|
||||||
<div className={fadableSectionClasses}>
|
<div className={fadableSectionClasses}>
|
||||||
{ auxPanel }
|
{ auxPanel }
|
||||||
{ topUnreadMessagesBar }
|
<div className="mx_RoomView_timeline">
|
||||||
{ messagePanel }
|
{ topUnreadMessagesBar }
|
||||||
{ searchResultsPanel }
|
{ messagePanel }
|
||||||
|
{ searchResultsPanel }
|
||||||
|
</div>
|
||||||
<div className={statusBarAreaClass}>
|
<div className={statusBarAreaClass}>
|
||||||
<div className="mx_RoomView_statusAreaBox">
|
<div className="mx_RoomView_statusAreaBox">
|
||||||
<div className="mx_RoomView_statusAreaBox_line"></div>
|
<div className="mx_RoomView_statusAreaBox_line"></div>
|
||||||
|
|
|
@ -749,7 +749,6 @@ var TimelinePanel = React.createClass({
|
||||||
this._loadTimeline(this.state.readMarkerEventId, 0, 1/3);
|
this._loadTimeline(this.state.readMarkerEventId, 0, 1/3);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/* update the read-up-to marker to match the read receipt
|
/* update the read-up-to marker to match the read receipt
|
||||||
*/
|
*/
|
||||||
forgetReadMarker: function() {
|
forgetReadMarker: function() {
|
||||||
|
|
|
@ -21,6 +21,8 @@ const React = require('react');
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import AccessibleButton from '../elements/AccessibleButton';
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
import {formatCount} from '../../../utils/FormattingUtils';
|
||||||
|
|
||||||
const sdk = require('../../../index');
|
const sdk = require('../../../index');
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
|
@ -28,28 +30,15 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
onScrollUpClick: PropTypes.func,
|
onScrollUpClick: PropTypes.func,
|
||||||
onCloseClick: PropTypes.func,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<div className="mx_TopUnreadMessagesBar">
|
<div className="mx_TopUnreadMessagesBar">
|
||||||
<AccessibleButton className="mx_TopUnreadMessagesBar_scrollUp"
|
<AccessibleButton className="mx_TopUnreadMessagesBar_scrollUp"
|
||||||
onClick={this.props.onScrollUpClick}>
|
title={_t('Jump to first unread message.')}
|
||||||
<img src="img/scrollto.svg" width="24" height="24"
|
onClick={this.props.onScrollUpClick}>
|
||||||
// No point on setting up non empty alt on this image
|
|
||||||
// as it only complements the text which follows it.
|
|
||||||
alt=""
|
|
||||||
title={_t('Scroll to unread messages')}
|
|
||||||
// In order not to use this title attribute for accessible name
|
|
||||||
// calculation of the parent button set the role presentation
|
|
||||||
role="presentation" />
|
|
||||||
{ _t("Jump to first unread message.") }
|
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<AccessibleButton element='img' className="mx_TopUnreadMessagesBar_close mx_filterFlipColor"
|
|
||||||
src="img/cancel.svg" width="18" height="18"
|
|
||||||
alt={_t("Close")} title={_t("Close")}
|
|
||||||
onClick={this.props.onCloseClick} />
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -604,7 +604,6 @@
|
||||||
"Stickerpack": "Stickerpack",
|
"Stickerpack": "Stickerpack",
|
||||||
"Hide Stickers": "Hide Stickers",
|
"Hide Stickers": "Hide Stickers",
|
||||||
"Show Stickers": "Show Stickers",
|
"Show Stickers": "Show Stickers",
|
||||||
"Scroll to unread messages": "Scroll to unread messages",
|
|
||||||
"Jump to first unread message.": "Jump to first unread message.",
|
"Jump to first unread message.": "Jump to first unread message.",
|
||||||
"Invalid alias format": "Invalid alias format",
|
"Invalid alias format": "Invalid alias format",
|
||||||
"'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias",
|
"'%(alias)s' is not a valid format for an alias": "'%(alias)s' is not a valid format for an alias",
|
||||||
|
|
Loading…
Reference in a new issue