2020-11-06 11:34:32 +01:00
|
|
|
<template>
|
|
|
|
<redirect-with-account
|
2021-01-15 16:55:58 +01:00
|
|
|
v-if="uri"
|
2020-11-06 11:34:32 +01:00
|
|
|
:uri="uri"
|
|
|
|
:pathAfterLogin="`/@${preferredUsername}`"
|
2022-07-12 10:55:28 +02:00
|
|
|
:sentence="
|
|
|
|
t(
|
|
|
|
`We will redirect you to your instance in order to interact with this group`
|
|
|
|
)
|
|
|
|
"
|
2020-11-06 11:34:32 +01:00
|
|
|
/>
|
|
|
|
</template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2020-11-06 11:34:32 +01:00
|
|
|
import RedirectWithAccount from "@/components/Utils/RedirectWithAccount.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { useGroup } from "@/composition/apollo/group";
|
|
|
|
import { displayName } from "@/types/actor";
|
|
|
|
import { computed } from "vue";
|
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
import { useHead } from "@vueuse/head";
|
2020-11-06 11:34:32 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const props = defineProps<{
|
|
|
|
preferredUsername: string;
|
|
|
|
}>();
|
2020-11-06 11:34:32 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const { group } = useGroup(props.preferredUsername);
|
2021-01-15 16:55:58 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const { t } = useI18n({ useScope: "global" });
|
2020-11-06 11:34:32 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
useHead({
|
|
|
|
title: computed(() =>
|
|
|
|
t("Join group {group}", {
|
|
|
|
group: groupTitle.value,
|
|
|
|
})
|
|
|
|
),
|
|
|
|
});
|
2021-06-16 11:26:19 +02:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const uri = computed((): string | undefined => {
|
|
|
|
return group.value?.url;
|
|
|
|
});
|
|
|
|
|
|
|
|
const groupTitle = computed((): undefined | string => {
|
|
|
|
return group && displayName(group.value);
|
|
|
|
});
|
2020-11-06 11:34:32 +01:00
|
|
|
</script>
|