2020-01-14 10:06:14 +02:00
|
|
|
<template>
|
2022-10-17 22:11:07 +03:00
|
|
|
<div class="EmojiReactions">
|
2020-07-16 17:42:16 +03:00
|
|
|
<UserListPopover
|
2020-01-26 15:45:12 +02:00
|
|
|
v-for="(reaction) in emojiReactions"
|
2022-12-18 22:04:58 +03:00
|
|
|
:key="reaction.url || reaction.name"
|
2020-07-16 17:42:16 +03:00
|
|
|
:users="accountsForEmoji[reaction.name]"
|
2020-01-14 10:06:14 +02:00
|
|
|
>
|
2020-02-11 12:24:51 +00:00
|
|
|
<button
|
2020-11-24 12:32:42 +02:00
|
|
|
class="emoji-reaction btn button-default"
|
2022-10-17 22:11:07 +03:00
|
|
|
:class="{ '-picked-reaction': reactedWith(reaction.name), 'not-clickable': !loggedIn }"
|
2020-02-11 12:24:51 +00:00
|
|
|
@click="emojiOnClick(reaction.name, $event)"
|
|
|
|
@mouseenter="fetchEmojiReactionsByIfMissing()"
|
|
|
|
>
|
2022-12-18 22:04:58 +03:00
|
|
|
<span
|
|
|
|
class="reaction-emoji"
|
|
|
|
>
|
|
|
|
<img
|
2023-03-17 23:30:46 +03:00
|
|
|
v-if="reaction.url"
|
2022-12-18 22:04:58 +03:00
|
|
|
:src="reaction.url"
|
|
|
|
:title="reaction.name"
|
|
|
|
class="reaction-emoji-content"
|
|
|
|
width="1em"
|
|
|
|
>
|
2023-03-17 23:30:46 +03:00
|
|
|
<span
|
|
|
|
v-else
|
|
|
|
class="reaction-emoji reaction-emoji-content"
|
|
|
|
>{{ reaction.name }}</span>
|
2022-12-18 22:04:58 +03:00
|
|
|
</span>
|
2020-02-11 12:24:51 +00:00
|
|
|
<span>{{ reaction.count }}</span>
|
|
|
|
</button>
|
2020-07-16 17:42:16 +03:00
|
|
|
</UserListPopover>
|
2020-02-11 12:24:51 +00:00
|
|
|
<a
|
2020-02-28 16:39:47 +00:00
|
|
|
v-if="tooManyReactions"
|
|
|
|
class="emoji-reaction-expand faint"
|
|
|
|
href="javascript:void(0)"
|
|
|
|
@click="toggleShowAll"
|
|
|
|
>
|
|
|
|
{{ showAll ? $t('general.show_less') : showMoreString }}
|
|
|
|
</a>
|
2020-01-14 10:06:14 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-07-31 12:35:48 +03:00
|
|
|
<script src="./emoji_reactions.js"></script>
|
2020-01-14 10:06:14 +02:00
|
|
|
<style lang="scss">
|
2023-01-09 13:02:16 -05:00
|
|
|
@import "../../variables";
|
2020-01-14 10:06:14 +02:00
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
.EmojiReactions {
|
2020-01-14 10:06:14 +02:00
|
|
|
display: flex;
|
|
|
|
margin-top: 0.25em;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
2023-03-17 23:30:46 +03:00
|
|
|
--emoji-size: calc(1.25em * var(--emojiReactionsScale, 1));
|
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
.emoji-reaction {
|
|
|
|
padding: 0 0.5em;
|
|
|
|
margin-right: 0.5em;
|
|
|
|
margin-top: 0.5em;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
box-sizing: border-box;
|
2020-02-11 12:24:51 +00:00
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
.reaction-emoji {
|
2023-03-17 23:30:46 +03:00
|
|
|
width: var(--emoji-size);
|
|
|
|
height: var(--emoji-size);
|
2022-10-17 22:11:07 +03:00
|
|
|
margin-right: 0.25em;
|
2023-03-17 23:30:46 +03:00
|
|
|
line-height: var(--emoji-size);
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2022-10-17 22:11:07 +03:00
|
|
|
}
|
|
|
|
|
2022-12-18 22:04:58 +03:00
|
|
|
.reaction-emoji-content {
|
2023-03-17 23:30:46 +03:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
2022-12-18 22:04:58 +03:00
|
|
|
width: auto;
|
|
|
|
height: auto;
|
2023-03-17 23:30:46 +03:00
|
|
|
line-height: inherit;
|
2022-12-18 22:04:58 +03:00
|
|
|
overflow: hidden;
|
2023-03-17 23:30:46 +03:00
|
|
|
font-size: calc(var(--emoji-size) * 0.8);
|
|
|
|
margin: 0;
|
2022-12-18 22:04:58 +03:00
|
|
|
}
|
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.not-clickable {
|
|
|
|
cursor: default;
|
2023-01-09 13:02:16 -05:00
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
&:hover {
|
|
|
|
box-shadow: $fallback--buttonShadow;
|
|
|
|
box-shadow: var(--buttonShadow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.-picked-reaction {
|
|
|
|
border: 1px solid var(--accent, $fallback--link);
|
|
|
|
margin-left: -1px; // offset the border, can't use inset shadows either
|
|
|
|
margin-right: calc(0.5em - 1px);
|
2020-02-11 12:24:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
.emoji-reaction-expand {
|
|
|
|
padding: 0 0.5em;
|
|
|
|
margin-right: 0.5em;
|
|
|
|
margin-top: 0.5em;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2023-01-09 13:02:16 -05:00
|
|
|
|
2022-10-17 22:11:07 +03:00
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
2020-02-11 12:24:51 +00:00
|
|
|
}
|
2020-02-17 22:28:14 +02:00
|
|
|
}
|
2020-01-14 10:06:14 +02:00
|
|
|
</style>
|