mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 01:26:20 +00:00
Finish removing Stripe from codebase
This commit is contained in:
@@ -2,14 +2,11 @@ const ENV = process.env.NEXT_PUBLIC_ENV! || "development"; // investigate
|
||||
const POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY!;
|
||||
const POSTHOG_HOST =
|
||||
process.env.NEXT_PUBLIC_POSTHOG_HOST! || "https://app.posthog.com";
|
||||
const STRIPE_PRODUCT_PRO = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_PRO!;
|
||||
const STRIPE_PRODUCT_STARTER = process.env.NEXT_PUBLIC_STRIPE_PRODUCT_STARTER!;
|
||||
const INTERCOM_ID = process.env.NEXT_PUBLIC_INTERCOM_ID!;
|
||||
|
||||
export {
|
||||
ENV,
|
||||
INTERCOM_ID,
|
||||
POSTHOG_API_KEY,
|
||||
POSTHOG_HOST,
|
||||
STRIPE_PRODUCT_PRO,
|
||||
STRIPE_PRODUCT_STARTER};
|
||||
POSTHOG_HOST
|
||||
};
|
||||
@@ -1,16 +1,12 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Head from "next/head";
|
||||
|
||||
import Plan from "@app/components/billing/Plan";
|
||||
import NavHeader from "@app/components/navigation/NavHeader";
|
||||
import { plans as plansConstant } from "@app/const";
|
||||
|
||||
import getOrganizationSubscriptions from "../../api/organization/GetOrgSubscription";
|
||||
import getOrganizationUsers from "../../api/organization/GetOrgUsers";
|
||||
import { useSubscription } from "@app/context";
|
||||
|
||||
export default function SettingsBilling() {
|
||||
const [currentPlan, setCurrentPlan] = useState("");
|
||||
const { subscription } = useSubscription();
|
||||
const [numUsers, setNumUsers] = useState(0);
|
||||
|
||||
const { t } = useTranslation();
|
||||
@@ -25,7 +21,7 @@ export default function SettingsBilling() {
|
||||
subtext: t("billing.starter.subtext")!,
|
||||
buttonTextMain: t("billing.downgrade")!,
|
||||
buttonTextSecondary: t("billing.learn-more")!,
|
||||
current: currentPlan === plansConstant.starter
|
||||
current: subscription?.slug === "starter" // subscription.slug?
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
@@ -35,7 +31,7 @@ export default function SettingsBilling() {
|
||||
text: "Unlimited members, up to 10 projects. Additional developer experience features.",
|
||||
buttonTextMain: t("billing.upgrade")!,
|
||||
buttonTextSecondary: t("billing.learn-more")!,
|
||||
current: currentPlan === plansConstant.team
|
||||
current: subscription?.slug === "team" || subscription?.slug === "team-annual"
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
@@ -46,7 +42,7 @@ export default function SettingsBilling() {
|
||||
subtext: t("billing.professional.subtext")!,
|
||||
buttonTextMain: t("billing.upgrade")!,
|
||||
buttonTextSecondary: t("billing.learn-more")!,
|
||||
current: currentPlan === plansConstant.professional
|
||||
current: subscription?.slug === "pro" || subscription?.slug === "pro-annual"
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
@@ -55,26 +51,10 @@ export default function SettingsBilling() {
|
||||
text: "Boost the security and efficiency of your engineering teams.",
|
||||
buttonTextMain: t("billing.schedule-demo")!,
|
||||
buttonTextSecondary: t("billing.learn-more")!,
|
||||
current: false
|
||||
current: subscription?.slug === "enterprise"
|
||||
}
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
const orgId = localStorage.getItem("orgData.id") as string;
|
||||
const subscriptions = await getOrganizationSubscriptions({
|
||||
orgId
|
||||
});
|
||||
if (subscriptions) {
|
||||
setCurrentPlan(subscriptions.data[0].plan.product);
|
||||
}
|
||||
const orgUsers = await getOrganizationUsers({
|
||||
orgId
|
||||
});
|
||||
setNumUsers(orgUsers.length);
|
||||
})();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col justify-between bg-bunker-800 pb-4 text-white">
|
||||
<Head>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { plans } from "public/data/frequentConstants";
|
||||
|
||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
||||
import NavHeader from "@app/components/navigation/NavHeader";
|
||||
|
||||
Reference in New Issue
Block a user