Made the post preview card a link (#20846)

The modal in the new publish flow has a post preview card, which did not
link to the post itself. It does now (except when it's an email).
This commit is contained in:
Daniël van der Winden 2024-08-28 12:08:25 +02:00 committed by GitHub
parent 2b2e5dfeb1
commit 5cc3d943f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 42 additions and 31 deletions

View File

@ -100,41 +100,43 @@
<button type="button" class="close" title="Close" {{on "click" @close}}>{{svg-jar "close"}}<span class="hidden">Close</span></button> <button type="button" class="close" title="Close" {{on "click" @close}}>{{svg-jar "close"}}<span class="hidden">Close</span></button>
{{#unless this.post.emailOnly}} {{#unless this.post.emailOnly}}
<div class="gh-post-card"> <a href="{{this.post.url}}" target="_blank" rel="noopener noreferrer" title="View post: {{this.post.title}}">
{{#if this.post.featureImage}} <div class="gh-post-card">
<figure class="modal-image"> {{#if this.post.featureImage}}
<img src="{{this.post.featureImage}}" alt="{{this.post.title}}"> <figure class="modal-image">
</figure> <img src="{{this.post.featureImage}}" alt="{{this.post.title}}">
{{else if this.post.twitterImage}} </figure>
<figure class="modal-image"> {{else if this.post.twitterImage}}
<img src="{{this.post.twitterImage}}" alt="{{this.post.title}}"> <figure class="modal-image">
</figure> <img src="{{this.post.twitterImage}}" alt="{{this.post.title}}">
{{else if this.post.ogImage}} </figure>
<figure class="modal-image"> {{else if this.post.ogImage}}
<img src="{{this.post.ogImage}}" alt="{{this.post.title}}"> <figure class="modal-image">
</figure> <img src="{{this.post.ogImage}}" alt="{{this.post.title}}">
{{/if}} </figure>
<div class="modal-body">
<h2>{{this.post.title}}</h2>
{{#if this.post.excerpt}}
<p class="post-excerpt">{{this.post.excerpt}}</p>
{{/if}} {{/if}}
<div class="gh-post-details"> <div class="modal-body">
{{#if (get-setting "icon")}} <h2>{{this.post.title}}</h2>
<div class="gh-post-bookmark-site-icon"> {{#if this.post.excerpt}}
<img src={{get-setting "icon"}} alt="" role="presentation" /> <p class="post-excerpt">{{this.post.excerpt}}</p>
{{/if}}
<div class="gh-post-details">
{{#if (get-setting "icon")}}
<div class="gh-post-bookmark-site-icon">
<img src={{get-setting "icon"}} alt="" role="presentation" />
</div>
{{/if}}
{{#if (get-setting "title")}}
<div class="gh-post-bookmark-site-name">{{get-setting "title"}}</div>
{{/if}}
<div class="gh-post-bookmark-authors">{{post-author-names this.post}}</div>
</div> </div>
{{/if}}
{{#if (get-setting "title")}}
<div class="gh-post-bookmark-site-name">{{get-setting "title"}}</div>
{{/if}}
<div class="gh-post-bookmark-authors">{{post-author-names this.post}}</div>
</div> </div>
</div> </div>
</div> </a>
<footer class="modal-footer"> <footer class="modal-footer">
{{#if (and this.post.isPublished (not this.post.emailOnly))}} {{#if (and this.post.isPublished (not this.post.emailOnly))}}

View File

@ -895,6 +895,15 @@
border-radius: var(--radius); border-radius: var(--radius);
} }
.modal-post-success a {
text-decoration: none;
color: inherit;
}
.modal-post-success a:hover .gh-post-card {
background: var(--whitegrey-l2);
}
.modal-post-success .gh-post-card { .modal-post-success .gh-post-card {
border-radius: 8px; border-radius: 8px;
border: 1px solid var(--lightgrey-l1); border: 1px solid var(--lightgrey-l1);
@ -1054,7 +1063,7 @@
} }
.modal-post-success .modal-footer .gh-btn:is(.twitter, .threads, .facebook, .linkedin, .copy-link, .copy-preview-link):hover { .modal-post-success .modal-footer .gh-btn:is(.twitter, .threads, .facebook, .linkedin, .copy-link, .copy-preview-link):hover {
background: var(--whitegrey-l1); background: var(--whitegrey-l2);
} }
.modal-post-success .modal-footer .gh-btn:is(.twitter, .threads, .facebook, .linkedin) span { .modal-post-success .modal-footer .gh-btn:is(.twitter, .threads, .facebook, .linkedin) span {