Fix broken views on mobile and small screens (#2671)
[oweals/peertube.git] / client / src / app / search / search.component.scss
index e5dfddcc59c1e9e5194a4c0d935eb8b19f8fc6ef..641647e2eb17edabdc7803c7e423a73535f0e89e 100644 (file)
@@ -1,15 +1,6 @@
 @import '_variables';
 @import '_mixins';
 
-.no-result {
-  height: 40vh;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  font-size: 16px;
-  font-weight: $font-semibold;
-}
-
 .search-result {
   padding: 40px;
 
@@ -32,6 +23,7 @@
       }
 
       .results-filter-button {
+        cursor: pointer;
 
         .icon.icon-filter {
           @include icon(20px);
         }
       }
     }
-
-    .results-filter {
-      // Animation when we show/hide the filters
-      transition: max-height 0.3s;
-      display: block !important;
-      overflow: hidden !important;
-      max-height: 0;
-
-      &.show {
-        max-height: 1500px;
-      }
-    }
   }
 
   .entry {
     padding-bottom: 20px;
     margin-bottom: 20px;
 
-    &.video {
-
-      my-video-thumbnail {
-        margin-right: 10px;
-      }
-
-      .video-info {
-        flex-grow: 1;
-
-        .video-info-name {
-          @include disable-default-a-behaviour;
-
-          color: #000;
-          display: block;
-          width: fit-content;
-          font-size: 18px;
-          font-weight: $font-semibold;
-        }
-
-        .video-info-date-views {
-          font-size: 14px;
-        }
-
-        .video-info-account {
-          @include disable-default-a-behaviour;
-
-          display: block;
-          width: fit-content;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-          font-size: 14px;
-          color: #585858;
-
-          &:hover {
-            color: #303030;
-          }
-        }
-      }
-    }
-
     &.video-channel {
-
       img {
-        @include avatar(120px);
+        $image-size: 130px;
+        $margin-size: ($video-thumbnail-width - $image-size) / 2; // So we have the same width than the video miniature
+
+        @include avatar($image-size);
 
-        margin: 0 50px 0 40px;
+        margin: 0 ($margin-size + 10) 0 $margin-size;
       }
 
       .video-channel-info {
 
           display: flex;
           align-items: baseline;
-          color: #000;
+          color: var(--mainForegroundColor);
           width: fit-content;
 
           .video-channel-display-name {
   }
 }
 
-@media screen and (max-width: 800px) {
+@media screen and (max-width: $small-view) {
   .search-result {
-    margin: 20px 10px;
-  }
+    .entry.video-channel,
+    .entry.video {
+      flex-direction: column;
+      height: auto;
+      justify-content: center;
+      align-items: center;
+      text-align: center;
+      
+      img {
+        margin: 0;
+      }
 
-  .results-header {
-    font-size: 15px !important;
-  }
+      img {
+        margin: 0;
+      }
 
-  .entry {
-    flex-direction: column;
-    height: auto;
-    text-align: center;
-
-    &.video {
-      .video-info-name,
-      .video-info-account {
-        margin: auto;
+      .video-channel-info .video-channel-names {
+        align-items: center;
+        flex-direction: column !important;
+
+        .video-channel-name {
+          margin-left: 0 !important;
+        }
       }
 
-      my-video-thumbnail {
-        margin-right: 0 !important;
+      my-subscribe-button {
+        margin-top: 5px;
+      }
+    }
+  }
+}
 
-        /deep/ .video-thumbnail {
-          width: 100%;
-          height: auto;
+@media screen and (max-width: $mobile-view) {
+  .search-result {
+    padding: 20px 10px;
 
-          img {
+    .results-header {
+      font-size: 15px !important;
+    }
+
+    .entry {
+      &.video {
+        .video-info-name,
+        .video-info-account {
+          margin: auto;
+        }
+
+        my-video-thumbnail {
+          margin-right: 0 !important;
+
+          ::ng-deep .video-thumbnail {
             width: 100%;
             height: auto;
+
+            img {
+              width: 100%;
+              height: auto;
+            }
           }
         }
       }