diff --git a/src/webviews/apps/plus/graph/GraphWrapper.tsx b/src/webviews/apps/plus/graph/GraphWrapper.tsx index 4b1d141..8967feb 100644 --- a/src/webviews/apps/plus/graph/GraphWrapper.tsx +++ b/src/webviews/apps/plus/graph/GraphWrapper.tsx @@ -5,7 +5,7 @@ import type { GraphPlatform, GraphRef, GraphRefGroup, - GraphRefOptData, + GraphRefOptData, GraphRow, OnFormatCommitDateTime, } from '@gitkraken/gitkraken-components'; @@ -510,7 +510,10 @@ export function GraphWrapper({ onRefsVisibilityChange?.(refs, visible); }; - const handleOnDoubleClickRef = (event: React.MouseEvent, refGroup: GraphRefGroup) => { + const handleOnDoubleClickRef = ( + event: React.MouseEvent, + refGroup: GraphRefGroup, + ) => { if (refGroup.length > 0) { onDoubleClickRef?.(refGroup[0]); } @@ -535,18 +538,46 @@ export function GraphWrapper({ onDismissBanner?.('trial'); }; - const renderTrialDays = () => { - if ( - !subscription || - ![SubscriptionState.FreeInPreviewTrial, SubscriptionState.FreePlusInTrial].includes(subscription.state) - ) { - return; + const renderAccountState = () => { + if (!subscription) return; + + let label = subscription.plan.effective.name; + let isPro = true; + let subText; + switch (subscription.state) { + case SubscriptionState.Free: + case SubscriptionState.FreePreviewTrialExpired: + case SubscriptionState.FreePlusTrialExpired: + isPro = false; + label = 'GitLens Free'; + break; + case SubscriptionState.FreeInPreviewTrial: + case SubscriptionState.FreePlusInTrial: { + const days = getSubscriptionTimeRemaining(subscription, 'days') ?? 0; + label = 'GitLens Pro (Trial)'; + subText = `${days < 1 ? '< 1 day' : pluralize('day', days)} left`; + break; + } + case SubscriptionState.VerificationRequired: + isPro = false; + label = `${label} (Unverified)`; + break; } - const days = getSubscriptionTimeRemaining(subscription, 'days') ?? 0; return ( - GitLens+ Trial ({days < 1 ? '< 1 day' : pluralize('day', days)} left) + + {label} + {subText && ( + <> +    + {subText} + + )} + ); }; @@ -853,8 +884,7 @@ export function GraphWrapper({ )}
- {renderTrialDays()} - Preview + {renderAccountState()}