feat: use new file input
This commit is contained in:
1 parent
2c7bb403b7
commit
260ee52404
7 files changed
+14
-75
No files matched your search
@@ -1,9 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { profile } from '$lib/auth.js'
|
||||
import FileInput from '$lib/components/input/FileInput.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { ImageInput, toast } from 'mono-svelte'
|
||||
import { getClient, uploadImage } from '$lib/lemmy.js'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { Button, Checkbox, TextInput } from 'mono-svelte'
|
||||
@@ -118,8 +117,8 @@
|
||||
disabled={edit != undefined}
|
||||
/>
|
||||
<TextInput required label="Display name" bind:value={formData.displayName} />
|
||||
<FileInput label="Icon" bind:files={formData.icon} image />
|
||||
<FileInput label="Banner" bind:files={formData.banner} image />
|
||||
<ImageInput label="Icon" bind:files={formData.icon} />
|
||||
<ImageInput label="Banner" bind:files={formData.banner} />
|
||||
<MarkdownEditor previewButton label="Sidebar" bind:value={formData.sidebar} />
|
||||
|
||||
<Checkbox bind:checked={formData.nsfw}>NSFW</Checkbox>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.js'
|
||||
import FileInput from '$lib/components/input/FileInput.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { ImageInput, toast } from 'mono-svelte'
|
||||
import { uploadImage } from '$lib/lemmy.js'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
@@ -38,11 +37,7 @@
|
||||
<Modal bind:open>
|
||||
<span slot="title">Upload image</span>
|
||||
<form class="flex flex-col gap-4" on:submit|preventDefault={upload}>
|
||||
<FileInput
|
||||
accept="image/jpeg,image/png,image/webp"
|
||||
image
|
||||
bind:files={image}
|
||||
/>
|
||||
<ImageInput accept="image/jpeg,image/png,image/webp" bind:files={image} />
|
||||
<Button {loading} disabled={loading} submit color="primary" size="lg">
|
||||
Upload
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user