Change score color to match sender name
This commit is contained in:
parent
03299a28a4
commit
e64ff0f099
2 changed files with 39 additions and 2 deletions
|
@ -27,4 +27,36 @@ blockquote.mx_ReplyThread {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
border-left: 4px solid $button-bg-color;
|
border-left: 4px solid $button-bg-color;
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color1 {
|
||||||
|
border-left-color: $username-variant1-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color2 {
|
||||||
|
border-left-color: $username-variant2-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color3 {
|
||||||
|
border-left-color: $username-variant3-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color4 {
|
||||||
|
border-left-color: $username-variant4-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color5 {
|
||||||
|
border-left-color: $username-variant5-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color6 {
|
||||||
|
border-left-color: $username-variant6-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color7 {
|
||||||
|
border-left-color: $username-variant7-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.mx_ReplyThread_color8 {
|
||||||
|
border-left-color: $username-variant8-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import {makeUserPermalink, RoomPermalinkCreator} from "../../../utils/permalinks
|
||||||
import SettingsStore from "../../../settings/SettingsStore";
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
import escapeHtml from "escape-html";
|
import escapeHtml from "escape-html";
|
||||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||||
|
import { getUserNameColorClass } from "../../../utils/FormattingUtils"
|
||||||
|
|
||||||
// This component does no cycle detection, simply because the only way to make such a cycle would be to
|
// This component does no cycle detection, simply because the only way to make such a cycle would be to
|
||||||
// craft event_id's, using a homeserver that generates predictable event IDs; even then the impact would
|
// craft event_id's, using a homeserver that generates predictable event IDs; even then the impact would
|
||||||
|
@ -285,6 +286,10 @@ export default class ReplyThread extends React.Component {
|
||||||
dis.dispatch({action: 'focus_composer'});
|
dis.dispatch({action: 'focus_composer'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getReplyThreadColorClass(ev) {
|
||||||
|
return getUserNameColorClass(ev.getSender()).replace("Username", "ReplyThread");
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let header = null;
|
let header = null;
|
||||||
|
|
||||||
|
@ -299,7 +304,7 @@ export default class ReplyThread extends React.Component {
|
||||||
const ev = this.state.loadedEv;
|
const ev = this.state.loadedEv;
|
||||||
const Pill = sdk.getComponent('elements.Pill');
|
const Pill = sdk.getComponent('elements.Pill');
|
||||||
const room = this.context.getRoom(ev.getRoomId());
|
const room = this.context.getRoom(ev.getRoomId());
|
||||||
header = <blockquote className="mx_ReplyThread">
|
header = <blockquote className={`mx_ReplyThread ${this.getReplyThreadColorClass(ev)}`}>
|
||||||
{
|
{
|
||||||
_t('<a>In reply to</a> <pill>', {}, {
|
_t('<a>In reply to</a> <pill>', {}, {
|
||||||
'a': (sub) => <a onClick={this.onQuoteClick} className="mx_ReplyThread_show">{ sub }</a>,
|
'a': (sub) => <a onClick={this.onQuoteClick} className="mx_ReplyThread_show">{ sub }</a>,
|
||||||
|
@ -315,7 +320,7 @@ export default class ReplyThread extends React.Component {
|
||||||
|
|
||||||
const ReplyTile = sdk.getComponent('views.rooms.ReplyTile');
|
const ReplyTile = sdk.getComponent('views.rooms.ReplyTile');
|
||||||
const evTiles = this.state.events.map((ev) => {
|
const evTiles = this.state.events.map((ev) => {
|
||||||
return <blockquote className="mx_ReplyThread" key={ev.getId()}>
|
return <blockquote className={`mx_ReplyThread ${this.getReplyThreadColorClass(ev)}`} key={ev.getId()}>
|
||||||
<ReplyTile
|
<ReplyTile
|
||||||
mxEvent={ev}
|
mxEvent={ev}
|
||||||
onHeightChanged={this.props.onHeightChanged}
|
onHeightChanged={this.props.onHeightChanged}
|
||||||
|
|
Loading…
Reference in a new issue