Skip to content

Commit

Permalink
Merge pull request #205 from webitel/fix/icon-badges
Browse files Browse the repository at this point in the history
24.02.46: fixed badge icons [WTEL-3798]
  • Loading branch information
dlohvinov authored Feb 6, 2024
2 parents 9964106 + 7ea1afe commit fe76e52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webitel/ui-sdk",
"version": "24.2.44",
"version": "24.2.46",
"private": false,
"scripts": {
"dev": "vite",
Expand Down
19 changes: 16 additions & 3 deletions src/components/wt-badge/wt-badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
<aside
class="wt-badge"
:class="{ 'wt-badge--outside': outside }"
:style="{ background: iconBadge ? `url(${showIconBadge})` : `var(--${colorVariable})` }"
/>
:style="{ background: `var(--${colorVariable})` }"
>
<img
class="wt-badge__pic"
v-if="iconBadgePic"
:src="iconBadgePic"
:alt="iconBadge"
>
</aside>
</template>

<script>
Expand All @@ -29,7 +36,7 @@ export default {
},
},
computed: {
showIconBadge() {
iconBadgePic() {
switch (this.iconBadge) {
case AbstractUserStatus.DND:
return BadgeDnd;
Expand Down Expand Up @@ -62,5 +69,11 @@ export default {
&--outside {
transform: translate(100%, -100%);
}
&__pic {
position: absolute;
width: var(--wt-badge-size);
height: var(--wt-badge-size);
}
}
</style>

0 comments on commit fe76e52

Please sign in to comment.