Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
381 changes: 0 additions & 381 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/.config/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ export default defineNuxtConfig({
'@dargmuesli/nuxt-cookie-control/runtime/types.js',
'@http-util/status-i18n',
'@internationalized/date',
'@intlify/core-base',
'@intlify/shared',
'@sentry/nuxt',
'@tiptap/extension-text-align',
'@tiptap/starter-kit',
Expand All @@ -243,7 +245,6 @@ export default defineNuxtConfig({
'@vueuse/core',
'chart.js',
'class-variance-authority',
'clipboardy',
'clsx',
'css-element-queries',
'downloadjs',
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/guest/GuestListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const { event, guest } = defineProps<{

const { locale, t } = useI18n()
const localePath = useLocalePath()
const { copy } = useCopy()

// data
const pending = reactive({
Expand All @@ -130,7 +131,7 @@ const inviteMutation = useInviteMutation()
const copyLink = async (guest: Pick<GuestItemFragment, 'id'>) => {
if (!import.meta.client) return

await copyText(
await copy(
`${window.location.origin}${localePath(`guest-unlock`)}?ic=${guest.id}`,
)

Expand Down
24 changes: 23 additions & 1 deletion src/app/composables/window.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWindowScroll } from '@vueuse/core'
import { useClipboard, useWindowScroll } from '@vueuse/core'

export const useInfiniteScroll = ({
loadMore,
Expand All @@ -15,3 +15,25 @@ export const useInfiniteScroll = ({
loadMore()
})
}

export const useCopy = () => {
const { copy: clipboardCopy, isSupported } = useClipboard()
const { t } = useI18n({ useScope: 'global' })

const copy = async (text: string) => {
if (!import.meta.client) return

if (!isSupported) {
await showToast({
icon: 'error',
text: t('globalErrorClipboard'),
title: t('globalError'),
})
return
}

await clipboardCopy(text)
}

return { copy }
}
5 changes: 0 additions & 5 deletions src/app/utils/text.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
export const copyText = async (text: string) => {
const clipboard = (await import('clipboardy')).default
await clipboard.write(text)
}

export const calculatePasswordStrength = (password: string) => {
if (!password) return 0

Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/de.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"globalError": "Fehler",
"globalErrorNoData": "Antwort ohne Daten",
"globalErrorClipboard": "Dein Browser unterstützt das moderne Kopieren in die Zwischenablage nicht.",
"globalFormErrorAge18": "Du musst 18 Jahre alt sein.",
"globalLoading": "Lade...",
"globalPlaceholderAddress": "Veranstaltungsstraße 1,\n12345 Gaststadt",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"globalError": "Error",
"globalErrorNoData": "Response without data",
"globalErrorClipboard": "Your browser does not support modern copying to the clipboard.",
"globalFormErrorAge18": "You must be 18 years old.",
"globalLoading": "Loading...",
"globalPlaceholderAddress": "Eventstreet 1,\n12345 Guestcity",
Expand Down
1 change: 0 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"chart.js": "4.5.1",
"cheerio": "1.1.2",
"class-variance-authority": "0.7.1",
"clipboardy": "5.0.0",
"clsx": "2.1.1",
"consola": "3.4.2",
"css-element-queries": "1.2.3",
Expand Down
Loading