Skip to content

Commit

Permalink
[navigation-next] Add CollapsibleNavGroupEnabled component into chrom…
Browse files Browse the repository at this point in the history
…e_service.(#7093)

Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Jul 2, 2024
1 parent 9ac3184 commit d7b20a2
Show file tree
Hide file tree
Showing 7 changed files with 546 additions and 26 deletions.
4 changes: 3 additions & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface StartDeps {
overlays: OverlayStart;
}

type CollapsibleNavHeaderRender = () => JSX.Element | null;
export type CollapsibleNavHeaderRender = () => JSX.Element | null;

/** @internal */
export class ChromeService {
Expand Down Expand Up @@ -299,6 +299,8 @@ export class ChromeService {
survey={injectedMetadata.getSurvey()}
collapsibleNavHeaderRender={this.collapsibleNavHeaderRender}
sidecarConfig$={sidecarConfig$}
navGroupsMap$={navGroup.getNavGroupsMap$()}
navGroupEnabled={navGroup.getNavGroupEnabled()}
/>
),

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/core/public/chrome/ui/header/collapsible_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { HttpStart } from '../../../http';
import { OnIsLockedUpdate } from './';
import { createEuiListItem, createRecentNavLink, isModifiedOrPrevented } from './nav_link';
import type { Logos } from '../../../../common/types';
import { CollapsibleNavHeaderRender } from '../../chrome_service';

function getAllCategories(allCategorizedLinks: Record<string, ChromeNavLink[]>) {
const allCategories = {} as Record<string, AppCategory | undefined>;
Expand Down Expand Up @@ -89,7 +90,7 @@ function setIsCategoryOpen(id: string, isOpen: boolean, storage: Storage) {
interface Props {
appId$: InternalApplicationStart['currentAppId$'];
basePath: HttpStart['basePath'];
collapsibleNavHeaderRender?: () => JSX.Element | null;
collapsibleNavHeaderRender?: CollapsibleNavHeaderRender;
id: string;
isLocked: boolean;
isNavOpen: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.context-nav-wrapper {
background-color: $ouiCollapsibleNavBackgroundColor;

.full-width {
width: 100%;
}

.no-padding {
padding: 0;
}

.no-hover {
&:hover {
text-decoration: none;
}
}

.wrapper {
overflow-y: auto;
}

.second-navigation {
border-left: $euiBorderThin;
}

.padding-horizontal {
padding-left: $ouiSize;
}

.no-margin-top {
margin-top: $ouiSize / 4;
}
}
Loading

0 comments on commit d7b20a2

Please sign in to comment.