Fix non-fixed header and menu when overflow-x body on touchscreens (#2711)
authorKim <1877318+kimsible@users.noreply.github.com>
Mon, 11 May 2020 09:16:21 +0000 (11:16 +0200)
committerGitHub <noreply@github.com>
Mon, 11 May 2020 09:16:21 +0000 (11:16 +0200)
* Make my-account-videos responsive on small screens

* Make my-account-channels responsive for small screens

* Make search result responsive on small screen

Co-authored-by: kimsible <kimsible@users.noreply.github.com>
client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html
client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss
client/src/app/+my-account/my-account-videos/my-account-videos.component.html
client/src/app/+my-account/my-account-videos/my-account-videos.component.scss
client/src/app/search/search.component.scss

index 03d45227eca8b341160fd7f3eb113da7822bce62..4cf08ab66790f4aef7fff9c50b56113c99799270 100644 (file)
 
       <div i18n class="video-channel-followers">{videoChannel.followersCount, plural, =1 {1 subscriber} other {{{ videoChannel.followersCount }} subscribers}}</div>
 
+      <div class="video-channel-buttons">
+        <my-edit-button [routerLink]="[ 'update', videoChannel.nameWithHost ]"></my-edit-button>
+        <my-delete-button (click)="deleteVideoChannel(videoChannel)"></my-delete-button>
+      </div>
+
       <div *ngIf="!isInSmallView" class="w-100 d-flex justify-content-end">
         <p-chart *ngIf="videoChannelsChartData && videoChannelsChartData[i]" type="line" [data]="videoChannelsChartData[i]" [options]="chartOptions" width="40vw" height="100px"></p-chart>
       </div>
     </div>
-
-    <div class="video-channel-buttons">
-      <my-edit-button [routerLink]="[ 'update', videoChannel.nameWithHost ]"></my-edit-button>
-      <my-delete-button (click)="deleteVideoChannel(videoChannel)"></my-delete-button>
-    </div>
   </div>
 </div>
index e1acf6cd6abfbf5ab9286aac22c6681c0c05e01d..144c2440bb94590534239a1981625ef3d0fd782b 100644 (file)
@@ -50,6 +50,7 @@
   }
 
   .video-channel-buttons {
+    margin-top: 10px;
     min-width: 190px;
   }
 }
         flex-direction: column;
         align-items: center !important;
         margin: auto;
+
+        .video-channel-name {
+          margin-left: 0px !important;
+        }
       }
     }
 
     }
 
     .video-channel-buttons {
-      margin-top: 10px;
+      align-self: center;
+    }
+  }
+}
+
+@media screen and (min-width: breakpoint(lg)) {
+  :host-context(.main-col:not(.expanded)) {
+    .video-channel-buttons {
+      float: right;
+    }
+  }
+}
+
+@media screen and (min-width: $small-view) {
+  :host-context(.expanded) {
+    .video-channel-buttons {
+      float: right;
     }
   }
 }
index b07b9c1a6cbb77b7fc02be661d64df2458a6cd63..55cbfda957b575e5c4e169d749c3ad26a10f0f1d 100644 (file)
   </ng-template>
 
   <ng-template ptTemplate="rowButtons" let-video>
-    <my-delete-button (click)="deleteVideo(video)"></my-delete-button>
+    <div class="action-button">
+      <my-delete-button (click)="deleteVideo(video)"></my-delete-button>
 
-    <my-edit-button [routerLink]="[ '/videos', 'update', video.uuid ]"></my-edit-button>
+      <my-edit-button [routerLink]="[ '/videos', 'update', video.uuid ]"></my-edit-button>
 
-    <my-button i18n-label label="Change ownership"
-               className="action-button-change-ownership grey-button"
-               icon="im-with-her"
-               (click)="changeOwnership($event, video)"
-    ></my-button>
+      <my-button i18n-label label="Change ownership"
+                 className="action-button-change-ownership grey-button"
+                 icon="im-with-her"
+                 (click)="changeOwnership($event, video)"
+      ></my-button>
+    </div>
   </ng-template>
 </my-videos-selection>
 
index 40bae7668595319c856b4de69203820521426b77..a3422c239c373e871ed95b3dd591fcc70743f46f 100644 (file)
 }
 
 ::ng-deep {
+  .video {
+    flex-wrap: wrap;
+  }
+
   .action-button span {
     white-space: nowrap;
   }
   }
 }
 
+.action-button {
+  display: flex;
+  margin-left: 55px;
+  margin-top: 10px;
+  align-self: flex-end;
+}
+
 my-delete-button,
 my-edit-button {
   margin-right: 10px;
@@ -60,6 +71,12 @@ my-edit-button {
     flex-direction: column;
   }
 
+  .action-button {
+    flex-direction: column;
+    align-self: center;
+    margin-left: 0px;
+  }
+
   ::ng-deep {
     .video-miniature {
       align-items: center;
@@ -98,3 +115,18 @@ my-edit-button {
     }
   }
 }
+
+// Adapt my-video-miniature on small screens with menu
+@media screen and (min-width: $small-view) and (max-width: #{breakpoint(lg) + ($not-expanded-horizontal-margins / 3) * 2}) {
+  :host-context(.main-col:not(.expanded)) {
+    ::ng-deep {
+      .video-miniature {
+        flex-direction: column;
+
+        .video-miniature-name {
+          max-width: 223px;
+        }
+      }
+    }
+  }
+}
index 641647e2eb17edabdc7803c7e423a73535f0e89e..78749cf2006b363d39194ff155c276aff6b2df28 100644 (file)
   }
 }
 
+@media screen and (min-width: $small-view) and (max-width: breakpoint(xl)) {
+  .video-channel-info .video-channel-names {
+    flex-direction: column !important;
+
+    .video-channel-name {
+      @include ellipsis; // Ellipsis and max-width on channel-name to not break screen
+
+      max-width: 250px;
+      margin-left: 0 !important;
+    }
+  }
+
+  :host-context(.main-col:not(.expanded)) {
+    // Override the min-width: 500px to not break screen
+    ::ng-deep .video-miniature-information {
+      min-width: 300px !important;
+    }
+  }
+}
+
+@media screen and (min-width: $small-view) and (max-width: breakpoint(lg)) {
+  :host-context(.main-col:not(.expanded)) {
+    .video-channel-info .video-channel-names {
+      .video-channel-name {
+        max-width: 160px;
+      }
+    }
+
+    // Override the min-width: 500px to not break screen
+    ::ng-deep .video-miniature-information {
+      min-width: 223px !important;
+    }
+  }
+
+  :host-context(.expanded) {
+    // Override the min-width: 500px to not break screen
+    ::ng-deep .video-miniature-information {
+      min-width: 300px !important;
+    }
+  }
+}
+
 @media screen and (max-width: $small-view) {
   .search-result {
     .entry.video-channel,
       justify-content: center;
       align-items: center;
       text-align: center;
-      
+
       img {
         margin: 0;
       }