From 54557de762a57332bf9c47a1a904d5520017f340 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Mon, 22 Jul 2024 14:47:09 -0400 Subject: [PATCH] remove old non-subscription code --- .../hosted/payments/PricingDialog.tsx | 271 +++++++----------- 1 file changed, 98 insertions(+), 173 deletions(-) diff --git a/frontend/src/components/hosted/payments/PricingDialog.tsx b/frontend/src/components/hosted/payments/PricingDialog.tsx index 126df86..3ff0d59 100644 --- a/frontend/src/components/hosted/payments/PricingDialog.tsx +++ b/frontend/src/components/hosted/payments/PricingDialog.tsx @@ -15,8 +15,6 @@ import { useStore } from "../../../store/store"; const LOGOS = ["microsoft", "amazon", "mit", "stanford", "bytedance", "baidu"]; -const SELL_SUBSCRIPTIONS = true; - const PricingDialog: React.FC = () => { const { checkout, isLoadingCheckout } = useStripeCheckout(); const [paymentInterval, setPaymentInterval] = React.useState< @@ -45,190 +43,117 @@ const PricingDialog: React.FC = () => { - {SELL_SUBSCRIPTIONS && ( -
- - -
- )} +
+ + +
- {!SELL_SUBSCRIPTIONS && ( - <> -
-

Hobby

-

Great to start

-
- $15 -
- - - -
    -
  • - - 100 credits -
  • -
  • - - Email support -
  • -
-
+
+

Hobby

+

Great to start

+
+ + {paymentInterval === "monthly" ? "$15" : "$150"} + + + {paymentInterval === "monthly" ? "/ month" : "/ year"} + +
-
-

Pro

-

Higher limits

-
- $40 - {/* / month */} -
- - - - - -
    -
  • - - 300 credits -
  • -
  • - - Email support -
  • -
-
- - )} - - {SELL_SUBSCRIPTIONS && ( - <> -
-

Hobby

-

Great to start

-
- - {paymentInterval === "monthly" ? "$15" : "$150"} - - - {paymentInterval === "monthly" ? "/ month" : "/ year"} - -
- - + onClick={() => + checkout( + paymentInterval === "monthly" + ? "hobby_monthly" + : "hobby_yearly" + ) + } + > + Subscribe {isLoadingCheckout && } + -
    -
  • - - 100 credits / mo -
  • -
  • - - OpenAI models -
  • -
  • - - Claude models -
  • -
  • - - Chat support -
  • -
-
+
    +
  • + + 100 credits / mo +
  • +
  • + + OpenAI models +
  • +
  • + + Claude models +
  • +
  • + + Chat support +
  • +
+
-
-

Pro

-

Higher limits

-
- - {paymentInterval === "monthly" ? "$40" : "$400"} - - - {paymentInterval === "monthly" ? "/ month" : "/ year"} - -
+
+

Pro

+

Higher limits

+
+ + {paymentInterval === "monthly" ? "$40" : "$400"} + + + {paymentInterval === "monthly" ? "/ month" : "/ year"} + +
- + onClick={() => + checkout( + paymentInterval === "monthly" ? "pro_monthly" : "pro_yearly" + ) + } + > + Subscribe {isLoadingCheckout && } + -
    -
  • - - 300 credits / mo -
  • -
  • - - OpenAI models -
  • -
  • - - Claude models -
  • -
  • - - Chat support -
  • -
-
- - )} +
    +
  • + + 300 credits / mo +
  • +
  • + + OpenAI models +
  • +
  • + + Claude models +
  • +
  • + + Chat support +
  • +
+

- 1 credit = 1 code generation.{" "} - {!SELL_SUBSCRIPTIONS && <>Unused credits expire after 90 days.} - {SELL_SUBSCRIPTIONS && ( - <> -
- Cancel subscription at any time. - - )} + 1 credit = 1 code generation.
+ Cancel subscription at any time.