-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
175 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<div | ||
:class="{'event-badge--visited': isVisited}" | ||
class="event-badge" | ||
> | ||
<span class="event-badge__count"> | ||
{{ eventCount | abbreviateNumber }} | ||
</span> | ||
<div v-if="affectedUsersCount !== null && affectedUsersCount > 0" class="event-badge__affected-users"> | ||
<Icon symbol="user-small" class="event-badge__affected-users-icon"/> | ||
{{ affectedUsersCount | abbreviateNumber }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Icon from '../utils/Icon.vue'; | ||
export default { | ||
name: 'EventBadge', | ||
components: { | ||
Icon, | ||
}, | ||
props: { | ||
/** | ||
* @type {number} - number of events | ||
*/ | ||
eventCount: { | ||
type: Number, | ||
required: true, | ||
}, | ||
/** | ||
* @type {number | null} - event affected users count, null for old events, when affected users count was not calculated | ||
*/ | ||
affectedUsersCount: { | ||
type: [Number, null], | ||
default: null, | ||
}, | ||
/** | ||
* @type {boolean} - true if user visited current event | ||
*/ | ||
isVisited: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
.event-badge { | ||
display: inline-flex; | ||
height: 20px; | ||
padding: 5px 5px; | ||
color: var(--color-text-main); | ||
line-height: 9px; | ||
white-space: nowrap; | ||
align-items: center; | ||
background-color: var(--color-indicator-medium); | ||
border-radius: 6px; | ||
&__affected-users { | ||
font-size: 10px; | ||
margin-left: 10px; | ||
display: flex; | ||
align-items: center; | ||
&-icon { | ||
display: block; | ||
width: 10px; | ||
height: 10px; | ||
margin-right: 2px; | ||
} | ||
} | ||
&__count { | ||
font-size: 12px; | ||
font-weight: bold; | ||
} | ||
&--visited { | ||
color: var(--color-text-second); | ||
background-color: var(--color-bg-main); | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.