]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Display fallback link card thumbnail when none is given
authorThibaut Girka <thib@sitedethib.com>
Thu, 10 Jan 2019 19:19:45 +0000 (20:19 +0100)
committerThibaut Girka <thib@sitedethib.com>
Thu, 10 Jan 2019 20:00:33 +0000 (21:00 +0100)
Port 1512af2811cb5b2ffccac5452eb291b1af46f89d to glitch-soc

app/javascript/flavours/glitch/features/status/components/card.js
app/javascript/flavours/glitch/styles/components/status.scss

index 743fe779a20063490eb9b53a6c2cb4e5e0e4101e..1e1604d5cd2f57a39e469e6e21770bc1a905a7b5 100644 (file)
@@ -195,6 +195,12 @@ export default class Card extends React.PureComponent {
           {thumbnail}
         </div>
       );
+    } else {
+      embed = (
+        <div className='status-card__image'>
+          <i className='fa fa-file-text' />
+        </div>
+      );
     }
 
     return (
index 38ead06cf521de16d1afe42df4a3509691d943c7..7b240224c3bf615a0a9b68a1dd7fa6b8e9cbf229 100644 (file)
@@ -740,6 +740,15 @@ a.status-card {
   flex: 0 0 100px;
   background: lighten($ui-base-color, 8%);
   position: relative;
+
+  .fa {
+    font-size: 21px;
+    position: absolute;
+    transform-origin: 50% 50%;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+  }
 }
 
 .status-card.horizontal {