diff options
| author | Ilja <ilja@ilja.space> | 2022-02-26 02:08:13 +0100 |
|---|---|---|
| committer | Ilja <ilja@ilja.space> | 2022-02-26 02:08:13 +0100 |
| commit | d0c4ad22cd5a93f69c689f3c8c75546c35861740 (patch) | |
| tree | 15b535925b4ce0ea851e27ace32afde9db6a29c1 /src/components/mentions_line/mentions_line.js | |
| parent | 819b76026101ddc0363118f240049a0019ebb4d6 (diff) | |
| parent | 0300db6c6356c536694a9fcbb32a52abc81c52d5 (diff) | |
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into feat/report-notification
Diffstat (limited to 'src/components/mentions_line/mentions_line.js')
| -rw-r--r-- | src/components/mentions_line/mentions_line.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/components/mentions_line/mentions_line.js b/src/components/mentions_line/mentions_line.js new file mode 100644 index 00000000..a4a0c724 --- /dev/null +++ b/src/components/mentions_line/mentions_line.js @@ -0,0 +1,37 @@ +import MentionLink from 'src/components/mention_link/mention_link.vue' +import { mapGetters } from 'vuex' + +export const MENTIONS_LIMIT = 5 + +const MentionsLine = { + name: 'MentionsLine', + props: { + mentions: { + required: true, + type: Array + } + }, + data: () => ({ expanded: false }), + components: { + MentionLink + }, + computed: { + mentionsComputed () { + return this.mentions.slice(0, MENTIONS_LIMIT) + }, + extraMentions () { + return this.mentions.slice(MENTIONS_LIMIT) + }, + manyMentions () { + return this.extraMentions.length > 0 + }, + ...mapGetters(['mergedConfig']) + }, + methods: { + toggleShowMore () { + this.expanded = !this.expanded + } + } +} + +export default MentionsLine |
