Skip to content

Commit

Permalink
Disable usage tab (#4630)
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAraujo authored May 9, 2024
1 parent 5c53955 commit f42fe38
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 39 deletions.
63 changes: 33 additions & 30 deletions dashboard/src/main/home/modals/BillingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Link from "components/porter/Link";
import Modal from "components/porter/Modal";
import Spacer from "components/porter/Spacer";
import Text from "components/porter/Text";
import { usePublishableKey } from "lib/hooks/useStripe";
import { useIntercom } from "lib/hooks/useIntercom";
import { usePublishableKey } from "lib/hooks/useStripe";

import { Context } from "shared/Context";

Expand Down Expand Up @@ -76,23 +76,28 @@ const BillingModal = ({
</Text>
) : (
<Text color="helper">
{trialExpired
? (
<div>
Your applications will continue to run but you will not be able to access your project until you link a payment method.
{" "}
<Text style={{ cursor: "pointer" }} onClick={() => showIntercomWithMessage({
message: "I have already redeemed my startup deal.",
delaySeconds: 0,
})}>
Already redeemed your startup deal?
</Text>
<Spacer y={0.5} />
{"For more details on the current costs and usage of this project, visit the "}
<Link to="/project-settings?selected_tab=billing">billing page.</Link>
</div>
)
: "Link a payment method to your Porter project."}
{trialExpired ? (
<div>
Your applications will continue to run but you will not be able
to access your project until you link a payment method.{" "}
<Text
style={{ cursor: "pointer" }}
onClick={() =>
showIntercomWithMessage({
message: "I have already redeemed my startup deal.",
delaySeconds: 0,
})
}
>
Already redeemed your startup deal?
</Text>
{/* <Spacer y={0.5} /> */}
{/* {"For more details on the current costs and usage of this project, visit the "}
<Link to="/project-settings?selected_tab=billing">billing page.</Link> */}
</div>
) : (
"Link a payment method to your Porter project."
)}
<Spacer y={0.5} />
{`You can learn more about our pricing under "For Businesses" `}
<Link target="_blank" to="https://porter.run/pricing">
Expand All @@ -101,19 +106,17 @@ const BillingModal = ({
</Text>
)}
<Spacer y={1} />
{
publishableKey ? (
<Elements
stripe={stripePromise || null}
options={options}
appearance={appearance}
>
<PaymentSetupForm onCreate={onCreate}></PaymentSetupForm>
</Elements>
) : null
}
{publishableKey ? (
<Elements
stripe={stripePromise || null}
options={options}
appearance={appearance}
>
<PaymentSetupForm onCreate={onCreate}></PaymentSetupForm>
</Elements>
) : null}
</div>
</Modal >
</Modal>
);
};

Expand Down
18 changes: 9 additions & 9 deletions dashboard/src/main/home/project-settings/ProjectSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ function ProjectSettings(props: any) {
});
}

if (
currentProject?.billing_enabled &&
currentProject?.metronome_enabled
) {
tabOpts.push({
value: "usage",
label: "Usage",
});
}
// if (
// currentProject?.billing_enabled &&
// currentProject?.metronome_enabled
// ) {
// tabOpts.push({
// value: "usage",
// label: "Usage",
// });
// }

tabOpts.push({
value: "additional-settings",
Expand Down

0 comments on commit f42fe38

Please sign in to comment.