@@ -55,58 +55,60 @@ const SideNav = () => {
55
55
: ""
56
56
} `;
57
57
58
+ const baseUrl = `${ process . env . PUBLIC_URL || "" } /p/${ projectName } ` ;
59
+
58
60
const sideNav = [
59
61
{
60
62
name : "Home" ,
61
63
id : htmlIdGenerator ( "basicExample" ) ( ) ,
62
64
onClick : ( ) => {
63
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /` ) ;
65
+ navigate ( `${ baseUrl } /` ) ;
64
66
} ,
65
67
items : [
66
68
{
67
69
name : dataSourcesLabel ,
68
70
id : htmlIdGenerator ( "dataSources" ) ( ) ,
69
71
icon : < EuiIcon type = { DataSourceIcon } /> ,
70
72
onClick : ( ) => {
71
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /data-source` ) ;
73
+ navigate ( `${ baseUrl } /data-source` ) ;
72
74
} ,
73
- isSelected : useMatchSubpath ( " data-source" ) ,
75
+ isSelected : useMatchSubpath ( ` ${ baseUrl } / data-source` ) ,
74
76
} ,
75
77
{
76
78
name : entitiesLabel ,
77
79
id : htmlIdGenerator ( "entities" ) ( ) ,
78
80
icon : < EuiIcon type = { EntityIcon } /> ,
79
81
onClick : ( ) => {
80
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /entity` ) ;
82
+ navigate ( `${ baseUrl } /entity` ) ;
81
83
} ,
82
- isSelected : useMatchSubpath ( " entity" ) ,
84
+ isSelected : useMatchSubpath ( ` ${ baseUrl } / entity` ) ,
83
85
} ,
84
86
{
85
87
name : featureViewsLabel ,
86
88
id : htmlIdGenerator ( "featureView" ) ( ) ,
87
89
icon : < EuiIcon type = { FeatureViewIcon } /> ,
88
90
onClick : ( ) => {
89
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /feature-view` ) ;
91
+ navigate ( `${ baseUrl } /feature-view` ) ;
90
92
} ,
91
- isSelected : useMatchSubpath ( " feature-view" ) ,
93
+ isSelected : useMatchSubpath ( ` ${ baseUrl } / feature-view` ) ,
92
94
} ,
93
95
{
94
96
name : featureServicesLabel ,
95
97
id : htmlIdGenerator ( "featureService" ) ( ) ,
96
98
icon : < EuiIcon type = { FeatureServiceIcon } /> ,
97
99
onClick : ( ) => {
98
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /feature-service` ) ;
100
+ navigate ( `${ baseUrl } /feature-service` ) ;
99
101
} ,
100
- isSelected : useMatchSubpath ( " feature-service" ) ,
102
+ isSelected : useMatchSubpath ( ` ${ baseUrl } / feature-service` ) ,
101
103
} ,
102
104
{
103
105
name : savedDatasetsLabel ,
104
106
id : htmlIdGenerator ( "savedDatasets" ) ( ) ,
105
107
icon : < EuiIcon type = { DatasetIcon } /> ,
106
108
onClick : ( ) => {
107
- navigate ( `${ process . env . PUBLIC_URL || "" } /p/ ${ projectName } /data-set` ) ;
109
+ navigate ( `${ baseUrl } /data-set` ) ;
108
110
} ,
109
- isSelected : useMatchSubpath ( " data-set" ) ,
111
+ isSelected : useMatchSubpath ( ` ${ baseUrl } / data-set` ) ,
110
112
} ,
111
113
] ,
112
114
} ,
0 commit comments