From f5a5170c7f2cf49c970eb72f6907b06db7d3bbad Mon Sep 17 00:00:00 2001 From: Nevo David Date: Thu, 5 Dec 2024 21:23:33 +0700 Subject: [PATCH] feat: affiliate --- .../src/components/layout/top.menu.tsx | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/apps/frontend/src/components/layout/top.menu.tsx b/apps/frontend/src/components/layout/top.menu.tsx index 11c7ba6e..e750963c 100644 --- a/apps/frontend/src/components/layout/top.menu.tsx +++ b/apps/frontend/src/components/layout/top.menu.tsx @@ -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', @@ -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', @@ -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 ( @@ -86,6 +93,7 @@ export const TopMenu: FC = () => {
  • -1 ? '_blank' : '_self'} href={item.path} className={clsx( 'flex gap-2 items-center box px-[6px] md:px-[24px] py-[8px]',