Merge pull request #282 from Midas-sudo/feat/ClipboardCopy

Added the feature to copy the list of available people to the Clipboard
This commit is contained in:
Benji Grant 2023-06-21 01:35:39 +10:00 committed by GitHub
commit c22dc1c7b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -101,6 +101,10 @@ const AvailabilityViewer = ({ times, people, table }: AvailabilityViewerProps) =
people: peopleHere, people: peopleHere,
}) })
}} }}
onClick={() => {
const clipboardMessage = `${t('group.clipboard_message', { date: cell.label })}:\n${peopleHere.join(', ')}`
navigator.clipboard.writeText(clipboardMessage)
}}
onMouseLeave={() => setTooltip(undefined)} onMouseLeave={() => setTooltip(undefined)}
/> />
})} })}

View file

@ -48,8 +48,9 @@
"group": { "group": {
"legend_tooltip": "Click to highlight highest availability", "legend_tooltip": "Click to highlight highest availability",
"info1": "Hover or tap the calendar below to see who is available", "info1": "Hover or tap the calendar below to see who is available, and click to copy details about a time slot",
"info2": "Click the names below to view people individually" "info2": "Click the names below to view people individually",
"clipboard_message": "People available on {{date}}"
}, },
"you": { "you": {