feat: update signup page
This commit is contained in:
1 parent
a12f153dc1
commit
7f9ab04c11
19 files changed
+236
-84
No files matched your search
@@ -7,7 +7,7 @@
|
||||
import { Icon, XCircle } from 'svelte-hero-icons'
|
||||
import { fly } from 'svelte/transition'
|
||||
|
||||
let type: 'community' = 'community'
|
||||
let type: 'community' | 'instance' = 'community'
|
||||
export let q: string = ''
|
||||
|
||||
export let jwt: string | undefined = undefined
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
import { profile } from '$lib/auth.js'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { ImageInput, toast } from 'mono-svelte'
|
||||
import { getClient, uploadImage } from '$lib/lemmy.js'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { Button, Checkbox, TextInput } from 'mono-svelte'
|
||||
import { uploadImage } from '$lib/util.js'
|
||||
|
||||
/**
|
||||
* The community ID to edit.
|
||||
@@ -39,9 +40,11 @@
|
||||
formData.submitting = true
|
||||
|
||||
try {
|
||||
let icon = formData.icon ? await uploadImage(formData.icon[0]) : undefined
|
||||
let icon = formData.icon
|
||||
? await uploadImage(formData.icon[0], $profile.instance, $profile.jwt)
|
||||
: undefined
|
||||
let banner = formData.banner
|
||||
? await uploadImage(formData.banner[0])
|
||||
? await uploadImage(formData.banner[0], $profile.instance, $profile.jwt)
|
||||
: undefined
|
||||
|
||||
const res = edit
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.js'
|
||||
import { uploadImage } from '$lib/util.js'
|
||||
import { ImageInput, toast } from 'mono-svelte'
|
||||
import { uploadImage } from '$lib/lemmy.js'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
loading = true
|
||||
|
||||
try {
|
||||
const uploaded = await uploadImage(image[0])
|
||||
const uploaded = await uploadImage(
|
||||
image[0],
|
||||
$profile.instance,
|
||||
$profile.jwt
|
||||
)
|
||||
|
||||
if (!uploaded) throw new Error('Image upload returned undefined')
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
|
||||
import { getClient, uploadImage } from '$lib/lemmy.js'
|
||||
import { getClient } from '$lib/lemmy.js'
|
||||
import type { Community, Post, PostView } from 'lemmy-js-client'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { Check, Icon, Photo } from 'svelte-hero-icons'
|
||||
import { profile } from '$lib/auth.js'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { placeholders } from '$lib/util.js'
|
||||
import { placeholders, uploadImage } from '$lib/util.js'
|
||||
import { Checkbox, TextInput } from 'mono-svelte'
|
||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||
import ObjectAutocomplete from '$lib/components/lemmy/ObjectAutocomplete.svelte'
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
dispatcher('submit', post.post_view)
|
||||
} else {
|
||||
let image = data.image ? await uploadImage(data.image[0]) : undefined
|
||||
let image = data.image ? await uploadImage(data.image[0], $profile.instance, $profile.jwt) : undefined
|
||||
data.url = image || data.url || undefined
|
||||
const post = await getClient().createPost({
|
||||
auth: $profile.jwt,
|
||||
|
||||
Reference in new issue
Block a user