|
16 | 16 | import FormCategories from './form-categories.svelte';
|
17 | 17 | import FormIde from './form-ide.svelte';
|
18 | 18 | import { open } from '@tauri-apps/plugin-dialog';
|
| 19 | + import { ArrowLeft } from 'lucide-svelte'; |
| 20 | + import Separator from '../ui/separator/separator.svelte'; |
19 | 21 |
|
20 | 22 | interface Props {
|
21 | 23 | metadata?: Metadata;
|
|
78 | 80 | return data;
|
79 | 81 | });
|
80 | 82 | }
|
| 83 | +
|
| 84 | + function goBack() { |
| 85 | + history.back(); |
| 86 | + } |
81 | 87 | </script>
|
82 | 88 |
|
83 |
| -<h1>{formTitle}</h1> |
84 |
| -<form method="POST" use:enhance> |
85 |
| - <Form.Field {form} name="directory"> |
86 |
| - <Form.Control> |
87 |
| - {#snippet children({ props })} |
88 |
| - <Form.Label>Directory</Form.Label> |
89 |
| - <div class="flex"> |
90 |
| - <Input {...props} bind:value={$formData.directory} /> |
91 |
| - <Button onclick={pickDirectory}>Choose</Button> |
92 |
| - </div> |
93 |
| - {/snippet} |
94 |
| - </Form.Control> |
95 |
| - <Form.FieldErrors /> |
96 |
| - <Form.Description>TBC: Choose directory</Form.Description> |
97 |
| - </Form.Field> |
98 |
| - |
99 |
| - <Form.Field {form} name="title"> |
100 |
| - <Form.Control> |
101 |
| - {#snippet children({ props })} |
102 |
| - <Form.Label>Title</Form.Label> |
103 |
| - <Input {...props} bind:value={$formData.title} /> |
104 |
| - {/snippet} |
105 |
| - </Form.Control> |
106 |
| - <Form.FieldErrors /> |
107 |
| - <Form.Description>TBC: Title of the Project</Form.Description> |
108 |
| - </Form.Field> |
109 |
| - |
110 |
| - <Form.Field {form} name="description"> |
111 |
| - <Form.Control> |
112 |
| - {#snippet children({ props })} |
113 |
| - <Form.Label>Description</Form.Label> |
114 |
| - <Textarea {...props} bind:value={$formData.description} /> |
115 |
| - {/snippet} |
116 |
| - </Form.Control> |
117 |
| - <Form.FieldErrors /> |
118 |
| - <Form.Description>TBC: Description of the Project</Form.Description> |
119 |
| - </Form.Field> |
120 |
| - |
121 |
| - <FormCategories {form} /> |
122 |
| - <br /> |
123 |
| - |
124 |
| - <FormLanguages {form} /> |
125 |
| - <br /> |
126 |
| - |
127 |
| - <FormBuildSystems {form} /> |
128 |
| - <br /> |
129 |
| - |
130 |
| - <FormIde {form} /> |
131 |
| - <br /> |
132 |
| - |
133 |
| - <Form.Field {form} name="repositoryUrl"> |
134 |
| - <Form.Control> |
135 |
| - {#snippet children({ props })} |
136 |
| - <Form.Label>Repository Url</Form.Label> |
137 |
| - <Input {...props} bind:value={$formData.repositoryUrl} /> |
138 |
| - {/snippet} |
139 |
| - </Form.Control> |
140 |
| - <Form.FieldErrors /> |
141 |
| - <Form.Description>TBC: Repo Url of the Project</Form.Description> |
142 |
| - </Form.Field> |
143 |
| - |
144 |
| - <Form.Button>Submit</Form.Button> |
145 |
| -</form> |
| 89 | +<div class="flex w-full justify-between"> |
| 90 | + <Button onclick={goBack} variant="link"> |
| 91 | + <ArrowLeft /> |
| 92 | + Back |
| 93 | + </Button> |
| 94 | + <h1 class="text-3xl font-bold">{formTitle}</h1> |
| 95 | + <p></p> |
| 96 | +</div> |
| 97 | +<div class="w-full flex justify-center"> |
| 98 | + <form class="w-[80%]" method="POST" use:enhance> |
| 99 | + <Form.Field {form} name="directory"> |
| 100 | + <Form.Control> |
| 101 | + {#snippet children({ props })} |
| 102 | + <Form.Label>Location</Form.Label> |
| 103 | + <div class="flex gap-5"> |
| 104 | + <Input {...props} bind:value={$formData.directory} /> |
| 105 | + <Button onclick={pickDirectory} variant="secondary">Pick</Button> |
| 106 | + </div> |
| 107 | + {/snippet} |
| 108 | + </Form.Control> |
| 109 | + <Form.FieldErrors /> |
| 110 | + <Form.Description>Where the manifest file will be placed</Form.Description> |
| 111 | + </Form.Field> |
| 112 | + <div class="divider"></div> |
| 113 | + |
| 114 | + <Form.Field {form} name="title"> |
| 115 | + <Form.Control> |
| 116 | + {#snippet children({ props })} |
| 117 | + <Form.Label>Title</Form.Label> |
| 118 | + <Input {...props} bind:value={$formData.title} /> |
| 119 | + {/snippet} |
| 120 | + </Form.Control> |
| 121 | + <Form.FieldErrors /> |
| 122 | + <Form.Description></Form.Description> |
| 123 | + </Form.Field> |
| 124 | + <Separator class="m-2" /> |
| 125 | + |
| 126 | + <Form.Field {form} name="description"> |
| 127 | + <Form.Control> |
| 128 | + {#snippet children({ props })} |
| 129 | + <Form.Label class="flex flex-row" |
| 130 | + ><p>Description </p> |
| 131 | + <p class="opacity-60">(Optional)</p></Form.Label |
| 132 | + > |
| 133 | + <Textarea {...props} bind:value={$formData.description} /> |
| 134 | + {/snippet} |
| 135 | + </Form.Control> |
| 136 | + <Form.FieldErrors /> |
| 137 | + <Form.Description></Form.Description> |
| 138 | + </Form.Field> |
| 139 | + |
| 140 | + <div class="divider"></div> |
| 141 | + <FormCategories {form} /> |
| 142 | + |
| 143 | + <div class="divider"></div> |
| 144 | + <FormLanguages {form} /> |
| 145 | + <br /> |
| 146 | + |
| 147 | + <FormBuildSystems {form} /> |
| 148 | + <br /> |
| 149 | + |
| 150 | + <div class="divider"></div> |
| 151 | + <FormIde {form} /> |
| 152 | + <br /> |
| 153 | + |
| 154 | + <Form.Field {form} name="repositoryUrl"> |
| 155 | + <Form.Control> |
| 156 | + {#snippet children({ props })} |
| 157 | + <Form.Label>Repository Url</Form.Label> |
| 158 | + <Input {...props} bind:value={$formData.repositoryUrl} /> |
| 159 | + {/snippet} |
| 160 | + </Form.Control> |
| 161 | + <Form.FieldErrors /> |
| 162 | + <Form.Description>TBC: Repo Url of the Project</Form.Description> |
| 163 | + </Form.Field> |
| 164 | + |
| 165 | + <div class="divider"></div> |
| 166 | + <Form.Button class="w-full">Submit</Form.Button> |
| 167 | + </form> |
| 168 | +</div> |
146 | 169 |
|
147 | 170 | <!--
|
148 | 171 | <div class="container mx-auto p-4">
|
|
0 commit comments