Changed the way the sidebar works
This commit is contained in:
@@ -40,6 +40,24 @@ const {
|
||||
)
|
||||
|
||||
const isLoading = computed(() => calendarStatus.value === "pending" || categoriesStatus.value === "pending")
|
||||
|
||||
// Set custom menu
|
||||
const { t } = useI18n()
|
||||
const { setCurrentMenu } = useUiStore()
|
||||
|
||||
setCurrentMenu([
|
||||
{
|
||||
tooltip: t("entity.world.backToMy"),
|
||||
to: "/my",
|
||||
phIcon: "universe",
|
||||
phIconWeight: "regular"
|
||||
},
|
||||
{
|
||||
tooltip: t("entity.world.backToSingle", { world: calendar.value?.data.world?.name }),
|
||||
to: `/my/worlds/${calendar.value?.data.world?.id}`,
|
||||
phIcon: "world"
|
||||
},
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -6,7 +6,7 @@ const supabase = useSupabaseClient()
|
||||
const user = useSupabaseUser()
|
||||
|
||||
definePageMeta({
|
||||
middleware: ["auth-guard"]
|
||||
middleware: ["auth-guard", "reset-menu"]
|
||||
})
|
||||
|
||||
const { data: worlds } = await useLazyFetch<{ data: World[] }>("/api/worlds/query", { query: { gmId: user?.value!.id } })
|
||||
@@ -31,7 +31,6 @@ function hideCreateDialog() {
|
||||
/** Active world channel */
|
||||
let worldChannel: RealtimeChannel
|
||||
|
||||
|
||||
/** Handles world insertion realtime events */
|
||||
function handleInsertedWorld(newWorld: WorldChannelPayload) {
|
||||
if (!worlds.value?.data) return
|
||||
@@ -121,10 +120,12 @@ function hideEditModal() {
|
||||
<template>
|
||||
<main class="p-8">
|
||||
<Head>
|
||||
<Title>{{ $t("entity.world.namePlural") }}</Title>
|
||||
<Title>{{ $t("pages.profile.metaTitle") }}</Title>
|
||||
</Head>
|
||||
|
||||
<Heading level="h1">{{ user?.user_metadata.full_name }}</Heading>
|
||||
<Heading level="h1">
|
||||
{{ $t("pages.profile.title", { user: user?.user_metadata.full_name }) }}
|
||||
</Heading>
|
||||
|
||||
<section class="mt-4">
|
||||
<Spacing size="lg">
|
||||
|
||||
@@ -4,6 +4,8 @@ import type { World } from "~/models/World";
|
||||
import type { Calendar, CalendarChannelPayload } from "~/models/CalendarConfig";
|
||||
import { PhArrowBendDoubleUpLeft, PhGlobeHemisphereWest, PhPencil } from "@phosphor-icons/vue";
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const supabase = useSupabaseClient()
|
||||
const route = useRoute()
|
||||
const id = route.params.id
|
||||
@@ -24,6 +26,18 @@ watch(user, (n) => {
|
||||
}
|
||||
})
|
||||
|
||||
// Set custom menu
|
||||
const { setCurrentMenu } = useUiStore()
|
||||
|
||||
setCurrentMenu([
|
||||
{
|
||||
tooltip: t("entity.world.backToMy"),
|
||||
to: "/my",
|
||||
phIcon: "universe",
|
||||
highlight: true
|
||||
},
|
||||
])
|
||||
|
||||
/**
|
||||
* === Subscriptions ===
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user