-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiPageLayout] Add bottomBar
& [EuiBottomBar] Add more position props
#4662
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
// TODO: Allow this hooke to be conditional | ||
const dimensions = useResizeObserver(resizeRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't necessarily have to happen in this PR, but we should allow this hook to be conditional somehow. In this particular instance, we don't need to watch for resizing unless the user has specified to affordForDisplacement
.
bottomBar
& [EuiBottomBar] Add more position props
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
…n_page # Conflicts: # CHANGELOG.md # src-docs/src/views/bottom_bar/bottom_bar_example.js # src-docs/src/views/bottom_bar/playground.js
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handful of small asks + one question; substance of changes looks great!
PR for you, moving the role=main logic into EuiPageContent: cchaos#47 |
Moved role=main logic into EuiPageComponent
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
I need help, because I'm really struggling to understand why this PR would mess up the EuiHeaderSectionItemButton's
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
Jenkins, test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
…n_page # Conflicts: # src-docs/src/views/page/page_example.js
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, pulled locally to test the template
prop interaction with bottomBar
/bottomBarProps
Preview documentation changes for this PR: https://eui.elastic.co/pr_4662/ |
This has been a big struggle for some consumers especially when there is side-nav. So this PR builds an optional
bottomBar
into the page template, while also adding some more props to EuiBottomBar for customizing position.EuiBottomBar
There had been talk of deprecating the EuiBottomBar for the EuiControlBar, but the lack of custom content in EuiControlBar hasn't allowed us to do that. So now I'm more beefing up the bottom bar that may eventually replace the wrapping component of EuiControlBar which would just be content-specific.
I've also rewritten the component to use
useEffect
instead of the old way anduseResizeObserver()
as the size watcher.New props
position: 'static' | 'sticky' | 'fixed'
- Defaults tofixed
usePortal: boolean
- Only works ifposition
isfixed
; Defaults totrue
🔔 BREAKING: Moved all the positioning attributes to be applied as
style
attributes.Any custom classes or CSS used to position the bar, will need to adjust these by add
!important
for overrides or use the following new props (their defaults shown):left
= 0right
= 0bottom
= 0top
I also darkened the bottom bar color to better match the header.
EuiPageTemplate
I found that the easiest way to accomodate side-navs when using the bottom bar, is to place it as the last item inside EuiPageBody with
position = sticky
. This way it will never overlap the side bar on the left (as it's contained within the page body) and in mobile it will never overlap the revealed navigation list as it will stop being "sticky" when page body is not in view.Screen.Recording.2021-03-24.at.10.11.26.AM.mp4
So this PR adds the following bottom bar props, but it's only allowed when
template = 'default'
because empty pages should not have bottom bars when there's nothing to "save".bottomBar: ReactNode
- Any contentsbottomBarProps: EuiBottomBarProps
- Extends the components propsThe
bottomBar
contents also gets wrapped in a EuiPageContentBody so that it can accept the samerestrictWidth
prop for keeping content aligned.Other updates
role="main"
to the EuiPageContent elements in the template and code examples for accessibility.bottomBorder
prop to EuiPageHeader, this allows me to enforce the bottom border when I couldn't target it successfully with CSSChecklist