Skip to content

Commit

Permalink
feat: Update personal plan types and include Hobby and Pro plan names (
Browse files Browse the repository at this point in the history
…#8153)

* feat: update personal plan types and formatting

* feat: remove unused personal plan types from organization route

* feat: add planName to CurrentPlan interface and update display logic

* feat: capitalize plan type display in organization route
  • Loading branch information
pavkout authored Nov 15, 2024
1 parent 695d778 commit 9994f72
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/insomnia/src/ui/routes/organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ type PersonalPlanType = 'free' | 'individual' | 'team' | 'enterprise' | 'enterpr
const formatCurrentPlanType = (type: PersonalPlanType) => {
switch (type) {
case 'free':
return 'Free';
return 'Hobby';
case 'individual':
return 'Individual';
case 'team':
return 'Team';
return 'Pro';
case 'enterprise':
return 'Enterprise';
case 'enterprise-member':
Expand All @@ -112,6 +112,7 @@ export interface CurrentPlan {
price: number;
quantity: number;
type: PersonalPlanType;
planName: string;
};

function sortOrganizations(accountId: string, organizations: Organization[]): Organization[] {
Expand Down Expand Up @@ -670,8 +671,8 @@ const OrganizationRoute = () => {
</Button>
<Popover className="min-w-max border select-none text-sm border-solid border-[--hl-sm] shadow-lg bg-[--color-bg] py-2 rounded-md overflow-y-auto max-h-[85vh] focus:outline-none">
{currentPlan && Boolean(currentPlan.type) && (
<div className='flex gap-2 justify-between items-center pb-2 px-[--padding-md] border-b border-solid border-[--hl-sm] text-[--color-font] h-[--line-height-xs] w-full text-md whitespace-nowrap'>
<span>{formatCurrentPlanType(currentPlan.type)} Plan</span>
<div className='flex gap-2 justify-between items-center pb-2 px-[--padding-md] border-b border-solid border-[--hl-sm] text-[--color-font] h-[--line-height-xs] w-full text-md whitespace-nowrap capitalize'>
<span>{currentPlan.planName ?? formatCurrentPlanType(currentPlan.type)} Plan</span>
<UpgradeButton currentPlan={currentPlan} />
</div>
)}
Expand Down

0 comments on commit 9994f72

Please sign in to comment.