diff options
Diffstat (limited to 'packages/frontend/src/pages/clip.vue')
| -rw-r--r-- | packages/frontend/src/pages/clip.vue | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packages/frontend/src/pages/clip.vue b/packages/frontend/src/pages/clip.vue index d4e8f27005..d66088d33a 100644 --- a/packages/frontend/src/pages/clip.vue +++ b/packages/frontend/src/pages/clip.vue @@ -26,6 +26,7 @@ import { $i } from '@/account'; import { i18n } from '@/i18n'; import * as os from '@/os'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { url } from '@/config'; const props = defineProps<{ clipId: string, @@ -82,7 +83,17 @@ const headerActions = $computed(() => clip && isOwned ? [{ ...result, }); }, -}, { +}, ...(clip.isPublic ? [{ + icon: 'ti ti-share', + text: i18n.ts.share, + handler: async (): Promise<void> => { + navigator.share({ + title: clip.name, + text: clip.description, + url: `${url}/clips/${clip.id}`, + }); + }, +}] : []), { icon: 'ti ti-trash', text: i18n.ts.delete, danger: true, |