Skip to content

Commit

Permalink
fix(TopBar): migrate to NcPopover
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad authored and Antreesy committed Sep 25, 2024
1 parent 7cf8518 commit 6541eda
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@
:class="{'description__in-chat' : !isInCall }">
{{ statusMessage }}
</p>
<template v-if="conversation.description">
<p v-tooltip.bottom="{
content: renderedDescription,
delay: { show: 500, hide: 500 },
autoHide: false,
html: true,
}"
class="description"
:class="{'description__in-chat' : !isInCall }">
{{ conversation.description }}
</p>
</template>
<NcPopover v-if="conversation.description"
:focus-trap="false"
:delay="500"
:boundary="boundaryElement"
:popper-triggers="['hover']"
:triggers="['hover']">
<template #trigger="{ attrs }">
<p v-bind="attrs"
class="description"
:class="{'description__in-chat' : !isInCall }">
{{ conversation.description }}
</p>
</template>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="description__popover" v-html="renderedDescription" />
</NcPopover>
</div>
</a>

Expand Down Expand Up @@ -123,6 +127,7 @@ import { t, n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcPopover from '@nextcloud/vue/dist/Components/NcPopover.js'
import { useIsMobile } from '@nextcloud/vue/dist/Composables/useIsMobile.js'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
import richEditor from '@nextcloud/vue/dist/Mixins/richEditor.js'
Expand All @@ -138,7 +143,6 @@ import ConversationIcon from '../ConversationIcon.vue'
import { useGetParticipants } from '../../composables/useGetParticipants.js'
import { AVATAR, CONVERSATION } from '../../constants.js'
import BrowserStorage from '../../services/BrowserStorage.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { useChatExtrasStore } from '../../stores/chatExtras.js'
import { useSidebarStore } from '../../stores/sidebar.js'
Expand All @@ -160,6 +164,7 @@ export default {
ConversationIcon,
TopBarMediaControls,
NcButton,
NcPopover,
TopBarMenu,
TasksCounter,
ReactionMenu,
Expand Down Expand Up @@ -202,6 +207,7 @@ export default {
data: () => {
return {
showBreakoutRoomsEditor: false,
boundaryElement: document.querySelector('.main-view'),
}
},
Expand Down Expand Up @@ -448,6 +454,12 @@ export default {
}
}
.description__popover {
padding: var(--default-grid-baseline);
width: fit-content;
max-width: 50em;
}
.icon {
display: flex;
}
Expand Down

0 comments on commit 6541eda

Please sign in to comment.