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
6 changes: 3 additions & 3 deletions frontend/src/components/BillingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from "@/components/ui/button";
import { BillingDebugger } from "./BillingDebugger";
import { useLocalState } from "@/state/useLocalState";
import { getBillingService } from "@/billing/billingService";
import { Sparkles } from "lucide-react";
import { Bitcoin } from "lucide-react";

export function BillingStatus() {
const navigate = useNavigate();
Expand Down Expand Up @@ -66,8 +66,8 @@ export function BillingStatus() {
onClick={() => navigate({ to: "/pricing" })}
className="bg-white/10 backdrop-blur-sm px-6 py-2 rounded-full border border-white/20 text-sm font-light hover:bg-white/20 transition-colors cursor-pointer flex items-center gap-2 w-fit"
>
<Sparkles className="w-3.5 h-3.5 flex-shrink-0" />
<span>50% off monthly plans until January 31st →</span>
<Bitcoin className="w-3.5 h-3.5 flex-shrink-0" />
<span>Save 10% with yearly Bitcoin plans →</span>
</div>
)}
{import.meta.env.DEV && (
Expand Down
38 changes: 12 additions & 26 deletions frontend/src/routes/pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,7 @@ function PricingPage() {

// Calculate prices
const monthlyOriginalPrice = (product.default_price.unit_amount / 100).toFixed(2);
const monthlyDiscountedPrice = (
Math.floor(product.default_price.unit_amount / 2) / 100
).toFixed(2);
const monthlyPrice = monthlyOriginalPrice;

// Calculate yearly prices for Bitcoin (10% off)
const yearlyDiscountedPrice = (
Expand All @@ -507,10 +505,7 @@ function PricingPage() {
// Calculate monthly equivalent of yearly Bitcoin price
const monthlyEquivalentPrice = (Number(yearlyDiscountedPrice) / 12).toFixed(2);

const displayOriginalPrice = monthlyOriginalPrice;
const displayDiscountedPrice = useBitcoin
? monthlyEquivalentPrice
: monthlyDiscountedPrice;
const displayPrice = useBitcoin ? monthlyEquivalentPrice : monthlyPrice;

return (
<div
Expand All @@ -524,9 +519,9 @@ function PricingPage() {
Current Plan
</Badge>
)}
{product.name !== "Free" && (
{product.name !== "Free" && useBitcoin && product.name !== "Team" && (
<Badge className="absolute -top-3 right-4 bg-gradient-to-r from-pink-500 to-orange-500 text-white">
{useBitcoin && product.name !== "Team" ? "10% OFF" : "50% OFF"}
10% OFF
</Badge>
)}
<div className="grid grid-rows-[auto_1fr_auto_auto] h-full gap-4 sm:gap-6 md:gap-8">
Expand All @@ -549,11 +544,13 @@ function PricingPage() {
<>
<div className="flex flex-wrap items-center gap-2">
<span className="text-2xl sm:text-3xl font-bold">
${displayDiscountedPrice}
</span>
<span className="text-lg sm:text-xl line-through text-white/50">
${displayOriginalPrice}
${displayPrice}
</span>
{useBitcoin && product.name !== "Team" && (
<span className="text-lg sm:text-xl line-through text-white/50">
${monthlyOriginalPrice}
</span>
)}
<div className="flex flex-col text-white/70">
<span className="text-base sm:text-lg font-light">
{product.name === "Team" ? "per user" : ""}
Expand All @@ -564,7 +561,7 @@ function PricingPage() {
</div>
</div>
<div className="space-y-0.5 sm:space-y-1 mt-1">
{useBitcoin && product.name !== "Team" ? (
{useBitcoin && product.name !== "Team" && (
<>
<p className="text-sm sm:text-base text-white/90 font-medium">
{product.name === "Team"
Expand All @@ -575,23 +572,12 @@ function PricingPage() {
Save 10% with annual billing
</p>
</>
) : (
<>
<p className="text-xs sm:text-sm text-white/50">
First 3 months only
</p>
<p className="text-xs sm:text-sm text-white/50">
Offer ends January 31st
</p>
</>
)}
</div>
</>
) : (
<div className="flex flex-wrap items-center gap-2">
<span className="text-2xl sm:text-3xl font-bold">
${displayOriginalPrice}
</span>
<span className="text-2xl sm:text-3xl font-bold">${monthlyPrice}</span>
<span className="text-base sm:text-lg font-light text-white/70">
per month
</span>
Expand Down