feat(team): add team settings with edit, leave, and kick functionality
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { parseError } from '#imports';
|
||||
import TeamAddModal from '~/components/TeamAddModal.vue';
|
||||
import TeamSettingsModal from '~/components/TeamSettingsModal.vue';
|
||||
import { useHuntStore } from '~/stores/hunt';
|
||||
import { useSettingsStore } from '~/stores/settings';
|
||||
import { useTitleStore } from '~/stores/title';
|
||||
@@ -18,6 +19,8 @@ const { name, id } = app.$slugData.huntSlug!;
|
||||
const titleStore = useTitleStore();
|
||||
const huntStore = useHuntStore();
|
||||
|
||||
const teamSettingsOpen = ref(false);
|
||||
|
||||
const { data, pending, refresh, error } = await useFetch(`/api/hunt/${id}`);
|
||||
|
||||
huntStore.setMembership(id, data.value?.isMember ?? false);
|
||||
@@ -176,14 +179,28 @@ ${document.location.href}`
|
||||
{{ t('page.hunt.your_team') }}
|
||||
<span class="text-xl font-bold">{{ data.ownTeam.name }}</span>
|
||||
</p>
|
||||
<VaButton size="small" class="group" @click="invite"
|
||||
>{{ t('page.hunt.invite') }}
|
||||
<span
|
||||
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none group-hover:blur-none"
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<VaButton size="small" class="group" @click="invite"
|
||||
>{{ t('page.hunt.invite') }}
|
||||
<span
|
||||
class="font-mono font-bold text-white blur transition hover:blur-none active:blur-none group-hover:blur-none"
|
||||
>
|
||||
{{ data.ownTeam.password }}</span
|
||||
></VaButton
|
||||
>
|
||||
{{ data.ownTeam.password }}</span
|
||||
></VaButton
|
||||
>
|
||||
<VaButton
|
||||
size="small"
|
||||
icon="settings"
|
||||
preset="secondary"
|
||||
@click="teamSettingsOpen = true"
|
||||
>{{ t('page.hunt.team_settings') }}</VaButton
|
||||
>
|
||||
</div>
|
||||
<TeamSettingsModal
|
||||
v-model="teamSettingsOpen"
|
||||
:hunt-id="data.id"
|
||||
@update="refresh"
|
||||
/>
|
||||
</div>
|
||||
</VaCardContent>
|
||||
</VaCard>
|
||||
|
||||
Reference in New Issue
Block a user