Refactor the client to implement a channel navbar #76
4 changed files with 3 additions and 42 deletions
1
app.vue
1
app.vue
|
@ -9,6 +9,7 @@
|
|||
<script lang="ts" setup>
|
||||
import ContextMenu from '~/components/UserInterface/ContextMenu.vue';
|
||||
import type { ContextMenuInterface } from './types/interfaces';
|
||||
import type { INavbar } from '~/types/interfaces';
|
||||
|
||||
const banner = useState("banner", () => false);
|
||||
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
<template>
|
||||
<NuxtLayout>
|
||||
|
||||
</NuxtLayout>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
await navigateTo("/me/", { replace: true })
|
||||
|
||||
definePageMeta({
|
||||
layout: "client"
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</script>
|
|
@ -130,11 +130,7 @@ export interface NavbarItem {
|
|||
}
|
||||
|
||||
export interface INavbar {
|
||||
clientItems?: NavbarItem[]
|
||||
channelItems?: NavbarItem[] // search bar will require some changes
|
||||
contextName?: string
|
||||
contextIcon?: string
|
||||
guildUuid?: string
|
||||
guild: GuildResponse
|
||||
}
|
||||
|
||||
export interface NavbarOptions {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
import type { INavbar, NavbarOptions } from "~/types/interfaces";
|
||||
|
||||
const navbar = useState<INavbar>("navbar")
|
||||
|
||||
export default async (options: NavbarOptions) => {
|
||||
await nextTick()
|
||||
|
||||
if (navbar.value) {
|
||||
if (options.guild) {
|
||||
navbar.value.channelItems = []
|
||||
navbar.value.contextName = options.guild?.name
|
||||
navbar.value.contextIcon = options.guild?.icon ?? undefined
|
||||
navbar.value.guildUuid = options.guild?.uuid
|
||||
}
|
||||
else if (options.isDirectMessages) {
|
||||
navbar.value.channelItems = []
|
||||
navbar.value.contextName = "Direct Messages"
|
||||
navbar.value.contextIcon = undefined
|
||||
navbar.value.guildUuid = undefined
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue