From 8a32811226fd6de1aecc2709d1d5f322f4c45762 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Tue, 14 Jul 2026 19:15:20 -0400 Subject: [PATCH] Add Advance option section --- src/views/components/AddTaskModal.jsx | 49 ++++++++++++----- .../components/AdvancedOptionsSection.jsx | 55 ++++++++----------- 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/views/components/AddTaskModal.jsx b/src/views/components/AddTaskModal.jsx index b6f2a7e..dc76c6c 100644 --- a/src/views/components/AddTaskModal.jsx +++ b/src/views/components/AddTaskModal.jsx @@ -633,11 +633,8 @@ const TaskInput = ({ onChoreUpdate, isModalOpen, onClose }) => { finalAssignees = [{ userId: userProfile?.id }] finalAssignedTo = userProfile?.id finalAssignStrategy = assignStrategy - } else if (assignees.length === 1) { - finalAssignedTo = assignees[0].userId - finalAssignStrategy = assignStrategy } else { - finalAssignedTo = null + finalAssignedTo = assignees[0].userId finalAssignStrategy = assignStrategy } @@ -937,15 +934,21 @@ const TaskInput = ({ onChoreUpdate, isModalOpen, onClose }) => { /> { - if (!userId) { + values={assignees.map(a => a.userId)} + isAnyone={isAnyoneTask} + onChange={userIds => { + if (userIds.includes('anyone')) { + setIsAnyoneTask(true) setAssignees([]) } else { - setAssignees([{ userId }]) + setIsAnyoneTask(false) + setAssignees(userIds.map(userId => ({ userId }))) } }} - onClear={() => setAssignees([])} + onClear={() => { + setIsAnyoneTask(false) + setAssignees([]) + }} currentUserId={userProfile?.id} members={circleMembers?.res || []} /> @@ -987,16 +990,24 @@ const TaskInput = ({ onChoreUpdate, isModalOpen, onClose }) => { size='sm' variant='outlined' color='neutral' - startDecorator={} onClick={() => setHasDescription(true)} endDecorator={ showKeyboardShortcuts && ( ) } - sx={{ borderRadius: '128px', minHeight: 40, px: 1.25 }} + sx={{ + borderRadius: '128px', + minHeight: 40, + px: 1.25, + gap: 1, + transition: 'all 0.25s ease-in-out', + }} > - Description + + + Description + )} {!hasSubTasks && ( @@ -1004,16 +1015,24 @@ const TaskInput = ({ onChoreUpdate, isModalOpen, onClose }) => { size='sm' variant='outlined' color='neutral' - startDecorator={} onClick={() => setHasSubTasks(true)} endDecorator={ showKeyboardShortcuts && ( ) } - sx={{ borderRadius: '128px', minHeight: 40, px: 1.25 }} + sx={{ + borderRadius: '128px', + minHeight: 40, + px: 1.25, + gap: 1, + transition: 'all 0.25s ease-in-out', + }} > - Subtasks + + + Subtasks + )} ( +const FieldRow = ({ label, description, children, onLabelClick }) => ( ( py: 0.75, }} > - + {label} @@ -64,37 +73,17 @@ export const AdvancedOptionsTrigger = ({ - 0 ? 'soft' : 'outlined'} + color='neutral' onClick={onToggle} sx={{ - display: 'inline-flex', - alignItems: 'center', - gap: showLabel ? 1 : 0, - border: '1px solid', - borderColor: - open || activeCount > 0 - ? 'primary.outlinedBorder' - : 'neutral.outlinedBorder', - bgcolor: - open || activeCount > 0 ? 'primary.softBg' : 'transparent', - color: - open || activeCount > 0 ? 'primary.softColor' : 'text.secondary', - borderRadius: '128px', minHeight: 40, - px: showLabel ? 1.5 : 0.75, - cursor: 'pointer', - transition: 'all 0.2s ease-in-out', - '&:hover': { - bgcolor: - open || activeCount > 0 - ? 'primary.softHoverBg' - : 'neutral.softHoverBg', - borderColor: - open || activeCount > 0 - ? 'primary.outlinedHoverBorder' - : 'neutral.outlinedHoverBorder', - }, + borderRadius: '128px', + px: showLabel ? 1.25 : 0.75, + gap: showLabel ? 1 : 0, + transition: 'all 0.25s ease-in-out', }} > @@ -114,7 +103,7 @@ export const AdvancedOptionsTrigger = ({ > More - + {activeCount > 0 && ( onRequireApprovalChange(!requireApproval)} > onIsPrivateChange(!isPrivate) : undefined + } >