mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Updated NFT card handling in the editor
refs https://github.com/TryGhost/Team/issues/1211 Using `type` rather than `card_type` since that's been replaced in the API. Moves the rendering of the card in the template so that we get access to the caption editor, and selectable card (rather than the anchor tag redirecting us to OpenSea) Updates the `isEmpty` property to take into account NFT cards.
This commit is contained in:
parent
a87cfe0ebc
commit
6ef642a5e8
@ -16,13 +16,14 @@
|
||||
@editor={{this.editor}}
|
||||
as |card|
|
||||
>
|
||||
{{#if (eq this.payload.metadata.card_type "nft")}}
|
||||
<KoenigCardEmbed::Nft @payload={{this.payload}} />
|
||||
{{else}}
|
||||
{{#if this.payload.html}}
|
||||
{{#if this.payload.type}}
|
||||
<div class="kg-card-hover">
|
||||
<div class="koenig-embed-{{this.payload.type}} flex justify-center relative" data-kg-embed>
|
||||
<iframe class="bn miw-100" scrolling="no"></iframe>
|
||||
{{#if (eq this.payload.type "nft")}}
|
||||
<KoenigCardEmbed::Nft @payload={{this.payload}} />
|
||||
{{else}}
|
||||
<iframe class="bn miw-100" scrolling="no"></iframe>
|
||||
{{/if}}
|
||||
<div class="koenig-card-click-overlay ba b--transparent" data-kg-overlay></div>
|
||||
</div>
|
||||
|
||||
@ -59,5 +60,4 @@
|
||||
onkeydown={{action "urlKeydown"}}>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</KoenigCard>
|
||||
|
@ -35,7 +35,7 @@ export default Component.extend({
|
||||
registerComponent() {},
|
||||
|
||||
isEmpty: computed('payload.html', function () {
|
||||
return isBlank(this.payload.html);
|
||||
return isBlank(this.payload.html) && this.payload.type !== 'nft';
|
||||
}),
|
||||
|
||||
counts: computed('payload.{html,caption}', function () {
|
||||
@ -177,7 +177,7 @@ export default Component.extend({
|
||||
this.send('insertAsBookmark', response);
|
||||
return;
|
||||
}
|
||||
if (!response.html && response.card_type !== 'nft') {
|
||||
if (!response.html && response.type !== 'nft') {
|
||||
throw 'No HTML returned';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user