-
Notifications
You must be signed in to change notification settings - Fork 350
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
docs(Page): Update examples and demos to use Masthead #6388
docs(Page): Update examples and demos to use Masthead #6388
Conversation
PF4 preview: https://patternfly-react-pr-6388.surge.sh |
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.
@wise-king-sullyman So is it only the first demo then that was refactored to use the new masthead? In any case, the masthead utility items should be updated to match the updated Navigation demos. Here's what that should look like:
And also see this: https://patternfly-react-pr-6388.surge.sh/components/navigation/react-demos/default-nav/
@mcarrano Yes only the first demo was refactored to use Masthead, the others I left to demonstrate PageHeader since it's still in use. If you would like me to get rid of/refactor all of the PageHeader demos (or two of the three) though I'm happy to do so. I will update the utility items shortly 👍 |
@wise-king-sullyman I think it's OK to leave the other demos as is and just update the first one with the new utility items. |
While doing requested updates I also updated demo screenshots and removed unneeded toolbar groups from the page examples to make them cleaner. |
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.
Could you add href="#"
to each of the navItems in the demos - so that when the user tabs through the page, it will grant access to the tertiary nav items?
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.
Thanks for updating the demo thumbnails! I'm a bit confused about what we're doing with the old PageHeader
now.
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.
Looks great. Thanks for making those changes.
(FYI deleted my comment, not able to reproduce issue anymore that only I was seeing.) |
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.
Thanks @wise-king-sullyman !
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.
Looks great! The only issue I see is icon-button-group
grouping.
<ToolbarGroup | ||
variant="icon-button-group" | ||
alignment={{ default: 'alignRight' }} | ||
spacer={{ default: 'spacerNone', md: 'spacerMd' }} | ||
> | ||
<ToolbarItem> | ||
<Button aria-label="Notifications" variant={ButtonVariant.plain}> | ||
<AttentionBellIcon /> | ||
</Button> | ||
</ToolbarItem> | ||
<ToolbarGroup variant="icon-button-group" visibility={{ default: 'hidden', lg: 'visible' }}> | ||
<ToolbarItem> | ||
<Button aria-label="Settings actions" variant={ButtonVariant.plain}> | ||
<CogIcon /> | ||
</Button> | ||
</ToolbarItem> | ||
<ToolbarItem> | ||
<Button aria-label="Help actions" variant={ButtonVariant.plain}> | ||
<HelpIcon /> | ||
</Button> | ||
</ToolbarItem> | ||
</ToolbarGroup> | ||
</ToolbarGroup> | ||
<ToolbarItem visibility={{ default: 'hidden', md: 'visible', lg: 'hidden' }}> | ||
<Dropdown | ||
isPlain | ||
position="right" | ||
onSelect={this.onKebabDropdownSelect} | ||
toggle={<KebabToggle onToggle={this.onKebabDropdownToggle} />} | ||
isOpen={isKebabDropdownOpen} | ||
dropdownItems={kebabDropdownItems} | ||
/> | ||
</ToolbarItem> | ||
<ToolbarItem visibility={{ default: 'visible', md: 'hidden', lg: 'hidden', xl: 'hidden', '2xl': 'hidden' }}> | ||
<Dropdown | ||
isPlain | ||
position="right" | ||
onSelect={this.onFullKebabSelect} | ||
toggle={<KebabToggle onToggle={this.onFullKebabToggle} />} | ||
isOpen={isFullKebabDropdownOpen} | ||
dropdownItems={fullKebabItems} | ||
/> | ||
</ToolbarItem> |
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.
All of the dropdowns/icon buttons go in the same base icon-button-group
for proper spacing.
<ToolbarGroup
variant="icon-button-group"
alignment={{ default: 'alignRight' }}
spacer={{ default: 'spacerNone', md: 'spacerMd' }}
>
<ToolbarItem>Bell</ToolbarItem>
<ToolbarItem>Cog</ToolbarItem>
<ToolbarItem>Help</ToolbarItem>
<ToolbarItem>Dropdown</ToolbarItem>
<ToolbarItem>Dropdown</ToolbarItem>
</ToolbarGroup>
Then place the user dropdown outside of the icon-button-group
<ToolbarItem visibility={{ default: 'hidden', md: 'visible' }}>
<Dropdown
position="right"
onSelect={this.onDropdownSelect}
isOpen={isDropdownOpen}
toggle={
<DropdownToggle icon={<Avatar src={imgAvatar} alt="Avatar" />} onToggle={this.onDropdownToggle}>
John Smith
</DropdownToggle>
}
dropdownItems={userDropdownItems}
/>
</ToolbarItem>
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.
I actually copied that from DashboardHeader.js
want me to go ahead and fix it there too? Or since that's not directly related would it be too out of scope for this refactor?
For now, I'll just fix it here. @mattnolting if you would like this fixed in DashboardHeader
under this PR as well just let me know and I'll add it in.
@wise-king-sullyman Oh, I see that now. It's a bit off in dashboard header as is. Toolbar groups and items can be nested infinitely, so having an
You could just fix here and we'll create a followup. Maybe DashboardHeader.js update could highlight its current implementation, with the user avatar dropdown outside, rather than inside, of the |
Co-authored-by: Matt Nolting <matthew.nolting@gmail.com>
Just realized that the three-dot dropdown isn't supposed to show at the same time as the help icon and settings gear, because it contains the help icon and settings gear. Also your comment about the nested group being allowed, and that the purpose is to hide those items together just clicked with me. I'm thinking the proper course of action moving forward is to add the nested toolbar group back in around the help and gear icons, with the appropriate visibility settings, and just keep the non-user dropdowns in the first tier of ToolbarGroups with the user dropdown outside of any ToolbarGroups. Is that correct/what you're looking for @mattnolting ? I figure it's worth checking in with you this time before I just assume that I'm understanding you correctly again. |
Awesome! 💯
Yep, you got it!
Perfect 👍 |
This reverts commit dfd8d51.
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.
LPTM! Excellent work @wise-king-sullyman 💎
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.
Looks good to me, too. Thanks @wise-king-sullyman !
headerTools={<PageHeaderTools>header-tools</PageHeaderTools>} | ||
topNav="Navigation" | ||
/> | ||
<Masthead display={{ default: 'stack' }} inset={{ default: 'insetXs' }}> |
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.
I don't think the forced stack display is needed here. The horizontal page indicates the navigation is inside the toolbar rather than in a separate sidebar.
What: Closes #6281
Additional issues: N/A
Refactors the Page examples to use Masthead and Toolbar rather than PageHeader and PageHeaderTools. One Page example using PageHeader was kept but relocated to be the last example.
A new Page demo was added using Masthead, the other demos were renamed to clarify that they're using PageHeader.