Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ export const InviteDialog = ({
},
});

const handleSendInvites = () => {
sendInvites.mutate();
};

return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent className="p-0 w-full max-w-md rounded-xl border bg-gray-2 border-gray-4">
Expand Down Expand Up @@ -214,7 +210,7 @@ export const InviteDialog = ({
inviteEmails.length === 0 ||
remainingSeats === 0
}
onClick={handleSendInvites}
onClick={() => sendInvites.mutate()}
>
Send Invites
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { buildEnv } from "@cap/env";
import {
Button,
Card,
Expand Down Expand Up @@ -146,22 +147,24 @@ export const MembersCard = ({
<CardDescription>Manage your organization members.</CardDescription>
</CardHeader>
<div className="flex flex-wrap gap-3">
<Tooltip
position="top"
content="Once inside the Stripe dashboard, click 'Manage Plan', then increase quantity of subscriptions to purchase more seats"
>
<Button
type="button"
size="sm"
variant="primary"
className="px-6 min-w-auto"
spinner={loading}
disabled={!isOwner || loading}
onClick={handleManageBilling}
{buildEnv.NEXT_PUBLIC_IS_CAP && (
<Tooltip
position="top"
content="Once inside the Stripe dashboard, click 'Manage Plan', then increase quantity of subscriptions to purchase more seats"
>
{loading ? "Loading..." : "+ Purchase more seats"}
</Button>
</Tooltip>
<Button
type="button"
size="sm"
variant="primary"
className="px-6 min-w-auto"
spinner={loading}
disabled={!isOwner || loading}
onClick={handleManageBilling}
>
{loading ? "Loading..." : "+ Purchase more seats"}
</Button>
</Tooltip>
)}
<Button
type="button"
size="sm"
Expand Down
9 changes: 5 additions & 4 deletions apps/web/utils/organization.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { buildEnv } from "@cap/env";

/**
* Calculate organization seats information
*/
Expand All @@ -10,10 +12,9 @@ export function calculateSeats(organization: {
const memberCount = organization?.members?.length ?? 0;
const pendingInvitesCount = organization?.invites?.length ?? 0;
const totalUsedSeats = memberCount + pendingInvitesCount;
const remainingSeats =
process.env.NODE_ENv === "development"
? Number.MAX_SAFE_INTEGER
: Math.max(0, inviteQuota - totalUsedSeats);
const remainingSeats = buildEnv.NEXT_PUBLIC_IS_CAP
? Math.max(0, inviteQuota - totalUsedSeats)
: Number.MAX_SAFE_INTEGER;

return {
inviteQuota,
Expand Down