mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 13:49:00 +02:00
Merge pull request #26806 from overleaf/rh-friendly-group-name-dash
Use friendly group plan name in project dash tooltip GitOrigin-RevId: bb4e763c2fe0b8cb5d2f8ac0adf2a8cd956ddd0c
This commit is contained in:
+15
-2
@@ -8,6 +8,18 @@ type GroupPlanProps = Pick<
|
||||
'subscription' | 'plan' | 'remainingTrialDays' | 'featuresPageURL'
|
||||
>
|
||||
|
||||
function getFriendlyPlanName(planName: string): string {
|
||||
if (planName.toLowerCase().includes('professional')) {
|
||||
return 'Professional'
|
||||
} else if (planName.toLowerCase().includes('collaborator')) {
|
||||
return 'Standard'
|
||||
}
|
||||
// fallback on plan name
|
||||
else {
|
||||
return planName
|
||||
}
|
||||
}
|
||||
|
||||
function GroupPlan({
|
||||
featuresPageURL,
|
||||
subscription,
|
||||
@@ -16,6 +28,7 @@ function GroupPlan({
|
||||
}: GroupPlanProps) {
|
||||
const { t } = useTranslation()
|
||||
const planNameComponent = <strong translate="no" />
|
||||
const friendlyPlanName = getFriendlyPlanName(plan.name)
|
||||
const currentPlanLabel =
|
||||
remainingTrialDays >= 0 ? (
|
||||
remainingTrialDays === 1 ? (
|
||||
@@ -43,10 +56,10 @@ function GroupPlan({
|
||||
description={
|
||||
subscription.teamName != null
|
||||
? t('group_plan_with_name_tooltip', {
|
||||
plan: plan.name,
|
||||
plan: friendlyPlanName,
|
||||
groupName: subscription.teamName,
|
||||
})
|
||||
: t('group_plan_tooltip', { plan: plan.name })
|
||||
: t('group_plan_tooltip', { plan: friendlyPlanName })
|
||||
}
|
||||
id="group-plan"
|
||||
overlayProps={{ placement: 'bottom' }}
|
||||
|
||||
Reference in New Issue
Block a user