Reorder expense form fields
Reordered the fields in the expense form to display category, title, and amount, respectively.
This commit is contained in:
@@ -43,6 +43,22 @@ const ExpenseForm: React.FC<ExpenseFormProps> = ({ onSubmit, onCancel, isSubmitt
|
||||
return (
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
|
||||
{/* 카테고리 필드를 가장 먼저 배치 */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="category"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>카테고리</FormLabel>
|
||||
<ExpenseCategorySelector
|
||||
value={field.value}
|
||||
onValueChange={(value) => field.onChange(value)}
|
||||
/>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* 제목 필드를 두 번째로 배치 */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="title"
|
||||
@@ -58,6 +74,7 @@ const ExpenseForm: React.FC<ExpenseFormProps> = ({ onSubmit, onCancel, isSubmitt
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* 금액 필드를 마지막으로 배치 */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="amount"
|
||||
@@ -74,20 +91,6 @@ const ExpenseForm: React.FC<ExpenseFormProps> = ({ onSubmit, onCancel, isSubmitt
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="category"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>카테고리</FormLabel>
|
||||
<ExpenseCategorySelector
|
||||
value={field.value}
|
||||
onValueChange={(value) => field.onChange(value)}
|
||||
/>
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="flex justify-end gap-2 pt-2">
|
||||
<Button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user