Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions x-pack/plugins/spaces/public/views/nav_control/nav_control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { I18nProvider } from '@kbn/i18n/react';
import { constant } from 'lodash';
import { SpacesManager } from 'plugins/spaces/lib/spaces_manager';
// @ts-ignore
Expand All @@ -13,8 +14,8 @@ import { NavControlPopover } from 'plugins/spaces/views/nav_control/nav_control_
import { PathProvider } from 'plugins/xpack_main/services/path';
import { UserProfileProvider } from 'plugins/xpack_main/services/user_profile';
import React from 'react';
import ReactDOM from 'react-dom';
import { render, unmountComponentAtNode } from 'react-dom';
import ReactDOM from 'react-dom';
import { NavControlSide } from 'ui/chrome/directives/header_global_nav';
// @ts-ignore
import { uiModules } from 'ui/modules';
Expand Down Expand Up @@ -59,13 +60,15 @@ module.controller(
$scope.$parent.$watch('isVisible', function isVisibleWatcher(isVisible: boolean) {
if (isVisible && !mounted && !pathProvider.isUnauthenticated()) {
render(
<NavControlPopover
spacesManager={spacesManager}
activeSpace={activeSpace}
userProfile={userProfile}
anchorPosition={'rightCenter'}
buttonClass={SpacesGlobalNavButton}
/>,
<I18nProvider>
<NavControlPopover
spacesManager={spacesManager}
activeSpace={activeSpace}
userProfile={userProfile}
anchorPosition={'rightCenter'}
buttonClass={SpacesGlobalNavButton}
/>
</I18nProvider>,
domNode
);
mounted = true;
Expand Down Expand Up @@ -113,13 +116,15 @@ chromeHeaderNavControlsRegistry.register(
spacesManager = new SpacesManager($http, chrome, spaceSelectorURL);

ReactDOM.render(
<NavControlPopover
spacesManager={spacesManager}
activeSpace={activeSpace}
userProfile={userProfile}
anchorPosition="downLeft"
buttonClass={SpacesHeaderNavButton}
/>,
<I18nProvider>
<NavControlPopover
spacesManager={spacesManager}
activeSpace={activeSpace}
userProfile={userProfile}
anchorPosition="downLeft"
buttonClass={SpacesHeaderNavButton}
/>
</I18nProvider>,
el
);
},
Expand Down