feat: implement a proper navbar

This commit is contained in:
Twig 2025-08-08 02:01:36 +02:00
parent 307969ffe5
commit 28f5e8dc27
Signed by: twig
SSH key fingerprint: SHA256:nBO+OwpTkd8LYhe38PIqdxmDvkIg9Vw2EbrRZM97dkU
4 changed files with 227 additions and 76 deletions

View file

@ -36,11 +36,12 @@ import ChannelEntry from "~/components/Guild/ChannelEntry.vue";
import GuildOptionsMenu from "~/components/Guild/GuildOptionsMenu.vue";
import MemberEntry from "~/components/Guild/MemberEntry.vue";
import ResizableSidebar from "~/components/UserInterface/ResizableSidebar.vue";
import type { ChannelResponse, GuildMemberResponse, GuildResponse } from "~/types/interfaces";
import type { ChannelResponse, GuildMemberResponse, GuildResponse, NavbarInterface } from "~/types/interfaces";
const route = useRoute();
const loading = useState("loading");
const navbar = useState<NavbarInterface>("navbar");
const channelUrlPath = `channels/${route.params.channelId}`;
@ -65,13 +66,18 @@ onMounted(async () => {
console.log("fetched guild");
await setArrayVariables();
console.log("set array variables");
updateNavbar()
});
onActivated(async () => {
console.log("activating");
updateNavbar()
const guildUrl = `guilds/${route.params.serverId}`;
server.value = await fetchWithApi(guildUrl);
console.log("fetched guild");
await setArrayVariables();
console.log("set array variables");
});
@ -98,6 +104,14 @@ function toggleInvitePopup(e: Event) {
function handleMemberClick(member: GuildMemberResponse) {
}
function updateNavbar() {
if (server.value) {
navbar.value.contextName = server.value.name
navbar.value.contextIcon = server.value.icon ?? undefined
navbar.value.guildUuid = server.value.uuid
}
}
</script>
<style>