Wolfgang Huß 558e964c83
feat(webapp): add reason and call to action on post view page if commenting is disabled (#8958)
Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
2025-10-10 19:21:07 +02:00

65 lines
1.4 KiB
Vue

<template>
<ds-space centered margin="xxx-small">
<ds-space margin-bottom="small" />
<ds-heading tag="h4">
{{ $t('contribution.comment.commenting-disabled.no-group-member.reason') }}
<nuxt-link
:to="{
name: 'groups-id-slug',
params: { slug: group.slug, id: group.id },
}"
>
{{ group.name }}
</nuxt-link>
</ds-heading>
<ds-text>
{{ $t('contribution.comment.commenting-disabled.no-group-member.call-to-action') }}
</ds-text>
<join-leave-button
:group="group"
:userId="$store.getters['auth/user'].id"
:isMember="isGroupMember"
:isNonePendingMember="isGroupMemberNonePending"
:filled="true"
@update="updateJoinLeave"
/>
</ds-space>
</template>
<script>
import JoinLeaveButton from '~/components/Button/JoinLeaveButton'
export default {
name: 'CtaJoinLeaveGroup',
components: {
JoinLeaveButton,
},
props: {
group: {
type: Object,
require: true,
},
},
computed: {
isGroupMember() {
return this.group ? !!this.group.myRole : false
},
isGroupMemberNonePending() {
return this.group ? ['usual', 'admin', 'owner'].includes(this.group.myRole) : false
},
},
methods: {
async updateJoinLeave(data) {
this.$emit('update', data)
},
},
}
</script>
<style lang="scss" scoped>
.join-leave-button {
width: auto;
margin: auto !important;
}
</style>