Skip to content

fix(ui): billing page feedback #4005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/shared/lib/services/plans/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const plansList: PlanDefinition[] = [
{
code: 'starter',
title: 'Starter',
description: '',
description: 'Tailored to your scale.',
canUpgrade: false,
canDowngrade: false,
hidden: true,
Expand All @@ -109,7 +109,7 @@ export const plansList: PlanDefinition[] = [
{
code: 'scale',
title: 'Scale',
description: '',
description: 'Tailored to your scale.',
canUpgrade: false,
canDowngrade: false,
hidden: true,
Expand Down
8 changes: 4 additions & 4 deletions packages/webapp/src/components/CreateEnvironmentButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@ export const CreateEnvironmentButton: React.FC = () => {
let tooltipContent: React.ReactNode = null;
if (isMaxEnvironmentsReached) {
tooltipContent = (
<span>
<div>
Max number of environments reached.{' '}
{environment?.plan?.name === 'scale' ? (
<>Contact Nango to add more</>
) : (
<>
<Link to="https://app.withsurface.com/s/cm1zve3340001l503sm0xtvo1" className="underline">
<Link to={`/${env}/team/billing`} className="underline">
Upgrade
</Link>{' '}
to add more
</>
)}
</span>
</div>
);
}

return (
<Dialog open={openDialog} onOpenChange={setOpenDialog}>
<SimpleTooltip tooltipContent={tooltipContent} delay={0} className="text-gray-400" side="bottom">
<SimpleTooltip tooltipContent={tooltipContent} delay={1} className="text-gray-400" side="bottom">
<DialogTrigger className="w-full" asChild>
<Button disabled={!!isMaxEnvironmentsReached} variant={'secondary'} className="w-full justify-center">
{isMaxEnvironmentsReached && <IconLock size={18} stroke={1} />}
Expand Down
5 changes: 4 additions & 1 deletion packages/webapp/src/components/EnvironmentPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ export const EnvironmentPicker: React.FC = () => {
side="bottom"
align="start"
style={{ width: 'var(--radix-popover-trigger-width)' }}
onOpenAutoFocus={(e) => {
if (meta.environments.length < 5) e.preventDefault();
}}
className="bg-grayscale-900 w-full px-0 border-grayscale-700 py-0"
>
<Command>
{meta.environments.length > 5 && (
{meta.environments.length >= 5 && (
<CommandInput
placeholder="Search..."
className="text-white ring-0 focus:ring-0 focus-visible:outline-none border-transparent border-b-grayscale-700 rounded-b-none px-2.5 "
Expand Down
18 changes: 8 additions & 10 deletions packages/webapp/src/pages/Team/Billing/Show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,15 @@ const UsageTable: React.FC<{ data: GetUsage['Success'] | undefined; isLoading: b
};

export const PlanCard: React.FC<{ env: string; def: PlanDefinitionList }> = ({ def }) => {
const Comp = def.active ? 'div' : Link;
return (
<Link
<Comp
className={cn(
'flex flex-col gap-4 text-white rounded-lg bg-grayscale-3 py-7 px-6 border border-grayscale-5',
def.active && 'bg-grayscale-1 border-grayscale-7'
)}
target="_blank"
to={'https://nango.dev/pricing'}
to={def.plan.canUpgrade ? 'mailto:upgrade@nango.dev' : 'https://nango.dev/demo'}
// to={def.above && !def.plan.canUpgrade ? 'mailto:upgrade@nango.dev' : ''}
// onClick={onClickPlan}
>
Expand All @@ -190,13 +191,10 @@ export const PlanCard: React.FC<{ env: string; def: PlanDefinitionList }> = ({ d
</header>
<div className="text-sm text-grayscale-10">{def.plan.description}</div>
</div>
{/* <footer>
{!def.active && (
<Button variant={'primary'} isLoading={loading}>
{def.plan.cta ? def.plan.cta : def.below ? 'Downgrade Plan' : 'Upgrade plan'}
</Button>
)}
</footer> */}
</Link>
<footer>
{!def.active && def.isUpgrade && <Button variant={'primary'}>{def.plan.cta ? def.plan.cta : 'Upgrade plan'}</Button>}
{!def.active && def.isDowngrade && <Button variant={'primary'}>Contact us to downgrade</Button>}
</footer>
</Comp>
);
};
Loading