Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/talk/renderer/TitleBar/TitleBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
-->

<script setup lang="ts">
import AppsMenu from './components/AppsMenu.vue'
import DevMenu from './components/DevMenu.vue'
import MainMenu from './components/MainMenu.vue'
import UserMenu from './components/UserMenu.vue'
Expand Down Expand Up @@ -45,6 +46,10 @@ const { isDevMode } = useDevMode()
<DevMenu />
</div>

<div class="title-bar__item" data-theme-dark>
<AppsMenu />
</div>

<div class="title-bar__item" data-theme-dark>
<MainMenu />
</div>
Expand Down
68 changes: 68 additions & 0 deletions src/talk/renderer/TitleBar/components/AppsMenu.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->

<script setup lang="ts">
import axios from '@nextcloud/axios'
import { t } from '@nextcloud/l10n'
import { generateOcsUrl } from '@nextcloud/router'
import { onBeforeMount, ref } from 'vue'
import NcActionLink from '@nextcloud/vue/components/NcActionLink'
import NcActions from '@nextcloud/vue/components/NcActions'
import IconDotsGrid from 'vue-material-design-icons/DotsGrid.vue'
import ThemeLogo from './ThemeLogo.vue'
import { appData } from '../../../../app/AppData.js'

const apps = ref([])
const serverUrl = appData.serverUrl! as string
const theming = appData.capabilities.theming

// TODO: add it to the Application Data
// TODO: add types
onBeforeMount(async () => {
const response = await axios.get(generateOcsUrl('core/navigation/apps'))
apps.value = response.data.ocs.data.filter(({ id }) => id !== 'spreed')

Check failure on line 25 in src/talk/renderer/TitleBar/components/AppsMenu.vue

View workflow job for this annotation

GitHub Actions / NPM typecheck

Binding element 'id' implicitly has an 'any' type.
})
</script>

<template>
<NcActions :aria-label="t('talk_desktop', 'Menu')" variant="tertiary-no-background" force-menu>
<template #icon>
<IconDotsGrid :size="20" />
</template>

<NcActionLink :href="serverUrl">
<template #icon>
<span class="action-icon-wrapper">
<ThemeLogo :size="20" />
</span>
</template>
{{ theming.name }}
</NcActionLink>
<NcActionLink v-for="app in apps" :key="app.id" :href="app.href">

Check failure on line 43 in src/talk/renderer/TitleBar/components/AppsMenu.vue

View workflow job for this annotation

GitHub Actions / NPM typecheck

Property 'href' does not exist on type 'never'.

Check failure on line 43 in src/talk/renderer/TitleBar/components/AppsMenu.vue

View workflow job for this annotation

GitHub Actions / NPM typecheck

Property 'id' does not exist on type 'never'.
<template #icon>
<span class="action-icon-wrapper">
<img class="app-icon" :src="app.icon" alt="">

Check failure on line 46 in src/talk/renderer/TitleBar/components/AppsMenu.vue

View workflow job for this annotation

GitHub Actions / NPM typecheck

Property 'icon' does not exist on type 'never'.
</span>
</template>
{{ app.name }}

Check failure on line 49 in src/talk/renderer/TitleBar/components/AppsMenu.vue

View workflow job for this annotation

GitHub Actions / NPM typecheck

Property 'name' does not exist on type 'never'.
</NcActionLink>
</NcActions>
</template>

<style scoped>
.action-icon-wrapper {
width: var(--default-clickable-area);
height: var(--default-clickable-area);
display: flex;
align-items: center;
justify-content: center;
}

.app-icon {
max-width: 20px;
max-height: 20px;
filter: var(--background-invert-if-bright);
}
</style>
Loading