mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 15:05:22 +02:00
Merge pull request #154 from simonbukin/remove-billing-and-upgrade-references
Remove billing & upgrade references when STRIPE_API_KEY is missing
This commit is contained in:
commit
5a62708135
6 changed files with 20 additions and 13 deletions
|
@ -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>
|
||||
|
|
|
@ -33,6 +33,8 @@ const envSchema = z.object({
|
|||
|
||||
NX_CDN_PRIVATE_BUCKET: z.string().default('REPLACE_THIS'),
|
||||
NX_CDN_PUBLIC_BUCKET: z.string().default('REPLACE_THIS'),
|
||||
|
||||
STRIPE_API_KEY: z.string().optional(),
|
||||
})
|
||||
|
||||
const env = envSchema.parse(process.env)
|
||||
|
|
|
@ -154,11 +154,13 @@ syncInstitutionQueue.add(
|
|||
*/
|
||||
sendEmailQueue.process('send-email', async (job) => await emailProcessor.send(job.data))
|
||||
|
||||
sendEmailQueue.add(
|
||||
'send-email',
|
||||
{ type: 'trial-reminders' },
|
||||
{ repeat: { cron: '0 */12 * * *' } } // Run every 12 hours
|
||||
)
|
||||
if (env.STRIPE_API_KEY) {
|
||||
sendEmailQueue.add(
|
||||
'send-email',
|
||||
{ type: 'trial-reminders' },
|
||||
{ repeat: { cron: '0 */12 * * *' } } // Run every 12 hours
|
||||
)
|
||||
}
|
||||
|
||||
// Fallback - usually triggered by errors not handled (or thrown) within the Bull event handlers (see above)
|
||||
process.on(
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)} />
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue