Skip to content

Commit

Permalink
Update pokestop popup to support Copy ID
Browse files Browse the repository at this point in the history
  • Loading branch information
mkl committed Mar 20, 2024
1 parent 55894b2 commit d65b94a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/features/pokestop/PokestopPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const MenuActions = ({
invasions,
}) => {
const { t } = useTranslation()
const { perms } = useMemory((s) => s.auth)
const masterfile = useMemory((s) => s.masterfile)
const filters = useStorage((s) => s.filters)

Expand Down Expand Up @@ -354,6 +355,11 @@ const MenuActions = ({
})
}

const copyId = () => {
setAnchorEl(null)
navigator.clipboard.writeText(id)
}

const options = [{ name: 'hide', action: handleHide }]

if (hasQuest) {
Expand Down Expand Up @@ -459,6 +465,11 @@ const MenuActions = ({
}
options.push({ name: 'timer', action: handleTimer })
}

if (perms.admin) {
options.push({ name: 'Copy ID', action: copyId })
}

return (
<Grid xs={2} textAlign="right">
<IconButton aria-haspopup="true" onClick={handleClick} size="large">
Expand Down

0 comments on commit d65b94a

Please sign in to comment.