Merge pull request #9298 from Tvallejos/simul-host-own-messages

Highlight yourself and simul host in chat
pull/9317/head
Thibault Duplessis 2021-06-29 22:06:54 +02:00 committed by GitHub
commit b5c7e130e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 1 deletions

View File

@ -20,6 +20,15 @@
line-height: 1.2em;
overflow-y: hidden;
user-select: text;
&.me {
border-left: 3px solid $c-secondary-dim;
padding-left: 7px;
}
&.host {
background-color: rgba($c-secondary-dim, 0.4);
}
}
.deleted {

View File

@ -212,6 +212,12 @@ function renderLine(ctrl: Ctrl, line: Line): VNode {
return h(
'li',
{
class: {
me: line.u === ctrl.data.userId,
host: line.u === ctrl.data.hostId,
},
},
ctrl.moderation()
? [line.u ? modLineAction() : null, userNode, ' ', textNode]
: [

View File

@ -39,6 +39,7 @@ export interface ChatData {
restricted: boolean;
palantir: boolean;
domVersion: number;
hostId?: string;
}
export interface Line {

View File

@ -20,7 +20,10 @@ export default function (ctrl: SimulCtrl) {
h('aside.simul__side', {
hook: util.onInsert(el => {
$(el).replaceWith(ctrl.opts.$side);
ctrl.opts.chat && lichess.makeChat(ctrl.opts.chat);
if (ctrl.opts.chat) {
ctrl.opts.chat.data.hostId = ctrl.data.host.id;
lichess.makeChat(ctrl.opts.chat);
}
}),
}),
h(