feat: remove billing if not stripe
This commit is contained in:
parent
ffaf8f9494
commit
580bb6b162
|
|
@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ const nextConfig = {
|
|||
// See: https://github.com/gregberge/svgr
|
||||
svgr: false,
|
||||
},
|
||||
env: {
|
||||
isBillingEnabled: String(!!process.env.STRIPE_PUBLISHABLE_KEY),
|
||||
}
|
||||
};
|
||||
|
||||
const plugins = [
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export const menuItems = [
|
|||
icon: 'billing',
|
||||
path: '/billing',
|
||||
role: ['ADMIN', 'SUPERADMIN'],
|
||||
requireBilling: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -40,6 +41,9 @@ export const TopMenu: FC = () => {
|
|||
<ul className="gap-5 flex flex-1 items-center text-[18px]">
|
||||
{menuItems
|
||||
.filter((f) => {
|
||||
if (f.requireBilling && process.env.isBillingEnabled === 'false') {
|
||||
return false;
|
||||
}
|
||||
if (f.role) {
|
||||
return f.role.includes(user?.role!);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue