From 4b42c5235482fe0d3811b4e2936614c79e20d970 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Sat, 15 Oct 2022 16:40:58 +0800
Subject: feat: !WIP start of create project page

---
 .../routes/(main)/(app)/projects/new/+page.svelte  | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 code/app/src/routes/(main)/(app)/projects/new/+page.svelte

(limited to 'code/app/src/routes/(main)/(app)/projects/new/+page.svelte')

diff --git a/code/app/src/routes/(main)/(app)/projects/new/+page.svelte b/code/app/src/routes/(main)/(app)/projects/new/+page.svelte
new file mode 100644
index 0000000..4c453dc
--- /dev/null
+++ b/code/app/src/routes/(main)/(app)/projects/new/+page.svelte
@@ -0,0 +1,43 @@
+<script lang="ts">
+    import { useSWR } from "sswr";
+    import { Input, TextArea } from "$lib/components";
+    import type { ProjectMember } from "$lib/models/projects/ProjectMember";
+
+    const formFields = {
+        name: {
+            value: "",
+            error: "",
+        },
+        description: {
+            value: "",
+            error: "",
+        },
+        start: {
+            value: "",
+            error: "",
+        },
+        stop: {
+            value: "",
+            error: "",
+        },
+        members: {
+            value: [] as Array<ProjectMember>,
+            error: "",
+        },
+        clear() {},
+    };
+    async function submit(event: Event) {
+        alert("Submitted");
+    }
+    const { data: members } = useSWR("projectMembers");
+</script>
+
+<h1>Create a new project</h1>
+<form on:submit|preventDefault={submit} class="max-w-md flex flex-col gap-2">
+    <Input label="Name" bind:value={formFields.name.value} errorText={formFields.name.error} required />
+    <TextArea label="Description" bind:value={formFields.description.value} errorText={formFields.description.error} />
+    <section class="grid grid-flow-row sm:grid-flow-col gap-2">
+        <Input type="date" label="Start" bind:value={formFields.start.value} errorText={formFields.start.error} />
+        <Input type="date" label="Stop" bind:value={formFields.stop.value} errorText={formFields.stop.error} />
+    </section>
+</form>
-- 
cgit v1.3

