1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 15:35: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.List>
<Tab>Details</Tab> <Tab>Details</Tab>
<Tab>Security</Tab> <Tab>Security</Tab>
<Tab>Billing</Tab> {process.env.STRIPE_API_KEY && <Tab>Billing</Tab>}
</Tab.List> </Tab.List>
<Tab.Panels> <Tab.Panels>
<Tab.Panel> <Tab.Panel>
@ -46,9 +46,11 @@ export default function SettingsPage() {
<SecurityPreferences /> <SecurityPreferences />
</div> </div>
</Tab.Panel> </Tab.Panel>
{process.env.STRIPE_API_KEY && (
<Tab.Panel> <Tab.Panel>
<BillingPreferences /> <BillingPreferences />
</Tab.Panel> </Tab.Panel>
)}
</Tab.Panels> </Tab.Panels>
</Tab.Group> </Tab.Group>
</section> </section>

View file

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

View file

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

View file

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