@@ -51,8 +51,13 @@ SPDX-License-Identifier: AGPL-3.0-only
51
51
</div>
52
52
<div :class="$style.buttons">
53
53
<MkButton v-if="!invite.used && !isExpired" primary rounded @click="copyInviteCode()"><i class="ti ti-copy"></i> {{ i18n.ts.copy }}</MkButton>
54
+ <MkButton v-if="!invite.used && !isExpired" primary rounded @click="copyInviteCodeAsLink()"><i class="ti ti-copy"></i> {{ i18n.ts.copyLink }}</MkButton>
54
55
<MkButton v-if="!invite.used || moderator" danger rounded @click="deleteCode()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
55
56
</div>
57
+ <div v-if="!invite.used && !isExpired">
58
+ <div :class="$style.label">{{ i18n.ts.qrcode }}</div>
59
+ <vue-qrcode :value="inviteUrl" :options="option" tag="img"></vue-qrcode>
60
+ </div>
56
61
</div>
57
62
</MkFolder>
58
63
</template>
@@ -65,6 +70,7 @@ import MkButton from '@/components/MkButton.vue';
65
70
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
66
71
import { i18n } from '@/i18n.js';
67
72
import * as os from '@/os.js';
73
+ import VueQrcode from "@chenfengyuan/vue-qrcode";
68
74
69
75
const props = defineProps<{
70
76
invite: Misskey.entities.InviteCode;
@@ -79,6 +85,8 @@ const isExpired = computed(() => {
79
85
return props.invite.expiresAt && new Date(props.invite.expiresAt) < new Date();
80
86
});
81
87
88
+ const inviteUrl = `${(new URL(window.location.href)).origin}/?invite=${props.invite.code}`;
89
+
82
90
function deleteCode() {
83
91
os.apiWithDialog('invite/delete', {
84
92
inviteId: props.invite.id,
@@ -90,6 +98,12 @@ function copyInviteCode() {
90
98
copyToClipboard(props.invite.code);
91
99
os.success();
92
100
}
101
+
102
+ function copyInviteCodeAsLink() {
103
+ copyToClipboard(inviteUrl);
104
+ os.success();
105
+ }
106
+
93
107
</script>
94
108
95
109
<style lang="scss" module>
0 commit comments