Refactor the client to implement a channel navbar #76

Open
twig wants to merge 22 commits from navbar into main
Showing only changes of commit 5c38f9f9fc - Show all commits

View file

@ -55,7 +55,18 @@ definePageMeta({
});
const loading = useState("loading", () => false);
const navbar = useState<INavbar>("navbar")
const navbar = useState<INavbar>("navbar", () => {
return {
clientItems: [
{
title: "Source",
icon: "lucide:code-xml",
callback: () => { open("https://git.gorb.app/gorb/frontend") }
}
],
channelItems: [] // set by the channel
}
})
const createButtonContainer = ref<HTMLButtonElement>();
@ -150,23 +161,6 @@ const options = [
const guilds = await api.fetchMyGuilds();
onMounted(() => {
if (!navbar.value) {
const sourceLinkItem: NavbarItem = {
title: "Source",
icon: "lucide:code-xml",
callback: () => { open("https://git.gorb.app/gorb/frontend") }
}
navbar.value = {
clientItems: [
sourceLinkItem
],
channelItems: [] // set by the channel
}
}
})
function createDropdown() {
const dropdown = h(GuildDropdown, { options });
const div = document.createElement("div");