Skip to content

Commit

Permalink
feat: switch focus to screenshare button instead of end call button
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Feb 16, 2024
1 parent 4d89654 commit eda08e9
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 101 deletions.
10 changes: 2 additions & 8 deletions src/components/CallView/shared/LocalAudioControlButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<template>
<NcButton v-shortkey.once="disableKeyboardShortcuts ? null : ['m']"
v-tooltip="audioButtonTooltip"
:type="ncButtonType"
:type="type"
:aria-label="audioButtonAriaLabel"
:class="{ 'no-audio-available': !isAudioAllowed || !model.attributes.audioAvailable }"
@shortkey="toggleAudio"
Expand All @@ -30,7 +30,6 @@
:audio-enabled="showMicrophoneOn"
:current-volume="model.attributes.currentVolume"
:volume-threshold="model.attributes.volumeThreshold"
:primary-color="color"
overlay-muted-color="#888888" />
</template>
</NcButton>
Expand Down Expand Up @@ -70,16 +69,11 @@ export default {
default: OCP.Accessibility.disableKeyboardShortcuts(),
},

ncButtonType: {
type: {
type: String,
default: 'tertiary-no-background',
},

color: {
type: String,
default: 'currentColor',
},

token: {
type: String,
required: true,
Expand Down
13 changes: 4 additions & 9 deletions src/components/CallView/shared/LocalVideoControlButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
<template>
<NcButton v-shortkey.once="disableKeyboardShortcuts ? null : ['v']"
v-tooltip="videoButtonTooltip"
:type="ncButtonType"
:type="type"
:aria-label="videoButtonAriaLabel"
:class="{ 'no-video-available': !isVideoAllowed || !model.attributes.videoAvailable }"
@shortkey="toggleVideo"
@click.stop="toggleVideo">
<template #icon>
<VideoIcon v-if="showVideoOn" :size="20" :fill-color="color" />
<VideoOff v-else :size="20" :fill-color="color" />
<VideoIcon v-if="showVideoOn" :size="20" />
<VideoOff v-else :size="20" />
</template>
</NcButton>
</template>
Expand Down Expand Up @@ -68,16 +68,11 @@ export default {
default: OCP.Accessibility.disableKeyboardShortcuts(),
},

ncButtonType: {
type: {
type: String,
default: 'tertiary-no-background',
},

color: {
type: String,
default: 'currentColor',
},

token: {
type: String,
required: true,
Expand Down
4 changes: 2 additions & 2 deletions src/components/CallView/shared/ViewerOverlayCallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@
:token="token"
:conversation="conversation"
:model="localModel"
nc-button-type="secondary"
type="secondary"
disable-keyboard-shortcuts />
<LocalVideoControlButton class="viewer-overlay__button"
:token="token"
:conversation="conversation"
:model="localModel"
nc-button-type="secondary"
type="secondary"
disable-keyboard-shortcuts />
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions src/components/TopBar/CallButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</NcButton>
<NcButton v-else-if="showLeaveCallButton && !canEndForAll && !isBreakoutRoom"
id="call_button"
type="error"
:type="isScreensharing ? 'tertiary' : 'error'"
:disabled="loading"
@click="leaveCall(false)">
<template #icon>
Expand All @@ -64,7 +64,7 @@
:menu-name="leaveCallCombinedLabel"
force-name
:container="container"
type="error">
:type="isScreensharing ? 'tertiary' : 'error'">
<template #icon>
<VideoOff v-if="!isBreakoutRoom" :size="20" />
<ArrowLeft v-else :size="20" />
Expand Down Expand Up @@ -170,6 +170,11 @@ export default {
type: Boolean,
default: false,
},

isScreensharing: {
type: Boolean,
default: false,
}
},

setup() {
Expand Down Expand Up @@ -446,4 +451,5 @@ export default {
#call_button {
margin: 0 auto;
}

</style>
3 changes: 1 addition & 2 deletions src/components/TopBar/ReactionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
:container="container"
class="reaction">
<template #icon>
<EmoticonOutline :size="20"
fill-color="#ffffff" />
<EmoticonOutline :size="20" />
</template>

<NcActionButtonGroup class="reaction__group"
Expand Down
55 changes: 11 additions & 44 deletions src/components/TopBar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->

<template>
<div class="top-bar" :class="{ 'in-call': isInCall }">
<div class="top-bar" :data-theme-dark="isInCall">
<ConversationIcon :key="conversation.token"
class="conversation-icon"
:offline="isPeerInactive"
Expand Down Expand Up @@ -60,33 +60,28 @@

<!-- Call time -->
<CallTime v-if="isInCall"
:start="conversation.callStartTime"
class="top-bar__button dark-hover" />
:start="conversation.callStartTime" />

<!-- Participants counter -->
<NcButton v-if="isInCall && !isOneToOneConversation && isModeratorOrUser"
:title="participantsInCallAriaLabel"
:aria-label="participantsInCallAriaLabel"
class="top-bar__button dark-hover"
type="tertiary"
@click="openSidebar('participants')">
<template #icon>
<AccountMultiple :size="20"
fill-color="#ffffff" />
<AccountMultiple :size="20" />
</template>
{{ participantsInCall }}
</NcButton>

<!-- Reactions menu -->
<ReactionMenu v-if="hasReactionSupport"
class="top-bar__button dark-hover"
<ReactionMenu v-if="isInCall && hasReactionSupport"
:token="token"
:supported-reactions="supportedReactions"
:local-call-participant-model="localCallParticipantModel" />

<!-- Local media controls -->
<TopBarMediaControls v-if="isInCall"
class="local-media-controls dark-hover"
:token="token"
:model="localMediaModel"
:show-actions="!isSidebar"
Expand All @@ -95,21 +90,19 @@

<!-- TopBar menu -->
<TopBarMenu :token="token"
class="top-bar__button dark-hover"
:show-actions="!isSidebar"
:is-sidebar="isSidebar"
:model="localMediaModel"
@open-breakout-rooms-editor="showBreakoutRoomsEditor = true" />

<CallButton class="top-bar__button" />
<CallButton :is-screensharing="!!localMediaModel.attributes.localScreen" />

<!-- sidebar toggle -->
<template v-if="showOpenSidebarButton">
<!-- in chat: open last tab -->
<NcButton v-if="!isInCall"
:aria-label="t('spreed', 'Open sidebar')"
:title="t('spreed', 'Open sidebar')"
class="top-bar__button dark-hover"
close-after-click="true"
type="tertiary"
@click="openSidebar">
Expand All @@ -122,12 +115,11 @@
<NcButton v-else
:aria-label="t('spreed', 'Open chat')"
:title="t('spreed', 'Open chat')"
class="top-bar__button chat-button dark-hover"
class="chat-button"
type="tertiary"
@click="openSidebar('chat')">
<template #icon>
<MessageText :size="20"
fill-color="#ffffff" />
<MessageText :size="20" />
<NcCounterBubble v-if="unreadMessagesCounter > 0"
class="chat-button__unread-messages-counter"
:type="hasUnreadMentions ? 'highlighted' : 'outlined'">
Expand Down Expand Up @@ -406,7 +398,9 @@ export default {
<style lang="scss" scoped>
.top-bar {
display: flex;
flex-wrap: wrap;
z-index: 10;
gap: 3px;
justify-content: flex-end;
padding: 8px;
background-color: var(--color-main-background);
Expand All @@ -416,40 +410,13 @@ export default {
margin-right: var(--default-clickable-area);
}

&.in-call {
&[data-theme-dark="true"] {
right: 0;
border: none;
position: absolute;
top: 0;
left:0;
left: 0;
background-color: transparent;
display: flex;
flex-wrap: wrap;
& * {
color: #fff;
}

:deep(button.dark-hover:hover),
.dark-hover :deep(button:hover),
.dark-hover :deep(.action-item--open button),
:deep(.action-item--open.dark-hover button) {
background-color: rgba(0, 0, 0, 0.2);
}
}

&__button {
margin: 0 2px;
align-self: center;
display: flex;
align-items: center;
white-space: nowrap;
.icon {
margin-right: 4px !important;
}

&__force-white {
color: white;
}
}

.chat-button {
Expand Down
Loading

0 comments on commit eda08e9

Please sign in to comment.