From 580bb6b1621ed7da7052b3e346a5374fc181aaf8 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Mon, 6 May 2024 00:13:40 +0700 Subject: [PATCH] feat: remove billing if not stripe --- apps/frontend/.eslintrc.json | 3 ++- apps/frontend/next.config.js | 3 +++ apps/frontend/src/components/layout/top.menu.tsx | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/frontend/.eslintrc.json b/apps/frontend/.eslintrc.json index e6b03601..6cfcf667 100644 --- a/apps/frontend/.eslintrc.json +++ b/apps/frontend/.eslintrc.json @@ -10,7 +10,8 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { - "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"] + "@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"], + "no-extra-boolean-cast": "off" } }, { diff --git a/apps/frontend/next.config.js b/apps/frontend/next.config.js index 007b2aa5..c79aae74 100644 --- a/apps/frontend/next.config.js +++ b/apps/frontend/next.config.js @@ -12,6 +12,9 @@ const nextConfig = { // See: https://github.com/gregberge/svgr svgr: false, }, + env: { + isBillingEnabled: String(!!process.env.STRIPE_PUBLISHABLE_KEY), + } }; const plugins = [ diff --git a/apps/frontend/src/components/layout/top.menu.tsx b/apps/frontend/src/components/layout/top.menu.tsx index f9ee9f2a..105988c5 100644 --- a/apps/frontend/src/components/layout/top.menu.tsx +++ b/apps/frontend/src/components/layout/top.menu.tsx @@ -28,6 +28,7 @@ export const menuItems = [ icon: 'billing', path: '/billing', role: ['ADMIN', 'SUPERADMIN'], + requireBilling: true, }, ]; @@ -40,6 +41,9 @@ export const TopMenu: FC = () => {