Skip to content

Commit

Permalink
feat: fix the miller dev shell buy now button
Browse files Browse the repository at this point in the history
  • Loading branch information
darraghoriordan committed Dec 23, 2023
1 parent 776dfab commit 972bf0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions apps/frontend/src/components/BuyNowButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export function BuyNowButton({
className?: string;
text?: string;
}) {
console.log("loading the button", user, productKey, color, className, text);
const { mutateAsync } = useGetPaymentLink();

const orgUuid = user?.memberships?.find((m) =>
m.roles?.some((r) => r.name === "owner")
const orgUuid = user?.memberships?.find(
(m) => m.roles?.some((r) => r.name === "owner"),
)?.organisation?.uuid;

const product = productMapping.find((p) => p.productKey === productKey);
Expand All @@ -68,7 +69,7 @@ export function BuyNowButton({
mode: product.mode,
organisationUuid: orgUuid,
});

console.log("link", link);
window.location.href = link.stripeSessionUrl;
};

Expand All @@ -78,7 +79,7 @@ export function BuyNowButton({
color={color}
className={clsx(
"rounded-lg text-xl px-14 py-4 hover:shadow-lg border-white",
className
className,
)}
>
{text || "Buy now"}
Expand Down
3 changes: 2 additions & 1 deletion apps/frontend/src/marketing-pages/dev-shell-home/Pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Container } from "../../components/Container";
import { UserDto } from "@use-miller/shared-api-client";
import { BuyNowButton } from "../../components/BuyNowButton.jsx";
import { CheckIcon } from "@heroicons/react/24/outline";
import { SignUpBuyNowButton } from "../../components/SignupBuyNow.jsx";

const buyBenefits = [
"Mac and Windows dev environment setup in 1 command",
Expand Down Expand Up @@ -49,7 +50,7 @@ export function Pricing({ user }: { user: UserDto }) {
$29<span className="text-base">USD</span>
</p>
<div className="mx-auto flex gap-x-6 md:mx-0 mb-10">
<BuyNowButton
<SignUpBuyNowButton
user={user}
productKey="dev-shell"
color="cyan"
Expand Down

0 comments on commit 972bf0f

Please sign in to comment.