Skip to content

Commit 18d9de8

Browse files
authored
fix(ui): billing page feedback (#4005)
## Changes - Billing page feeedback - Add back button even if not self-serve yet - Link point to demo or mail, not pricing page - The current plan should not link to anything - Upgrade button in environment picker goes to the billing page (and fix auto focus) - Missing description for old plans (just put something) <!-- Summary by @propel-code-bot --> --- This PR refines the billing page user experience with several UI/UX improvements. Changes include adding back buttons, adjusting link destinations, improving the environment picker behavior, and enhancing plan descriptions for better clarity. **Key Changes:** • Modified current plan card to not be clickable while other plans link to demo/mail • Added buttons for upgrading and downgrading plans with proper messaging • Fixed environment picker auto focus and search behavior • Updated 'Upgrade' button to link to billing page instead of external site • Added descriptions for older plan types **Affected Areas:** • Billing page UI • Environment picker component • Create environment button • Plan definitions *This summary was automatically generated by @propel-code-bot*
1 parent f95a9aa commit 18d9de8

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

packages/shared/lib/services/plans/definitions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const plansList: PlanDefinition[] = [
9292
{
9393
code: 'starter',
9494
title: 'Starter',
95-
description: '',
95+
description: 'Tailored to your scale.',
9696
canUpgrade: false,
9797
canDowngrade: false,
9898
hidden: true,
@@ -109,7 +109,7 @@ export const plansList: PlanDefinition[] = [
109109
{
110110
code: 'scale',
111111
title: 'Scale',
112-
description: '',
112+
description: 'Tailored to your scale.',
113113
canUpgrade: false,
114114
canDowngrade: false,
115115
hidden: true,

packages/webapp/src/components/CreateEnvironmentButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@ export const CreateEnvironmentButton: React.FC = () => {
5353
let tooltipContent: React.ReactNode = null;
5454
if (isMaxEnvironmentsReached) {
5555
tooltipContent = (
56-
<span>
56+
<div>
5757
Max number of environments reached.{' '}
5858
{environment?.plan?.name === 'scale' ? (
5959
<>Contact Nango to add more</>
6060
) : (
6161
<>
62-
<Link to="https://app.withsurface.com/s/cm1zve3340001l503sm0xtvo1" className="underline">
62+
<Link to={`/${env}/team/billing`} className="underline">
6363
Upgrade
6464
</Link>{' '}
6565
to add more
6666
</>
6767
)}
68-
</span>
68+
</div>
6969
);
7070
}
7171

7272
return (
7373
<Dialog open={openDialog} onOpenChange={setOpenDialog}>
74-
<SimpleTooltip tooltipContent={tooltipContent} delay={0} className="text-gray-400" side="bottom">
74+
<SimpleTooltip tooltipContent={tooltipContent} delay={1} className="text-gray-400" side="bottom">
7575
<DialogTrigger className="w-full" asChild>
7676
<Button disabled={!!isMaxEnvironmentsReached} variant={'secondary'} className="w-full justify-center">
7777
{isMaxEnvironmentsReached && <IconLock size={18} stroke={1} />}

packages/webapp/src/components/EnvironmentPicker.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,13 @@ export const EnvironmentPicker: React.FC = () => {
5959
side="bottom"
6060
align="start"
6161
style={{ width: 'var(--radix-popover-trigger-width)' }}
62+
onOpenAutoFocus={(e) => {
63+
if (meta.environments.length < 5) e.preventDefault();
64+
}}
6265
className="bg-grayscale-900 w-full px-0 border-grayscale-700 py-0"
6366
>
6467
<Command>
65-
{meta.environments.length > 5 && (
68+
{meta.environments.length >= 5 && (
6669
<CommandInput
6770
placeholder="Search..."
6871
className="text-white ring-0 focus:ring-0 focus-visible:outline-none border-transparent border-b-grayscale-700 rounded-b-none px-2.5 "

packages/webapp/src/pages/Team/Billing/Show.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,15 @@ const UsageTable: React.FC<{ data: GetUsage['Success'] | undefined; isLoading: b
172172
};
173173

174174
export const PlanCard: React.FC<{ env: string; def: PlanDefinitionList }> = ({ def }) => {
175+
const Comp = def.active ? 'div' : Link;
175176
return (
176-
<Link
177+
<Comp
177178
className={cn(
178179
'flex flex-col gap-4 text-white rounded-lg bg-grayscale-3 py-7 px-6 border border-grayscale-5',
179180
def.active && 'bg-grayscale-1 border-grayscale-7'
180181
)}
181182
target="_blank"
182-
to={'https://nango.dev/pricing'}
183+
to={def.plan.canUpgrade ? 'mailto:upgrade@nango.dev' : 'https://nango.dev/demo'}
183184
// to={def.above && !def.plan.canUpgrade ? 'mailto:upgrade@nango.dev' : ''}
184185
// onClick={onClickPlan}
185186
>
@@ -190,13 +191,10 @@ export const PlanCard: React.FC<{ env: string; def: PlanDefinitionList }> = ({ d
190191
</header>
191192
<div className="text-sm text-grayscale-10">{def.plan.description}</div>
192193
</div>
193-
{/* <footer>
194-
{!def.active && (
195-
<Button variant={'primary'} isLoading={loading}>
196-
{def.plan.cta ? def.plan.cta : def.below ? 'Downgrade Plan' : 'Upgrade plan'}
197-
</Button>
198-
)}
199-
</footer> */}
200-
</Link>
194+
<footer>
195+
{!def.active && def.isUpgrade && <Button variant={'primary'}>{def.plan.cta ? def.plan.cta : 'Upgrade plan'}</Button>}
196+
{!def.active && def.isDowngrade && <Button variant={'primary'}>Contact us to downgrade</Button>}
197+
</footer>
198+
</Comp>
201199
);
202200
};

0 commit comments

Comments
 (0)