Skip to content

Commit f83f718

Browse files
refactor: adjust grid layout for better responsiveness and fix the datepicker (CCExtractor#285)
1 parent a11fbc6 commit f83f718

3 files changed

Lines changed: 48 additions & 42 deletions

File tree

frontend/src/components/HomeComponents/Tasks/AddTaskDialog.tsx

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,26 @@ export const AddTaskdialog = ({
111111
</DialogDescription>
112112
</DialogHeader>
113113
<div className="space-y-4">
114-
<div className="grid grid-cols-4 items-center gap-4">
115-
<Label htmlFor="description" className="text-right">
114+
<div className="grid grid-cols-8 items-center gap-4">
115+
<Label htmlFor="description" className="text-right col-span-2">
116116
Description
117117
</Label>
118-
<Input
119-
id="description"
120-
name="description"
121-
type="text"
122-
value={newTask.description}
123-
onChange={(e) =>
124-
setNewTask({
125-
...newTask,
126-
description: e.target.value,
127-
})
128-
}
129-
required
130-
className="col-span-3"
131-
/>
118+
<div className="col-span-6">
119+
<Input
120+
id="description"
121+
name="description"
122+
type="text"
123+
value={newTask.description}
124+
onChange={(e) =>
125+
setNewTask({
126+
...newTask,
127+
description: e.target.value,
128+
})
129+
}
130+
required
131+
className="col-span-6"
132+
/>
133+
</div>
132134
</div>
133135
<div className="grid grid-cols-4 items-center gap-4">
134136
<Label htmlFor="priority" className="text-right">
@@ -226,20 +228,22 @@ export const AddTaskdialog = ({
226228
/>
227229
</div>
228230
</div>
229-
<div className="grid grid-cols-4 items-center gap-4">
230-
<Label htmlFor="description" className="text-right">
231+
<div className="grid grid-cols-8 items-center gap-4">
232+
<Label htmlFor="tags" className="text-right col-span-2">
231233
Tags
232234
</Label>
233-
<Input
234-
id="tags"
235-
name="tags"
236-
placeholder="Add a tag"
237-
value={tagInput}
238-
onChange={(e) => setTagInput(e.target.value)}
239-
onKeyDown={(e) => e.key === 'Enter' && handleAddTag()}
240-
required
241-
className="col-span-3"
242-
/>
235+
<div className="col-span-6">
236+
<Input
237+
id="tags"
238+
name="tags"
239+
placeholder="Add a tag"
240+
value={tagInput}
241+
onChange={(e) => setTagInput(e.target.value)}
242+
onKeyDown={(e) => e.key === 'Enter' && handleAddTag()}
243+
required
244+
className="col-span-6"
245+
/>
246+
</div>
243247
</div>
244248

245249
<div className="mt-2">
@@ -263,19 +267,21 @@ export const AddTaskdialog = ({
263267
</div>
264268
)}
265269
</div>
266-
<div className="grid grid-cols-4 items-center gap-4">
267-
<Label htmlFor="annotations" className="text-right">
268-
Annotations
270+
<div className="grid grid-cols-8 items-center gap-4">
271+
<Label htmlFor="annotations" className="text-right col-span-2">
272+
Annotation
269273
</Label>
270-
<Input
271-
id="annotations"
272-
name="annotations"
273-
placeholder="Add an annotation"
274-
value={annotationInput}
275-
onChange={(e) => setAnnotationInput(e.target.value)}
276-
onKeyDown={(e) => e.key === 'Enter' && handleAddAnnotation()}
277-
className="col-span-3"
278-
/>
274+
<div className="col-span-6">
275+
<Input
276+
id="annotations"
277+
name="annotations"
278+
placeholder="Add an annotation"
279+
value={annotationInput}
280+
onChange={(e) => setAnnotationInput(e.target.value)}
281+
onKeyDown={(e) => e.key === 'Enter' && handleAddAnnotation()}
282+
className="col-span-6"
283+
/>
284+
</div>
279285
</div>
280286

281287
<div className="mt-2">

frontend/src/components/HomeComponents/Tasks/Tasks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ export const Tasks = (
918918
className="hidden sm:flex min-w-[140px]"
919919
icon={<Key lable="t" />}
920920
/>
921-
<div className="pr-2">
921+
<div className="flex justify-center">
922922
<AddTaskdialog
923923
isOpen={isAddTaskOpen}
924924
setIsOpen={setIsAddTaskOpen}

frontend/src/components/ui/date-picker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function DatePicker({
2323
className,
2424
}: DatePickerProps) {
2525
return (
26-
<Popover>
26+
<Popover modal={true}>
2727
<PopoverTrigger asChild>
2828
<Button
2929
variant={'outline'}

0 commit comments

Comments
 (0)