Skip to content

Commit

Permalink
feat: affiliate
Browse files Browse the repository at this point in the history
  • Loading branch information
nevo-david committed Dec 5, 2024
1 parent 65e3bf0 commit f5a5170
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions apps/frontend/src/components/layout/top.menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { useUser } from '@gitroom/frontend/components/layout/user.context';
import { useVariables } from '@gitroom/react/helpers/variable.context';

export const useMenuItems = () => {
const {isGeneral} = useVariables();
const { isGeneral } = useVariables();
return [
...(!isGeneral
? [
{
name: 'Analytics',
icon: 'analytics',
path: '/analytics',
},
]
{
name: 'Analytics',
icon: 'analytics',
path: '/analytics',
},
]
: []),
{
name: isGeneral ? 'Calendar' : 'Launches',
Expand All @@ -26,22 +26,22 @@ export const useMenuItems = () => {
},
...(isGeneral
? [
{
name: 'Analytics',
icon: 'analytics',
path: '/analytics',
},
]
{
name: 'Analytics',
icon: 'analytics',
path: '/analytics',
},
]
: []),
...(!isGeneral
? [
{
name: 'Settings',
icon: 'settings',
path: '/settings',
role: ['ADMIN', 'SUPERADMIN'],
},
]
{
name: 'Settings',
icon: 'settings',
path: '/settings',
role: ['ADMIN', 'SUPERADMIN'],
},
]
: []),
{
name: 'Marketplace',
Expand All @@ -60,13 +60,20 @@ export const useMenuItems = () => {
role: ['ADMIN', 'SUPERADMIN'],
requireBilling: true,
},
{
name: 'Affiliate',
icon: 'affiliate',
path: 'https://affiliate.postiz.com',
role: ['ADMIN', 'SUPERADMIN', 'USER'],
requireBilling: true,
},
];
}
};

export const TopMenu: FC = () => {
const path = usePathname();
const user = useUser();
const {billingEnabled} = useVariables();
const { billingEnabled } = useVariables();
const menuItems = useMenuItems();

return (
Expand All @@ -86,6 +93,7 @@ export const TopMenu: FC = () => {
<li key={item.name}>
<Link
prefetch={true}
target={item.path.indexOf('http') > -1 ? '_blank' : '_self'}
href={item.path}
className={clsx(
'flex gap-2 items-center box px-[6px] md:px-[24px] py-[8px]',
Expand Down

0 comments on commit f5a5170

Please sign in to comment.