diff --git a/frontend/src/routes/edit/EditableField.svelte b/frontend/src/routes/edit/EditableField.svelte
new file mode 100644
index 0000000..5b8c380
--- /dev/null
+++ b/frontend/src/routes/edit/EditableField.svelte
@@ -0,0 +1,106 @@
+
+
+
diff --git a/frontend/src/routes/edit/profile/+page.svelte b/frontend/src/routes/edit/profile/+page.svelte
index 2ffb937..b80382b 100644
--- a/frontend/src/routes/edit/profile/+page.svelte
+++ b/frontend/src/routes/edit/profile/+page.svelte
@@ -16,6 +16,7 @@
import { encode } from "base64-arraybuffer";
import { apiFetchClient } from "$lib/api/fetch";
import IconButton from "$lib/components/IconButton.svelte";
+ import EditableField from "../EditableField.svelte";
const MAX_AVATAR_BYTES = 1_000_000;
@@ -196,6 +197,13 @@
else links = [...links.slice(0, index - 1), ...links.slice(0, index + 1)];
};
+ const removeField = (index: number) => {
+ if (fields.length === 1) fields = [];
+ else if (index === 0) fields = fields.slice(1);
+ else if (index === fields.length - 1) fields = fields.slice(0, fields.length - 1);
+ else fields = [...fields.slice(0, index - 1), ...fields.slice(0, index + 1)];
+ };
+
const updateUser = async () => {
try {
const resp = await apiFetchClient("/users/@me", "PATCH", {
@@ -419,5 +427,18 @@
+
+
+ Fields
+
+
+
+
+ {#each fields as _, index}
+ removeField(index)} />
+ {/each}
+
{/if}