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

feat(AppFrame): mobile view and MobileNavigation component #1319

Merged
merged 9 commits into from
Sep 11, 2024

Conversation

marcinsawicki
Copy link
Contributor

@marcinsawicki marcinsawicki commented Sep 5, 2024

Resolves: #1289

Description

Mobile view for AppFrame.
Added required prop mobileNavigation and MobileNavigation component (act as Navigation 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:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add correct label
  • Assign pull request with the correct issue

@marcinsawicki marcinsawicki added feature New feature or request design UI/UX oriented issue labels Sep 5, 2024
@marcinsawicki marcinsawicki added this to the Cycle #9 milestone Sep 5, 2024
@marcinsawicki marcinsawicki self-assigned this Sep 5, 2024
@marcinsawicki marcinsawicki linked an issue Sep 5, 2024 that may be closed by this pull request
@@ -44,6 +44,7 @@ export const NavigationItem: React.FC<INavigationItemProps> = ({
isActive,
onClick,
className,
isMobile,
Copy link
Contributor

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?

Copy link
Contributor Author

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}
Copy link
Contributor

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="#"
Copy link
Contributor

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({
Copy link
Contributor

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;
/**
Copy link
Contributor

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

@marcinsawicki marcinsawicki merged commit 81ce453 into main Sep 11, 2024
3 of 5 checks passed
@marcinsawicki marcinsawicki deleted the feature/1289 branch September 11, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design UI/UX oriented issue feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[AppFrame] - Mobile view & SubscriptionNavigationItem
3 participants