Merge pull request #13916 from overleaf/bg-managed-users-hide-leave-group-action
managed users hide leave group action GitOrigin-RevId: 160e31e6935cd3737356714020e057f8c1acc5b8
This commit is contained in:
+18
-5
@@ -4,6 +4,7 @@ import { MemberGroupSubscription } from '../../../../../../types/subscription/da
|
||||
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
||||
import { LEAVE_GROUP_MODAL_ID } from './leave-group-modal'
|
||||
import PremiumFeaturesLink from './premium-features-link'
|
||||
import getMeta from '../../../../utils/meta.js'
|
||||
|
||||
type GroupSubscriptionMembershipProps = {
|
||||
subscription: MemberGroupSubscription
|
||||
@@ -23,6 +24,11 @@ export default function GroupSubscriptionMembership({
|
||||
setLeavingGroupId(subscription._id)
|
||||
}
|
||||
|
||||
// Hide leave group button for managed users
|
||||
const hideLeaveButton = getMeta(
|
||||
'ol-cannot-leave-group-subscription'
|
||||
) as boolean
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>
|
||||
@@ -43,11 +49,18 @@ export default function GroupSubscriptionMembership({
|
||||
</p>
|
||||
)}
|
||||
{isLast && <PremiumFeaturesLink />}
|
||||
<span>
|
||||
<Button bsStyle="danger" onClick={leaveGroup}>
|
||||
{t('leave_group')}
|
||||
</Button>
|
||||
</span>
|
||||
{hideLeaveButton ? (
|
||||
<span>
|
||||
{' '}
|
||||
{t('need_to_leave')} {t('contact_group_admin')}{' '}
|
||||
</span>
|
||||
) : (
|
||||
<span>
|
||||
<Button bsStyle="danger" onClick={leaveGroup}>
|
||||
{t('leave_group')}
|
||||
</Button>
|
||||
</span>
|
||||
)}
|
||||
<hr />
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user