feat: finish DM sidebar

This commit is contained in:
Twig 2025-07-10 23:12:44 +02:00
parent c9bea94ef8
commit 34976b4f50
No known key found for this signature in database
4 changed files with 34 additions and 40 deletions

View file

@ -1,20 +1,29 @@
<template>
<div id="friend-sidebar">
<div id="server-title">
<h3>Direct Messages</h3>
</div>
<verticalSpacer />
<div id="direct-message-list">
<UserEntry v-for="user of friends" :user="user" :name="user.display_name || user.username"
:href="`/me/${user.uuid}`"/>
<!-- <Channel v-for="channel of channels" :name="channel.name"
:uuid="channel.uuid" :current-uuid="(route.params.channelId as string)"
:href="`/servers/${route.params.serverId}/channels/${channel.uuid}`" /> -->
<div id="middle-left-column">
<div id="friend-sidebar">
<div id="server-title">
<h3>Direct Messages</h3>
</div>
<VerticalSpacer />
<NuxtLink class="user-item" :href="`/me/friends`" tabindex="0">
<Icon class="user-avatar" name="lucide:user" />
<span class="user-display-name">Friends</span>
</NuxtLink>
<VerticalSpacer />
<div id="direct-message-list">
<UserEntry v-for="user of friends" :user="user" :name="user.display_name || user.username"
:href="`/me/${user.uuid}`"/>
<!-- <Channel v-for="channel of channels" :name="channel.name"
:uuid="channel.uuid" :current-uuid="(route.params.channelId as string)"
:href="`/servers/${route.params.serverId}/channels/${channel.uuid}`" /> -->
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import VerticalSpacer from './UserInterface/VerticalSpacer.vue';
const { fetchFriends } = useApi();
const friends = await fetchFriends()
@ -28,11 +37,13 @@ definePageMeta({
</script>
<style>
#friend-sidebar {
padding-left: .5em;
padding-right: .5em;
border-right: 1px solid var(--padding-color);
#middle-left-column {
background: var(--optional-channel-list-background);
background-color: var(--sidebar-background-color);
}
#friend-sidebar {
padding-left: .5em;
padding-right: .5em;
}
</style>

View file

@ -24,7 +24,12 @@ const props = defineProps<{
margin-bottom: .5em;
gap: .5em;
cursor: pointer;
text-decoration: none;
color: inherit;
}
.user-item:hover {
background-color: #00000020
}
.user-avatar {

View file

@ -2,15 +2,6 @@
<span class="spacer"></span>
</template>
<script lang="ts" setup>
import type { UserResponse } from '~/types/interfaces';
const props = defineProps<{
user: UserResponse,
}>();
</script>
<style scoped>
.spacer {
height: 0.2dvh;

View file

@ -1,19 +1,6 @@
<template>
<NuxtLayout>
<div id="left-bar">
</div>
<div id="middle-bar">
<h1>
Welcome to gorb :3
</h1>
<p>
Click on a guild to the left to view a guild.
<br>
Or click the button in the bottom left to join a guild.
</p>
</div>
<div id="right-bar">
</div>
<NuxtLayout name="client">
<DirectMessagesSidebar />
</NuxtLayout>
</template>