-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Pinning): Added message pinning
- Loading branch information
RetroPronghorn
committed
Oct 1, 2021
1 parent
303c75b
commit accad2c
Showing
13 changed files
with
261 additions
and
6 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
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 |
---|---|---|
@@ -1,17 +1,27 @@ | ||
<div class="is-message" @contextmenu="contextMenu"> | ||
<div @mouseenter="mouseOver" | ||
:class="`message-container ${messageHover ? 'message-hover' : '' }`"> | ||
<TailoredMessagingMessageActions v-if="messageHover" :setReplyChatbarContent="setReplyChatbarContent" | ||
:class="`message-container ${messageHover ? 'message-hover' : '' } ${message.pinned ? 'pinned-message' : ''}`"> | ||
<div v-if="message.pinned" class="pinned-badge"> | ||
<font-awesome-icon :icon="['far', 'thumbtack']" /> | ||
Pinned | ||
</div> | ||
<div v-if="hideActions" class="inline-meta"> | ||
<UiUsername :username="from" | ||
:badge="$mock.users.filter(u => u.name === from)[0].badge" /> | ||
<TypographyText :text="$dayjs(message.at).from()" /> | ||
</div> | ||
<TailoredMessagingMessageActions v-if="messageHover && !hideActions" :setReplyChatbarContent="setReplyChatbarContent" | ||
:emojiReaction="emojiReaction" /> | ||
<VueMarkdown v-if="message.type === 'text'" :source="message.payload" class="markdown" /> | ||
<UiImage v-else-if="message.type === 'image'" :source="message.payload.url" alt="" /> | ||
<UiEmbedsVideoPlayer v-else-if="message.type === 'video'" :data="message.payload" /> | ||
<UiEmbedsAudioPlayer v-else-if="message.type === 'audio'" :data="message.payload" /> | ||
<UiEmbedsFile v-else-if="message.type === 'file'" :data="message.payload" /> | ||
<TailoredMessagingMessageReactions | ||
v-if="!hideActions && hasReactions" | ||
:message="this.$props.message" | ||
:group="this.$props.group" | ||
:key="`${this.$props.message.id}-${this.$props.message.reactions ? this.$props.message.reactions.length : 0}`" /> | ||
:key="`${this.$props.message.id}-${hasReactions ? this.$props.message.reactions.length : 0}`" /> | ||
</div> | ||
<TailoredMessagingMessageReply :message="message" :group="group" /> | ||
<TailoredMessagingMessageReply :message="message" :group="group" v-if="!hideActions"/> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div id="pinned-messages" v-click-outside="() => { | ||
$store.commit('togglePinned', false) | ||
}"> | ||
<div class="pinned-wrap"> | ||
<UiScroll | ||
verticalScroll | ||
scrollbarVisibility="scroll" | ||
enableWrap> | ||
<div class="header"> | ||
<font-awesome-icon :icon="['far', 'thumbtack']" /> | ||
<TypographySubtitle :size="6" text="Pinned Messages" /> | ||
</div> | ||
<div class="filters"> | ||
<span class="filter active-filter">New</span> | ||
<span class="filter">Old</span> | ||
<span class="filter">Files</span> | ||
</div> | ||
<UiHorizontalRule /> | ||
<div v-for="message in $mock.pinnedMessages" class="wrap"> | ||
<TailoredMessagingMessage | ||
hide-actions | ||
:message="message" | ||
:from="$mock.users.filter(u => u.address === message.from)[0].name" | ||
:key="message.id" /> | ||
<InteractablesButton size="small" type="dark" text="Jump" /> | ||
<font-awesome-icon :icon="['far', 'times']" /> | ||
</div> | ||
</UiScroll> | ||
</div> | ||
</div> |
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,94 @@ | ||
#pinned-messages { | ||
position: absolute; | ||
display: inline-flex; | ||
top: calc(@statusbar-height - @light-spacing); | ||
width: 22rem; | ||
background: @semitransparent-light-gradient; | ||
border-radius: @corner-rounding; | ||
border: @light-border; | ||
backdrop-filter: @blur; | ||
max-height: 50vh; | ||
overflow: hidden; | ||
|
||
.pinned-wrap { | ||
overflow: hidden; | ||
} | ||
img { | ||
max-width: 100%; | ||
} | ||
|
||
.header { | ||
.subtitle { | ||
font-size: @micro-text-size !important; | ||
font-family: @primary-font; | ||
} | ||
font-size: @micro-text-size !important; | ||
font-family: @primary-font; | ||
} | ||
|
||
hr { | ||
margin-top: 0; | ||
} | ||
|
||
.filters { | ||
text-align: right; | ||
} | ||
.filter { | ||
font-size: @text-size; | ||
display: inline-block; | ||
justify-self: flex-end; | ||
opacity: 0.75; | ||
cursor: pointer; | ||
} | ||
|
||
.active-filter { | ||
opacity: 1; | ||
} | ||
|
||
.scroll-area { | ||
max-height: 100%; | ||
padding: @light-spacing @light-spacing; | ||
padding-right: @normal-spacing; | ||
|
||
.is-message { | ||
margin-bottom: 0; | ||
} | ||
.wrap { | ||
position: relative; | ||
padding: 0 @light-spacing; | ||
padding-bottom: @light-spacing; | ||
margin-bottom: @light-spacing; | ||
background: @semitransparent-lighter-gradient; | ||
border-radius: @corner-rounding; | ||
border: @light-border; | ||
|
||
.button { | ||
padding: 0 @light-spacing; | ||
height: unset; | ||
float: right; | ||
position: absolute; | ||
top: @light-spacing; | ||
right: @light-spacing; | ||
} | ||
.button.is-dark { | ||
right: 2rem; | ||
} | ||
.fa-times { | ||
position: absolute; | ||
right: @light-spacing; | ||
top: @light-spacing; | ||
font-size: @text-size; | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media only screen and (max-width: @mobile-breakpoint) { | ||
#pinned-messages { | ||
width: unset; | ||
left: @light-spacing; | ||
right: @light-spacing; | ||
max-height: 75vh; | ||
} | ||
} |
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,7 @@ | ||
<template src="./Pinned.html"></template> | ||
<script lang="ts"> | ||
import Vue from 'vue' | ||
export default Vue.extend({}) | ||
</script> | ||
<style lang="less" src="./Pinned.less"></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
Oops, something went wrong.