1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 15:05:22 +02:00

Remove billing & upgrade references when STRIPE_API_KEY is missing

This commit is contained in:
Simon Bukin 2024-01-18 14:02:46 -08:00
parent 7d46d22152
commit e1f8de527a
4 changed files with 11 additions and 8 deletions

View file

@ -35,7 +35,7 @@ export default function SettingsPage() {
<Tab.List>
<Tab>Details</Tab>
<Tab>Security</Tab>
<Tab>Billing</Tab>
{process.env.STRIPE_API_KEY && <Tab>Billing</Tab>}
</Tab.List>
<Tab.Panels>
<Tab.Panel>
@ -46,9 +46,11 @@ export default function SettingsPage() {
<SecurityPreferences />
</div>
</Tab.Panel>
<Tab.Panel>
<BillingPreferences />
</Tab.Panel>
{process.env.STRIPE_API_KEY && (
<Tab.Panel>
<BillingPreferences />
</Tab.Panel>
)}
</Tab.Panels>
</Tab.Group>
</section>

View file

@ -313,7 +313,6 @@ function DefaultContent({
email,
}: PropsWithChildren<{ onboarding?: ReactNode; name?: string; email?: string }>) {
const { addAccount } = useAccountContext()
return (
<>
<div className="flex items-center justify-between mb-4">
@ -338,7 +337,7 @@ function DefaultContent({
{onboarding && onboarding}
<UpgradePrompt />
{process.env.STRIPE_API_KEY && <UpgradePrompt />}
<div className="flex items-center justify-between">
<div className="text-base">

View file

@ -174,7 +174,7 @@ export function MobileLayout({ children, sidebar }: MobileLayoutProps) {
</section>
<div className="pt-6 shrink-0">
<UpgradePrompt />
{process.env.STRIPE_API_KEY && <UpgradePrompt />}
</div>
</div>
</div>

View file

@ -78,7 +78,9 @@ export function BillingPreferences() {
</div>
)}
</div>
<UpgradeTakeover open={takeoverOpen} onClose={() => setTakeoverOpen(false)} />
{process.env.STRIPE_API_KEY && (
<UpgradeTakeover open={takeoverOpen} onClose={() => setTakeoverOpen(false)} />
)}
</>
)
}