]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix miniature avatar size
authorChocobozzz <me@florianbigard.com>
Wed, 5 May 2021 07:44:24 +0000 (09:44 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 5 May 2021 07:44:24 +0000 (09:44 +0200)
client/src/app/+videos/+video-watch/recommendations/recommended-videos.component.html
client/src/app/shared/shared-actor-image/actor-avatar.component.ts
client/src/app/shared/shared-video-miniature/video-miniature.component.html
client/src/app/shared/shared-video-miniature/video-miniature.component.ts
client/src/sass/include/_miniature.scss
client/src/sass/include/_mixins.scss

index e0e9f92e7603e7251ccd310ce038453eea2a5f1f..e1040feadfa04217458a631df9c847730cba3ad6 100644 (file)
@@ -15,7 +15,9 @@
     <ng-container *ngFor="let video of (videos$ | async); let i = index; let length = count">
       <my-video-miniature
         [displayOptions]="displayOptions" [video]="video" [user]="userMiniature" [displayAsRow]="displayAsRow"
-        (videoBlocked)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()" (videoAccountMuted)="onVideoRemoved()">
+        (videoBlocked)="onVideoRemoved()" (videoRemoved)="onVideoRemoved()" (videoAccountMuted)="onVideoRemoved()"
+        actorImageSize="32"
+      >
       </my-video-miniature>
 
       <hr *ngIf="!playlist && i == 0 && length > 1" />
index 835e151100897107be3bddc84dcc331e5bdc9a12..e74dd163484105e34b3c3058c30b1053e27bc7f6 100644 (file)
@@ -9,6 +9,8 @@ type ActorInput = {
   url: string
 }
 
+export type ActorAvatarSize = '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120'
+
 @Component({
   selector: 'my-actor-avatar',
   styleUrls: [ './actor-avatar.component.scss' ],
@@ -20,7 +22,7 @@ export class ActorAvatarComponent {
 
   @Input() previewImage: SafeResourceUrl
 
-  @Input() size: '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120'
+  @Input() size: ActorAvatarSize
 
   // Use an external link
   @Input() href: string
index 7c4fcc4911230b3aee122285c3e73a39ebd56c04..645be92bd3d4336dc8f64b4866e7df224e6abc8c 100644 (file)
       <div class="d-flex video-miniature-meta">
         <my-actor-avatar
           *ngIf="displayOptions.avatar && displayOwnerVideoChannel()" [title]="channelLinkTitle"
-          [channel]="video.channel" size="40" [internalHref]="[ '/video-channels', video.byVideoChannel ]"
+          [channel]="video.channel" [size]="actorImageSize" [internalHref]="[ '/video-channels', video.byVideoChannel ]"
         ></my-actor-avatar>
 
         <my-actor-avatar
           *ngIf="displayOptions.avatar && displayOwnerAccount()" [title]="channelLinkTitle"
-          [account]="video.account" size="40" [internalHref]="[ '/video-channels', video.byVideoChannel ]"
+          [account]="video.account" [size]="actorImageSize" [internalHref]="[ '/video-channels', video.byVideoChannel ]"
         ></my-actor-avatar>
 
         <div class="w-100 d-flex flex-column">
index d74b70d4c19a1e0298f31c2dec0ac52fd5f0665a..b58c118beac7e35706c46c98ebe1a56abeed90de 100644 (file)
@@ -12,6 +12,7 @@ import {
 } from '@angular/core'
 import { AuthService, ScreenService, ServerService, User } from '@app/core'
 import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models'
+import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component'
 import { Video } from '../shared-main'
 import { VideoPlaylistService } from '../shared-video-playlist'
 import { VideoActionsDisplayType } from './video-actions-dropdown.component'
@@ -51,6 +52,8 @@ export class VideoMiniatureComponent implements OnInit {
   }
   @Input() displayVideoActions = true
 
+  @Input() actorImageSize: ActorAvatarSize = '40'
+
   @Input() displayAsRow = false
 
   @Input() videoLinkType: VideoLinkType = 'internal'
index fb504906c41221c33a85da3d0a532fc34221a68e..070aa339868d397915d8fb95e9eb202b45f887b9 100644 (file)
@@ -3,9 +3,8 @@
 
 @mixin miniature-name {
   @include ellipsis-multiline(1.1em, 2);
+  @include peertube-word-wrap(false);
 
-  word-break: break-all;
-  word-wrap: break-word;
   transition: color 0.2s;
   font-weight: $font-semibold;
   color: pvar(--mainForegroundColor);
index 6d1e37bb6145ce67ad0506d077d9f0cf13b212dc..b2083e51653d3445e4745e062f22178cd43a7536 100644 (file)
   }
 }
 
-@mixin peertube-word-wrap {
+@mixin peertube-word-wrap ($with-hyphen: true) {
   word-break: break-word;
   word-wrap: break-word;
   overflow-wrap: break-word;
-  hyphens: auto;
+
+  @if $with-hyphen {
+    hyphens: auto;
+  }
 }
 
 @mixin apply-svg-color ($color) {