Skip to content

Commit

Permalink
feat: Hide activity reaction based on activity extension option - EXO…
Browse files Browse the repository at this point in the history
…-72747 - Meeds-io/MIPs#161 (#4160)

Hide activity reaction based on activity extension option
  • Loading branch information
hakermi committed Nov 8, 2024
1 parent 815bc0d commit 925bc1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
:activity-types="activityTypes"
:activity-type-extension="activityTypeExtension" />
<activity-comments-preview
v-if="!extendedComponent.overrideComments"
v-if="activityReactionEnabled && !extendedComponent.overrideComments"
:activity="activity"
:comment-types="commentTypes"
:comment-actions="commentActions"
Expand Down Expand Up @@ -75,6 +75,7 @@
:activity-types="activityTypes"
:activity-type-extension="activityTypeExtension" />
<activity-comments-preview
v-if="activityReactionEnabled"
:activity="activity"
:comment-types="commentTypes"
:comment-actions="commentActions"
Expand Down Expand Up @@ -211,6 +212,9 @@ export default {
},
showLastComments() {
return this.hasNewComment || this.isActivityDetail;
},
activityReactionEnabled() {
return this.activityTypeExtension?.reactionEnabled?.(this.activity) ?? true;
}
},
watch: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:activity-types="activityTypes"
class="no-border-bottom mb-0 pa-3" />
<div
v-if="activityReactionEnabled"
:class="actionBarBorderClass"
class="mb-0 d-flex flex-wrap flex-column flex-lg-row align-lg-center">
<activity-reactions
Expand Down Expand Up @@ -66,6 +67,9 @@ export default {
isDesktop() {
return this.$vuetify && this.$vuetify.breakpoint && this.$vuetify.breakpoint.name !== 'xs' && this.$vuetify.breakpoint.name !== 'sm' && this.$vuetify.breakpoint.name !== 'md';
},
activityReactionEnabled() {
return this.activityTypeExtension?.reactionEnabled?.(this.activity) ?? true;
}
},
created() {
this.$root.$on('activity-comment-created', this.checkCommentsSize);
Expand Down

0 comments on commit 925bc1a

Please sign in to comment.