feat: add 'Anyone' option for assignees and disable Limited option when no assignees are selected

This commit is contained in:
Mo Tarbin
2025-09-28 02:46:15 -04:00
parent f1384eef34
commit 7658b4c9fe

View File

@@ -659,6 +659,22 @@ const ChoreEdit = () => {
'--ListItem-radius': '20px', '--ListItem-radius': '20px',
}} }}
> >
{/* add one for Anyone if no specific assignee is selected */}
<ListItem key={'anyone'}>
<Checkbox
checked={assignees.length === 0}
onClick={() => {
setAssignees([])
setIsPrivate(false)
}}
overlay
disableIcon
variant='soft'
label='Anyone'
/>
</ListItem>
{performers?.map((item, index) => ( {performers?.map((item, index) => (
<ListItem key={item.id}> <ListItem key={item.id}>
<Checkbox <Checkbox
@@ -1176,9 +1192,17 @@ const ChoreEdit = () => {
<FormHelperText>Everyone in your circle</FormHelperText> <FormHelperText>Everyone in your circle</FormHelperText>
</FormControl> </FormControl>
<FormControl> <FormControl>
<Radio overlay value={true} label='Limited' /> <Radio
overlay
disabled={assignees.length === 0}
value={true}
label='Limited'
/>
<FormHelperText> <FormHelperText>
You and others that are assigned to the task You and others that are assigned to the task
{assignees.length === 0
? ' (No assignees selected, Limited option is disabled)'
: ''}
</FormHelperText> </FormHelperText>
</FormControl> </FormControl>
</RadioGroup> </RadioGroup>