Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SharedUX][Bugfix] Solution nav with no data page #144280

Merged
merged 4 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
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

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

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Side Public License, v 1.
*/

import { css } from '@emotion/react';
import { css } from '@emotion/css';
import { euiCanAnimate, EuiThemeComputed } from '@elastic/eui';

export const WithSolutionNavStyles = (euiTheme: EuiThemeComputed<{}>) => {
return css`
flex: 0 1 0%;
flex: 0 1 0;
overflow: hidden;
${euiCanAnimate} {
transition: min-width ${euiTheme.animation.fast} ${euiTheme.animation.resistance};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import React, { ComponentType, ReactNode, useState } from 'react';
import classNames from 'classnames';
import { SerializedStyles } from '@emotion/serialize';
import { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types';
import { useIsWithinBreakpoints, useEuiTheme, useIsWithinMinBreakpoint } from '@elastic/eui';
import { SolutionNav, SolutionNavProps } from './solution_nav';
Expand Down Expand Up @@ -37,7 +36,6 @@ export const withSolutionNav = <P extends TemplateProps>(WrappedComponent: Compo
const [isSideNavOpenOnDesktop, setisSideNavOpenOnDesktop] = useState(
!JSON.parse(String(localStorage.getItem(SOLUTION_NAV_COLLAPSED_KEY)))
);

const { solutionNav, children, ...propagatedProps } = props;
const { euiTheme } = useEuiTheme();

Expand All @@ -53,11 +51,11 @@ export const withSolutionNav = <P extends TemplateProps>(WrappedComponent: Compo
isMediumBreakpoint || (canBeCollapsed && isLargerBreakpoint && !isSideNavOpenOnDesktop);
const withSolutionNavStyles = WithSolutionNavStyles(euiTheme);
const sideBarClasses = classNames(
'kbnStickyMenu',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
'kbnSolutionNav__sidebar--shrink': isSidebarShrunk,
},
props.pageSideBarProps?.className
props.pageSideBarProps?.className,
withSolutionNavStyles
);

const pageSideBar = (
Expand All @@ -68,12 +66,11 @@ export const withSolutionNav = <P extends TemplateProps>(WrappedComponent: Compo
/>
);

const pageSideBarProps: TemplateProps['pageSideBarProps'] & { css: SerializedStyles } = {
const pageSideBarProps: TemplateProps['pageSideBarProps'] = {
paddingSize: 'none' as 'none',
...props.pageSideBarProps,
minWidth: isSidebarShrunk ? euiTheme.size.xxl : undefined,
className: sideBarClasses,
css: withSolutionNavStyles,
};

return (
Expand Down