feat(editor): Bild-Block skip wenn recipe.id === null
This commit is contained in:
@@ -134,14 +134,20 @@
|
||||
</script>
|
||||
|
||||
<div class="editor">
|
||||
<section class="block">
|
||||
<h2>Bild</h2>
|
||||
<ImageUploadBox
|
||||
recipeId={recipe.id!}
|
||||
imagePath={recipe.image_path}
|
||||
onchange={(p) => onimagechange?.(p)}
|
||||
/>
|
||||
</section>
|
||||
{#if recipe.id !== null}
|
||||
<section class="block">
|
||||
<h2>Bild</h2>
|
||||
<ImageUploadBox
|
||||
recipeId={recipe.id}
|
||||
imagePath={recipe.image_path}
|
||||
onchange={(p) => onimagechange?.(p)}
|
||||
/>
|
||||
</section>
|
||||
{:else}
|
||||
<section class="block info">
|
||||
<p class="hint">Bild kannst du nach dem Speichern hinzufügen.</p>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<div class="meta">
|
||||
<label class="field">
|
||||
@@ -271,6 +277,15 @@
|
||||
margin: 0 0 0.75rem;
|
||||
color: #2b6a3d;
|
||||
}
|
||||
.block.info {
|
||||
background: #f6faf7;
|
||||
border: 1px dashed #cfd9d1;
|
||||
}
|
||||
.hint {
|
||||
color: #666;
|
||||
margin: 0;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.ing-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
|
||||
Reference in New Issue
Block a user