feat: add 'Anyone' option for assignees and disable Limited option when no assignees are selected
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user