Skip to content

Commit

Permalink
refactor(TopBar): get rid of duplicated properties
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Mar 5, 2024
1 parent 878a767 commit 2abb696
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
3 changes: 1 addition & 2 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@
class="local-media-controls dark-hover"
:token="token"
:model="localMediaModel"
:show-actions="!isSidebar"
:screen-sharing-button-hidden="isSidebar"
:is-sidebar="isSidebar"
:local-call-participant-model="localCallParticipantModel" />

<!-- TopBar menu -->
Expand Down
25 changes: 6 additions & 19 deletions src/components/TopBar/TopBarMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
:model="model"
color="#ffffff" />

<NcButton v-if="isVirtualBackgroundAvailable && !showActions"
<NcButton v-if="isVirtualBackgroundAvailable && isSidebar"
v-tooltip="toggleVirtualBackgroundButtonLabel"
type="tertiary-no-background"
:aria-label="toggleVirtualBackgroundButtonLabel"
Expand All @@ -82,7 +82,7 @@
</template>
</NcButton>

<NcActions v-if="!screenSharingButtonHidden && model.attributes.localScreen"
<NcActions v-if="!isSidebar && model.attributes.localScreen"
id="screensharing-button"
v-tooltip="screenSharingButtonTooltip"
type="tertiary-no-background"
Expand All @@ -92,11 +92,9 @@
:boundaries-element="boundaryElement"
:container="container"
:open.sync="screenSharingMenuOpen">
<!-- Actions button icon -->
<template #icon>
<CancelPresentation :size="20" fill-color="#ffffff" />
</template>
<!-- /Actions button icon -->
<!-- Actions -->
<NcActionButton close-after-click @click="showScreen">
<template #icon>
Expand All @@ -111,7 +109,7 @@
{{ t('spreed', 'Stop screensharing') }}
</NcActionButton>
</NcActions>
<NcButton v-else-if="!screenSharingButtonHidden"
<NcButton v-else-if="!isSidebar"
v-tooltip="screenSharingButtonTooltip"
type="tertiary-no-background"
@click.stop="toggleScreenSharingMenu">
Expand Down Expand Up @@ -185,27 +183,16 @@ export default {
type: Object,
required: true,
},
screenSharingButtonHidden: {
type: Boolean,
default: false,
},
showActions: {
type: Boolean,
default: true,
},
/**
* In the sidebar the conversation settings are hidden
*/
isSidebar: {
type: Boolean,
default: false,
},
},
setup() {
const isInCall = useIsInCall()
return { isInCall }
return {
isInCall: useIsInCall(),
}
},
data() {
Expand Down

0 comments on commit 2abb696

Please sign in to comment.