cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

implement "web-share" on mobile devices instead of copying the event-type

Open PeerRich opened this issue 4 years ago • 6 comments

this button:

image

should open the android or iOS "web share" bottom panel:

image

we can use: https://web.dev/web-share/

if (navigator.share) {
  navigator.share({
    title: 'web.dev',
    text: 'Check out web.dev.',
    url: 'https://web.dev/',
  })
    .then(() => console.log('Successful share'))
    .catch((error) => console.log('Error sharing', error));
}

PeerRich avatar Feb 09 '22 18:02 PeerRich

Hi @PeerRich I want to work on this issue can you assign me?

Jenietoc avatar Feb 10 '22 13:02 Jenietoc

Hi @PeerRich I want to work on this issue can you assign me?

assigned! make sure it only opens in web-share on mobile and falls back to copying if web-share is not supported.

we could also change the string to "Share" when using web-share and "Copy link to event" when copying

PeerRich avatar Feb 10 '22 21:02 PeerRich

assigned you @Jenietoc

PeerRich avatar Feb 10 '22 23:02 PeerRich

Hey @PeerRich how are you? do you think this is a good solution? (I know I have to internalize the strings used). code

Jenietoc avatar Feb 11 '22 00:02 Jenietoc

Hey @PeerRich how are you? do you think this is a good solution? (I know I have to internalize the strings used).

code

yes looks good! only missing is wrapping hard coded strings in {t("key")} and add them to public/static/locales/en/common.json

PeerRich avatar Feb 11 '22 00:02 PeerRich

just keep in mind we switched to turbo repo yesterday so the folder structure has changed. make sure to git merge main and adjust the file structure when opening a PR

PeerRich avatar Feb 11 '22 11:02 PeerRich