feat: add banner image to profile
This commit is contained in:
1 parent
daa124a51e
commit
59b7a399b9
1 file changed
+9
-9
@@ -16,6 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let profileImage: FileList | undefined
|
let profileImage: FileList | undefined
|
||||||
|
let bannerImage: FileList | undefined
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
if (!formData || !$profile?.jwt) return
|
if (!formData || !$profile?.jwt) return
|
||||||
@@ -27,22 +28,20 @@
|
|||||||
? await uploadImage(profileImage[0], $profile.instance, $profile.jwt)
|
? await uploadImage(profileImage[0], $profile.instance, $profile.jwt)
|
||||||
: undefined
|
: undefined
|
||||||
|
|
||||||
|
let banner = bannerImage
|
||||||
|
? await uploadImage(bannerImage[0], $profile.instance, $profile.jwt)
|
||||||
|
: undefined
|
||||||
|
|
||||||
const res = await getClient().saveUserSettings({
|
const res = await getClient().saveUserSettings({
|
||||||
...formData,
|
...formData,
|
||||||
avatar: pfp,
|
avatar: pfp,
|
||||||
})
|
})
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
content: 'Saved your user settings.',
|
content:
|
||||||
|
'Saved your user settings. If you changed your email, a verification email will have been sent.',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.verify_email_sent) {
|
|
||||||
toast({
|
|
||||||
content: 'A verification email was sent.',
|
|
||||||
type: 'info',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast({
|
toast({
|
||||||
content: err as any,
|
content: err as any,
|
||||||
@@ -170,7 +169,8 @@
|
|||||||
label="Bio"
|
label="Bio"
|
||||||
previewButton
|
previewButton
|
||||||
/>
|
/>
|
||||||
<ImageInput label="Profile image" bind:files={profileImage} />
|
<ImageInput label="Profile Image" bind:files={profileImage} />
|
||||||
|
<ImageInput label="Banner Image" bind:files={bannerImage} />
|
||||||
<TextInput label="Email" bind:value={formData.email} />
|
<TextInput label="Email" bind:value={formData.email} />
|
||||||
<TextInput
|
<TextInput
|
||||||
label="Matrix User"
|
label="Matrix User"
|
||||||
|
|||||||
Reference in new issue
Block a user