feat: add "Direct Messages" state to navbar
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful

This commit is contained in:
Twig 2025-08-08 02:07:58 +02:00
parent 28f5e8dc27
commit 89150a6cc6
Signed by: twig
SSH key fingerprint: SHA256:nBO+OwpTkd8LYhe38PIqdxmDvkIg9Vw2EbrRZM97dkU
2 changed files with 18 additions and 3 deletions

View file

@ -9,11 +9,9 @@
<div id="navbar-middle">
<NuxtImg v-if="props.contextIcon"
class="context-icon"
:alt="props.contextName"
:src="props.contextIcon" />
<DefaultIcon v-else-if="props.contextName && props.guildUuid"
class="context-icon"
:alt="props.contextName"
:name="props.contextName" :seed="props.guildUuid"/>
<div class="context-title">
@ -97,7 +95,7 @@ const props = defineProps<NavbarInterface>();
font-weight: 500;
font-size: calc(var(--navbar-height) * .5);
line-height: calc(var(--navbar-height) * .9);
line-height: var(--navbar-height);
}
.navbar-item {

View file

@ -23,16 +23,33 @@ import DirectMessagesSidebar from '~/components/Me/DirectMessagesSidebar.vue';
import Button from '~/components/UserInterface/Button.vue';
import AddFriend from '~/components/Me/AddFriend.vue';
import FriendsList from '~/components/Me/FriendsList.vue';
import type { NavbarInterface } from '~/types/interfaces';
const { fetchFriends } = useApi();
let filter = ref("all");
const navbar = useState<NavbarInterface>("navbar")
const friends = await fetchFriends()
function updateFilter(newFilter: string) {
filter.value = newFilter;
}
onMounted(async () => {
updateNavbar()
})
onActivated(async () => {
updateNavbar()
})
function updateNavbar() {
const runtimeConfig = useRuntimeConfig();
navbar.value.channelItems = []
navbar.value.contextName = "Direct Messages"
navbar.value.contextIcon = `${runtimeConfig.app.baseURL}/icon.svg`
}
</script>
<style module>