From 1e76022a281de94311652cfce7aef9f60277b814 Mon Sep 17 00:00:00 2001
From: Sanne de Vries <sannedv@protonmail.com>
Date: Wed, 1 Jun 2022 18:26:20 -0400
Subject: [PATCH] Fixed post bookmark shifting layout bug

---
 .../admin/app/components/gh-post-bookmark.hbs | 22 +++++++++----------
 .../app/styles/components/publishmenu.css     |  7 ++++--
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/ghost/admin/app/components/gh-post-bookmark.hbs b/ghost/admin/app/components/gh-post-bookmark.hbs
index 0c178d2c44..53da27ac82 100644
--- a/ghost/admin/app/components/gh-post-bookmark.hbs
+++ b/ghost/admin/app/components/gh-post-bookmark.hbs
@@ -6,17 +6,17 @@
                     <img src={{imageUrl}} alt="" role="presentation" />
                 </div>
             {{/if}}
-        {{/let}}
-        <div class="gh-post-bookmark-content">
-            <div class="gh-post-bookmark-title">{{@post.title}}</div>
-            <div class="gh-post-bookmark-text truncate">{{@post.excerpt}}</div>
-            <div class="gh-post-bookmark-details">
-                {{#if (get-setting "icon")}}
-                    <div class="gh-post-bookmark-site-icon"><img src={{get-setting "icon"}} alt="" role="presentation" /></div>
-                {{/if}}
-                <div class="gh-post-bookmark-site-title">{{get-setting "title"}}</div>
-                <div class="gh-post-bookmark-authors">{{post-author-names @post}}</div>
+            <div class="gh-post-bookmark-content {{if imageUrl "" "no-image"}}">
+                <div class="gh-post-bookmark-title">{{@post.title}}</div>
+                <div class="gh-post-bookmark-text truncate">{{@post.excerpt}}</div>
+                <div class="gh-post-bookmark-details">
+                    {{#if (get-setting "icon")}}
+                        <div class="gh-post-bookmark-site-icon"><img src={{get-setting "icon"}} alt="" role="presentation" /></div>
+                    {{/if}}
+                    <div class="gh-post-bookmark-site-title">{{get-setting "title"}}</div>
+                    <div class="gh-post-bookmark-authors">{{post-author-names @post}}</div>
+                </div>
             </div>
-        </div>
+        {{/let}}
     </div>
 </div>
\ No newline at end of file
diff --git a/ghost/admin/app/styles/components/publishmenu.css b/ghost/admin/app/styles/components/publishmenu.css
index 3f34b2f0f4..a2b52fa3e7 100644
--- a/ghost/admin/app/styles/components/publishmenu.css
+++ b/ghost/admin/app/styles/components/publishmenu.css
@@ -752,7 +752,7 @@
 
 .gh-post-bookmark {
     display: grid;
-    grid-template-columns: auto auto;
+    grid-template-columns: 1fr minmax(0, 2fr);
     width: 100%;
     max-width: 640px;
     margin-top: 1.6rem;
@@ -780,7 +780,6 @@
 
 .gh-post-bookmark-image img {
     width: 100%;
-    max-width: 222px;
     height: 100%;
     max-height: 152px;
     object-fit: cover;
@@ -795,6 +794,10 @@
     overflow: hidden;
 }
 
+.gh-post-bookmark-content.no-image {
+    grid-column: span 2;
+}
+
 .gh-post-bookmark-title {
     display: -webkit-box;
     margin-bottom: .4rem;