neilenns / react-access-code-map

Access code map written using React
MIT License
0 stars 0 forks source link

Add a heart button count of total hearts #63

Closed neilenns closed 1 year ago

neilenns commented 1 year ago

Put this with the edit button but move edit and delete to the left and put heart on the right

neilenns commented 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

neilenns commented 1 year ago

Look for an existing react MUI control that does this

neilenns commented 1 year ago

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>
neilenns commented 1 year ago

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.