@@ -8,16 +8,16 @@ import { useUser } from '@gitroom/frontend/components/layout/user.context';
8
8
import { useVariables } from '@gitroom/react/helpers/variable.context' ;
9
9
10
10
export const useMenuItems = ( ) => {
11
- const { isGeneral} = useVariables ( ) ;
11
+ const { isGeneral } = useVariables ( ) ;
12
12
return [
13
13
...( ! isGeneral
14
14
? [
15
- {
16
- name : 'Analytics' ,
17
- icon : 'analytics' ,
18
- path : '/analytics' ,
19
- } ,
20
- ]
15
+ {
16
+ name : 'Analytics' ,
17
+ icon : 'analytics' ,
18
+ path : '/analytics' ,
19
+ } ,
20
+ ]
21
21
: [ ] ) ,
22
22
{
23
23
name : isGeneral ? 'Calendar' : 'Launches' ,
@@ -26,22 +26,22 @@ export const useMenuItems = () => {
26
26
} ,
27
27
...( isGeneral
28
28
? [
29
- {
30
- name : 'Analytics' ,
31
- icon : 'analytics' ,
32
- path : '/analytics' ,
33
- } ,
34
- ]
29
+ {
30
+ name : 'Analytics' ,
31
+ icon : 'analytics' ,
32
+ path : '/analytics' ,
33
+ } ,
34
+ ]
35
35
: [ ] ) ,
36
36
...( ! isGeneral
37
37
? [
38
- {
39
- name : 'Settings' ,
40
- icon : 'settings' ,
41
- path : '/settings' ,
42
- role : [ 'ADMIN' , 'SUPERADMIN' ] ,
43
- } ,
44
- ]
38
+ {
39
+ name : 'Settings' ,
40
+ icon : 'settings' ,
41
+ path : '/settings' ,
42
+ role : [ 'ADMIN' , 'SUPERADMIN' ] ,
43
+ } ,
44
+ ]
45
45
: [ ] ) ,
46
46
{
47
47
name : 'Marketplace' ,
@@ -60,13 +60,20 @@ export const useMenuItems = () => {
60
60
role : [ 'ADMIN' , 'SUPERADMIN' ] ,
61
61
requireBilling : true ,
62
62
} ,
63
+ {
64
+ name : 'Affiliate' ,
65
+ icon : 'affiliate' ,
66
+ path : 'https://affiliate.postiz.com' ,
67
+ role : [ 'ADMIN' , 'SUPERADMIN' , 'USER' ] ,
68
+ requireBilling : true ,
69
+ } ,
63
70
] ;
64
- }
71
+ } ;
65
72
66
73
export const TopMenu : FC = ( ) => {
67
74
const path = usePathname ( ) ;
68
75
const user = useUser ( ) ;
69
- const { billingEnabled} = useVariables ( ) ;
76
+ const { billingEnabled } = useVariables ( ) ;
70
77
const menuItems = useMenuItems ( ) ;
71
78
72
79
return (
@@ -86,6 +93,7 @@ export const TopMenu: FC = () => {
86
93
< li key = { item . name } >
87
94
< Link
88
95
prefetch = { true }
96
+ target = { item . path . indexOf ( 'http' ) > - 1 ? '_blank' : '_self' }
89
97
href = { item . path }
90
98
className = { clsx (
91
99
'flex gap-2 items-center box px-[6px] md:px-[24px] py-[8px]' ,
0 commit comments