-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(AppFrame): mobile view and MobileNavigation component #1319
Conversation
@@ -44,6 +44,7 @@ export const NavigationItem: React.FC<INavigationItemProps> = ({ | |||
isActive, | |||
onClick, | |||
className, | |||
isMobile, |
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.
Do we need to add this prop? Can't we imply this from its wrapper MobileNavigation
?
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.
Moved that flag to the AppFrameContext
@@ -87,6 +89,7 @@ export const NavigationItem: React.FC<INavigationItemProps> = ({ | |||
{...props} | |||
> | |||
{icon} | |||
{isMobile && label} |
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.
Instead of using separate prop isMobile, I'd use only the label and show it when this component placed inside of MobileNavigation
.
id="item-1" | ||
label="Item 1" | ||
icon={<div>Icon</div>} | ||
url="#" |
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.
The url
prop is optional, you do not need to pass it.
@@ -30,30 +32,39 @@ const Frame = (props: IAppFrameProps) => { | |||
isVisible: isSideNavigationVisible, | |||
elementRef: sideNavWrapperRef, | |||
}); | |||
const { isMobile, handleResize } = useMobileViewDetector({ |
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.
To avoid confusing the name handleResize
with a function, I'd suggest to add it for example: handleResizeRef
@@ -31,6 +35,10 @@ export interface IAppFrameProps extends ComponentCoreProps { | |||
* The CSS class for the content container | |||
*/ | |||
contentClassName?: string; | |||
/** |
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.
Please add information about default value
Resolves: #1289
Description
Mobile view for
AppFrame
.Added required prop
mobileNavigation
andMobileNavigation
component (act asNavigation
but for mobile view).UI changes related to the mobile view (top bars overlap the view).
Storybook
https://feature-1289--613a8e945a5665003a05113b.chromatic.com
Checklist
Obligatory: