Closed neilenns closed 1 year ago
Be a :-( button too. Only one can be selected at a time and it saves back to the database when the note is closed
Look for an existing react MUI control that does this
Here's how to re-layout the buttons. It will need additional hide/show tests based on canVote
<Box
sx={{
display: "flex",
justifyContent: "space-between",
marginTop: 2,
}}
>
{(userContext.details?.canEdit ||
userContext.details?.canDelete) && (
<Box>
{userContext.details?.canEdit && (
<IconButton onClick={onMarkerEdit}>
<EditIcon />
</IconButton>
)}
{userContext.details?.canDelete && (
<IconButton onClick={onMarkerDelete}>
<DeleteIcon />
</IconButton>
)}
</Box>
)}
<Box>
<IconButton>
<DeleteIcon />
</IconButton>
</Box>
</Box>
I dug in to this and with no event at the marker level for detecting the pop-up closing it's just way too much work.
Put this with the edit button but move edit and delete to the left and put heart on the right