Skip to content

Commit 21985bb

Browse files
authored
Merge pull request #1074 from trycompai/main
[comp] Production Deploy
2 parents bde4e46 + 6becfb8 commit 21985bb

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

apps/app/src/components/main-menu.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
// import { env } from '@/env.mjs';
3+
import { env } from '@/env.mjs';
44
import { Badge } from '@comp/ui/badge';
55
import { Button } from '@comp/ui/button';
66
import { cn } from '@comp/ui/cn';
@@ -10,6 +10,7 @@ import {
1010
Blocks,
1111
FlaskConical,
1212
Gauge,
13+
Gift,
1314
ListCheck,
1415
NotebookText,
1516
ShieldEllipsis,
@@ -49,7 +50,7 @@ export function MainMenu({ organizationId, isCollapsed = false, onItemClick }: P
4950
const pathname = usePathname();
5051
const [activeStyle, setActiveStyle] = useState({ top: '0px', height: '0px' });
5152
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
52-
// const hasDubEnabled = !!env.DUB_API_KEY;
53+
const isDubEnabled = env.NEXT_PUBLIC_IS_DUB_ENABLED === 'true';
5354

5455
const items: MenuItem[] = [
5556
{
@@ -128,14 +129,18 @@ export function MainMenu({ organizationId, isCollapsed = false, onItemClick }: P
128129
variant: 'secondary',
129130
},
130131
},
131-
// ...(hasDubEnabled ? [{
132-
// id: 'referrals',
133-
// path: '/:organizationId/referrals',
134-
// name: 'Referrals',
135-
// disabled: false,
136-
// icon: Gift,
137-
// protected: false,
138-
// }] : []),
132+
...(isDubEnabled
133+
? [
134+
{
135+
id: 'referrals',
136+
path: '/:organizationId/referrals',
137+
name: 'Referrals',
138+
disabled: false,
139+
icon: Gift,
140+
protected: false,
141+
},
142+
]
143+
: []),
139144
{
140145
id: 'settings',
141146
path: '/:organizationId/settings',

apps/app/src/env.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const env = createEnv({
4848
NEXT_PUBLIC_STRIPE_SUBSCRIPTION_MANAGED_YEARLY_PRICE_ID: z.string().optional(),
4949
NEXT_PUBLIC_STRIPE_SUBSCRIPTION_STARTER_MONTHLY_PRICE_ID: z.string().optional(),
5050
NEXT_PUBLIC_STRIPE_SUBSCRIPTION_STARTER_YEARLY_PRICE_ID: z.string().optional(),
51+
NEXT_PUBLIC_IS_DUB_ENABLED: z.string().optional(),
5152
},
5253

5354
runtimeEnv: {
@@ -97,6 +98,7 @@ export const env = createEnv({
9798
process.env.NEXT_PUBLIC_STRIPE_SUBSCRIPTION_STARTER_YEARLY_PRICE_ID,
9899
DUB_API_KEY: process.env.DUB_API_KEY,
99100
DUB_REFER_URL: process.env.DUB_REFER_URL,
101+
NEXT_PUBLIC_IS_DUB_ENABLED: process.env.NEXT_PUBLIC_IS_DUB_ENABLED,
100102
},
101103

102104
skipValidation: !!process.env.CI || !!process.env.SKIP_ENV_VALIDATION,

0 commit comments

Comments
 (0)