Skip to content

Commit

Permalink
refactor: ordre al form
Browse files Browse the repository at this point in the history
  • Loading branch information
PauMatas committed Mar 18, 2024
1 parent ef01953 commit b483d67
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,30 +324,17 @@ export function ProfileForm({
>
<FormField
control={form.control}
name="year"
render={({ field }) => {
if (!field.value && default_year) {
field.value = default_year
field.onChange(default_year)
}

return (
<FormItem>
<FormLabel>Any</FormLabel>
<FormControl>
<Combobox
options={tipus_any}
value={field.value}
setValue={field.onChange}
isLoading={isLoading}
/>
</FormControl>
<FormDescription>
Any que has cursat l&apos;assignatura.
</FormDescription>
</FormItem>
)
}}
name="title"
render={({ field }) => (
<FormItem>
<FormLabel>Nom dels Apunts</FormLabel>
<FormControl>
<Input placeholder="WhoIsGraf?" {...field} />
</FormControl>
<FormDescription>El nom dels teus apunts.</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
Expand Down Expand Up @@ -375,20 +362,6 @@ export function ProfileForm({
</FormItem>
)}
/>
<FormField
control={form.control}
name="title"
render={({ field }) => (
<FormItem>
<FormLabel>Nom dels Apunts</FormLabel>
<FormControl>
<Input placeholder="WhoIsGraf?" {...field} />
</FormControl>
<FormDescription>El nom dels teus apunts.</FormDescription>
<FormMessage />
</FormItem>
)}
/>
{PreselectedSubject === "AllSubjects" && (
<FormField
control={form.control}
Expand All @@ -409,6 +382,33 @@ export function ProfileForm({
/>
)}

<FormField
control={form.control}
name="year"
render={({ field }) => {
if (!field.value && default_year) {
field.value = default_year
field.onChange(default_year)
}

return (
<FormItem>
<FormLabel>Any</FormLabel>
<FormControl>
<Combobox
options={tipus_any}
value={field.value}
setValue={field.onChange}
isLoading={isLoading}
/>
</FormControl>
<FormDescription>
Any que has cursat l&apos;assignatura.
</FormDescription>
</FormItem>
)
}}
/>
<FormField
control={form.control}
name="tipus"
Expand Down

0 comments on commit b483d67

Please sign in to comment.