Extract display name logic to NameFormatService, refactor colored name parsing, and improve channel list scrolling.
This commit is contained in:
+15
-11
@@ -1,13 +1,17 @@
|
||||
<div class="full-width"
|
||||
[style.background-color]="getServerColor(selectedChannel()?.name ?? '')">
|
||||
<span class="channel" [style.color]="getServerTextColor(selectedChannel()?.name ?? '')">
|
||||
{{ selectedChannel()?.name }}
|
||||
</span>
|
||||
<div class="notification-icon">
|
||||
@if (notificationEnabled()) {
|
||||
<svg-notification-enabled (click)="disableNotifications()"/>
|
||||
} @else {
|
||||
<svg-notification-disabled (click)="enableNotifications()"/>
|
||||
@if (selectedChannel(); as chatChannel) {
|
||||
<div class="full-width"
|
||||
[style.background-color]="getServerColor(chatChannel.name ?? '')">
|
||||
<span class="channel" [style.color]="getServerTextColor(chatChannel.name ?? '')">
|
||||
@for (segment of getDisplayName(chatChannel); track $index) {
|
||||
<span [style.color]="segment.color">{{ segment.text }}</span>
|
||||
}
|
||||
</span>
|
||||
<div class="notification-icon">
|
||||
@if (notificationEnabled()) {
|
||||
<svg-notification-enabled (click)="disableNotifications()"/>
|
||||
} @else {
|
||||
<svg-notification-disabled (click)="enableNotifications()"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user