Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
feat: add an everyone is following you message
Browse files Browse the repository at this point in the history
  • Loading branch information
Raspincel committed Dec 15, 2023
1 parent 1ade73a commit 358974a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/web-components/who-is-online/who-is-online.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ export class WhoIsOnline extends WebComponentsBaseElement {
</div>`;
}

private everyoneFollowsMeMessage() {
if (!this.everyoneFollowsMe) return '';

const { color } = this.localParticipantData;

return html`<div class="message" style="border-color: ${color}">
Everyone is following you <span @click=${this.stopEveryoneFollowsMe}>Stop</span>
</div>`;
}

private privateMessage() {
if (!this.isPrivate) return '';

Expand Down Expand Up @@ -291,7 +301,7 @@ export class WhoIsOnline extends WebComponentsBaseElement {
const classList = {
'superviz-who-is-online__participant': true,
'disable-dropdown': disableDropdown,
followed: participantIsFollowed,
followed: participantIsFollowed || (isLocal && this.everyoneFollowsMe),
private: isLocal && this.isPrivate,
};
Expand Down Expand Up @@ -334,7 +344,8 @@ export class WhoIsOnline extends WebComponentsBaseElement {

protected render() {
return html`<div class="wio-content">
${this.renderParticipants()} ${this.followingMessage()} ${this.privateMessage()}
${this.renderParticipants()} ${this.followingMessage()} ${this.everyoneFollowsMeMessage()}
${this.privateMessage()}
</div> `;
}
}

0 comments on commit 358974a

Please sign in to comment.