aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature
diff options
context:
space:
mode:
authorkontrollanten <6680299+kontrollanten@users.noreply.github.com>2021-04-15 10:01:27 +0200
committerGitHub <noreply@github.com>2021-04-15 10:01:27 +0200
commitfbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a (patch)
treee4c4d3a9abdc52afb2443234a57d74f0819b7d08 /client/src/app/shared/shared-video-miniature
parent266947e5efc7ff30b0020beb5a74e4d4fc696fa5 (diff)
downloadPeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.tar.gz
PeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.tar.zst
PeerTube-fbdcd4ec9f549b730f8311512bcc0c0b7bc2db0a.zip
Add AccountAvatarComponent (#3965)
* refactor(client): create account-avatar component * continue implement account-avatar * fix review comments
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r--client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts4
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.html5
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.scss5
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.ts2
4 files changed, 8 insertions, 8 deletions
diff --git a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
index 7a7868853..32cfdfd68 100644
--- a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
+++ b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
@@ -13,6 +13,7 @@ import { VideoDownloadComponent } from './video-download.component'
13import { VideoMiniatureComponent } from './video-miniature.component' 13import { VideoMiniatureComponent } from './video-miniature.component'
14import { VideosSelectionComponent } from './videos-selection.component' 14import { VideosSelectionComponent } from './videos-selection.component'
15import { VideoListHeaderComponent } from './video-list-header.component' 15import { VideoListHeaderComponent } from './video-list-header.component'
16import { SharedAccountAvatarModule } from '../shared-account-avatar/shared-account-avatar.module'
16 17
17@NgModule({ 18@NgModule({
18 imports: [ 19 imports: [
@@ -23,7 +24,8 @@ import { VideoListHeaderComponent } from './video-list-header.component'
23 SharedThumbnailModule, 24 SharedThumbnailModule,
24 SharedGlobalIconModule, 25 SharedGlobalIconModule,
25 SharedVideoLiveModule, 26 SharedVideoLiveModule,
26 SharedVideoModule 27 SharedVideoModule,
28 SharedAccountAvatarModule
27 ], 29 ],
28 30
29 declarations: [ 31 declarations: [
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index bac8bcc2d..4e61c27b3 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -10,9 +10,10 @@
10 <div class="video-bottom"> 10 <div class="video-bottom">
11 <div class="video-miniature-information"> 11 <div class="video-miniature-information">
12 <div class="d-flex video-miniature-meta"> 12 <div class="d-flex video-miniature-meta">
13 <a *ngIf="displayOptions.avatar" class="avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"> 13 <a *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" class="avatar" [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
14 <img [src]="getAvatarUrl()" alt="" [ngClass]="{ channel: displayOwnerVideoChannel() }" /> 14 <img [src]="getAvatarUrl()" alt="" class="channel" />
15 </a> 15 </a>
16 <my-account-avatar *ngIf="displayOptions.avatar && displayOwnerAccount()" [account]="video.account" size="40" [href]="'/video-channels/' + video.byVideoChannel" [title]="channelLinkTitle"></my-account-avatar>
16 17
17 <div class="w-100 d-flex flex-column"> 18 <div class="w-100 d-flex flex-column">
18 <a *ngIf="!videoHref" tabindex="-1" class="video-miniature-name" 19 <a *ngIf="!videoHref" tabindex="-1" class="video-miniature-name"
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
index 621951919..bf52b870c 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
@@ -12,13 +12,10 @@ $more-button-width: 40px;
12 width: calc(100% - #{$more-button-width}); 12 width: calc(100% - #{$more-button-width});
13} 13}
14 14
15my-account-avatar,
15.avatar { 16.avatar {
16 margin: 10px 10px 0 0; 17 margin: 10px 10px 0 0;
17 18
18 img:not(.channel) {
19 @include avatar(40px);
20 }
21
22 img.channel { 19 img.channel {
23 @include channel-avatar(40px); 20 @include channel-avatar(40px);
24 } 21 }
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
index 48da92d6b..8d66aaee2 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
@@ -182,7 +182,7 @@ export class VideoMiniatureComponent implements OnInit {
182 182
183 getAvatarUrl () { 183 getAvatarUrl () {
184 if (this.displayOwnerAccount()) { 184 if (this.displayOwnerAccount()) {
185 return this.video.accountAvatarUrl 185 return this.video.account.avatar?.url
186 } 186 }
187 187
188 return this.video.videoChannelAvatarUrl 188 return this.video.videoChannelAvatarUrl