Fix up image selection modal
This commit is contained in:
@@ -27,6 +27,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
|
if (!imageUrl && !imageFile) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let key: string;
|
let key: string;
|
||||||
if (viewType === "url") {
|
if (viewType === "url") {
|
||||||
@@ -125,12 +129,8 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{#if viewType == "url"}
|
{#if viewType == "url"}
|
||||||
<button class="btn btn-secondary mb-2" on:click={searchImage}
|
<form method="dialog" style="width: 100%;" class="mb-8">
|
||||||
>Search for Image</button
|
<div class="flex justify-center items-center gap-2">
|
||||||
>
|
|
||||||
<form method="dialog" style="width: 100%;" class="mb-4">
|
|
||||||
<div>
|
|
||||||
<label for="rating">Image URL</label>
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="imageUrl"
|
id="imageUrl"
|
||||||
@@ -138,19 +138,25 @@
|
|||||||
class="input input-bordered w-full max-w-xs"
|
class="input input-bordered w-full max-w-xs"
|
||||||
placeholder="Enter the URL of the image"
|
placeholder="Enter the URL of the image"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn btn-neutral mb-2"
|
||||||
|
on:click={searchImage}
|
||||||
|
>Search for Image <iconify-icon icon="mdi:magnify" class="text-xl"
|
||||||
|
></iconify-icon></button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
{/if}
|
||||||
{#if viewType == "upload"}
|
{#if viewType == "upload"}
|
||||||
<form method="dialog" style="width: 100%;" class="mb-4">
|
<form method="dialog" style="width: 100%;" class="mb-8">
|
||||||
<div>
|
<div class="flex justify-center items-center">
|
||||||
<label for="rating">Image Upload</label>
|
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
id="imageFile"
|
id="imageFile"
|
||||||
on:change={handleFileChange}
|
on:change={handleFileChange}
|
||||||
placeholder="Upload an image file"
|
placeholder="Upload an image file"
|
||||||
class="input input-bordered w-full max-w-xs"
|
class="file-input file-input-bordered w-full max-w-xs"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user