@@ -120,19 +120,13 @@ enum Panel {
120120 UserSettings = 'UserSettings' ,
121121}
122122
123- function AsideNavigation ( props : AsideNavigationProps ) {
123+ export const useGetLeftNavigationItems = ( ) => {
124124 const location = useLocation ( ) ;
125125 const history = useHistory ( ) ;
126126
127- const [ visiblePanel , setVisiblePanel ] = useState < Panel > ( ) ;
128-
129127 const [ initialTenantPage , setInitialTenantPage ] = useSetting < string > ( TENANT_INITIAL_PAGE_KEY ) ;
130128 const { tenantPage = initialTenantPage } = useTypedSelector ( ( state ) => state . tenant ) ;
131129
132- const setIsCompact = ( compact : boolean ) => {
133- props . setSettingValue ( ASIDE_HEADER_COMPACT_KEY , JSON . stringify ( compact ) ) ;
134- } ;
135-
136130 const { pathname} = location ;
137131 const queryParams = parseQuery ( location ) ;
138132
@@ -183,6 +177,20 @@ function AsideNavigation(props: AsideNavigationProps) {
183177 } ) ;
184178 } , [ tenantPage , isTenantPage , setInitialTenantPage , history , queryParams ] ) ;
185179
180+ return menuItems ;
181+ } ;
182+
183+ function AsideNavigation ( props : AsideNavigationProps ) {
184+ const history = useHistory ( ) ;
185+
186+ const [ visiblePanel , setVisiblePanel ] = useState < Panel > ( ) ;
187+
188+ const setIsCompact = ( compact : boolean ) => {
189+ props . setSettingValue ( ASIDE_HEADER_COMPACT_KEY , JSON . stringify ( compact ) ) ;
190+ } ;
191+
192+ const menuItems = useGetLeftNavigationItems ( ) ;
193+
186194 return (
187195 < React . Fragment >
188196 < AsideHeader
0 commit comments