Skip to content

Commit

Permalink
Add a red camera icon for conversations with an ongoing call
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Feb 7, 2020
1 parent 9d44f8d commit 9aee8d7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
5 changes: 5 additions & 0 deletions css/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
@include icon-color('star-dark', 'actions', 'FC0', 1, true);
}

.icon-active-call {
/* Show red camera icon for ongoing calls. */
@include icon-color('video', 'actions', 'E9322D', 1, true);
}

.icon-delete-critical {
@include icon-color('delete', 'actions', $color-error, 1, true);
&:hover,
Expand Down
26 changes: 22 additions & 4 deletions src/components/ConversationIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@
:user="item.name"
:display-name="item.displayName"
class="conversation-icon__avatar" />
<div v-if="showCall"
class="overlap-icon">
<span class="icon icon-active-call" />
<span class="hidden-visually">{{ t('spreed', 'Call in progress') }}</span>
</div>
<div v-if="showFavorite"
class="favorite-mark">
class="overlap-icon">
<span class="icon icon-favorite" />
<span class="hidden-visually">{{ t('spreed', 'Favorite') }}</span>
</div>
Expand All @@ -54,6 +59,10 @@ export default {
type: Boolean,
default: true,
},
hideCall: {
type: Boolean,
default: true,
},
item: {
type: Object,
default: function() {
Expand All @@ -67,6 +76,9 @@ export default {
},
},
computed: {
showCall() {
return !this.hideCall && this.item.hasCall
},
showFavorite() {
return !this.hideFavorite && this.item.isFavorite
},
Expand Down Expand Up @@ -98,7 +110,7 @@ $icon-size: 44px;
width: $icon-size;
height: $icon-size;

.icon:not(.icon-favorite) {
.avatar.icon {
width: $icon-size;
height: $icon-size;
line-height: $icon-size;
Expand All @@ -108,17 +120,17 @@ $icon-size: 44px;
&.icon-changelog {
background-size: $icon-size;
}

&.icon-public,
&.icon-contacts,
&.icon-password,
&.icon-file,
&.icon-mail {
background-size: $icon-size / 2;
}

}

.favorite-mark {
.overlap-icon {
position: absolute;
top: 6px;
left: $icon-size - 6px;
Expand All @@ -129,6 +141,12 @@ $icon-size: 44px;
vertical-align: middle;
background-image: var(--icon-star-dark-FC0);
}

.icon-active-call {
display: inline-block;
vertical-align: middle;
background-image: var(--icon-video-E9322D);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<template v-slot:icon>
<ConversationIcon
:item="item"
:hide-favorite="false" />
:hide-favorite="false"
:hide-call="false" />
</template>
<template v-slot:subtitle>
<strong v-if="item.unreadMessages">
Expand Down

0 comments on commit 9aee8d7

Please sign in to comment.