From b40a219338fed042072decea203838ca5e2b265f Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Fri, 24 Jul 2020 08:49:59 +0200 Subject: Hide generic channel display name and avatar on watch view (#2988) * Hide generic channel display name on watch view * Hide generic channel avatar on watch view * Add Default username channel as a generic channel display-name Co-authored-by: kimsible --- .../+video-watch/video-watch.component.html | 22 +++++++++++----- .../+video-watch/video-watch.component.scss | 4 +++ .../+videos/+video-watch/video-watch.component.ts | 9 +++++++ .../shared-main/account/avatar.component.html | 30 +++++++++++++++++----- .../shared/shared-main/account/avatar.component.ts | 5 ++++ 5 files changed, 57 insertions(+), 13 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+videos/+video-watch/video-watch.component.html b/client/src/app/+videos/+video-watch/video-watch.component.html index 0447268f0..fb6d08167 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.html +++ b/client/src/app/+videos/+video-watch/video-watch.component.html @@ -144,15 +144,23 @@
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.scss b/client/src/app/+videos/+video-watch/video-watch.component.scss index c7f91f4a0..00a4b0dee 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.scss +++ b/client/src/app/+videos/+video-watch/video-watch.component.scss @@ -192,6 +192,10 @@ $video-info-margin-left: 44px; font-weight: 500; font-size: 90%; } + + a.single-link { + margin-top: 7px; + } } } diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 933e6c51f..4341514cd 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -307,6 +307,15 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ) } + isChannelDisplayNameGeneric () { + const genericChannelDisplayName = [ + `Main ${this.video.channel.ownerAccount.name} channel`, + `Default ${this.video.channel.ownerAccount.name} channel` + ] + + return genericChannelDisplayName.includes(this.video.channel.displayName) + } + private loadVideo (videoId: string) { // Video did not change if (this.video && this.video.uuid === videoId) return diff --git a/client/src/app/shared/shared-main/account/avatar.component.html b/client/src/app/shared/shared-main/account/avatar.component.html index 09871fca4..310cc926f 100644 --- a/client/src/app/shared/shared-main/account/avatar.component.html +++ b/client/src/app/shared/shared-main/account/avatar.component.html @@ -1,8 +1,26 @@
- - Channel avatar - - - Account avatar - + + + Channel avatar + + + Account avatar + + + + + + Account avatar + + + + Channel avatar + + + + + + Account avatar + +
diff --git a/client/src/app/shared/shared-main/account/avatar.component.ts b/client/src/app/shared/shared-main/account/avatar.component.ts index 31f39c200..73c145ef9 100644 --- a/client/src/app/shared/shared-main/account/avatar.component.ts +++ b/client/src/app/shared/shared-main/account/avatar.component.ts @@ -10,6 +10,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill' export class AvatarComponent implements OnInit { @Input() video: Video @Input() size: 'md' | 'sm' = 'md' + @Input() genericChannel: boolean channelLinkTitle = '' accountLinkTitle = '' @@ -28,4 +29,8 @@ export class AvatarComponent implements OnInit { { name: this.video.account.name, handle: this.video.byAccount } ) } + + isChannelAvatarNull () { + return this.video.channel.avatar === null + } } -- cgit v1.2.3