Browse Source

Don't show empty <a> for video

JC Brand 6 months ago
parent
commit
269ff4444b
2 changed files with 2 additions and 8 deletions
  1. 1 7
      src/shared/chat/styles/message-body.scss
  2. 1 1
      src/templates/video.js

+ 1 - 7
src/shared/chat/styles/message-body.scss

@@ -13,19 +13,13 @@ converse-chat-message-body {
 
     video {
         display: block;
-        max-height: 25em;
+        max-height: 30em;
         @include media-breakpoint-down(sm) {
             max-width: 95%;
         }
         @include media-breakpoint-up(md) {
             max-width: 70%;
         }
-        @include media-breakpoint-up(lg) {
-            max-width: 50%;
-        }
-        @include media-breakpoint-up(xl) {
-            max-width: 40%;
-        }
     }
 }
 

+ 1 - 1
src/templates/video.js

@@ -8,6 +8,6 @@ export default (url, hide_url) => {
     const { hostname } = new URL(url);
     return html`<figure>
         <video controls preload="metadata" src="${url}"></video>
-        ${hide_url ? '' : html`<a target="_blank" rel="noopener" title="${url}" href="${url}">${hostname}</a>`}
+        ${hide_url || !hostname ? '' : html`<a target="_blank" rel="noopener" title="${url}" href="${url}">${hostname}</a>`}
     </figure>`;
 }