Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Dashboard:
PageLayout
component #409Dashboard:
PageLayout
component #409Changes from 1 commit
bd1e73a
f64d6ad
1e2383e
720d91c
a533fbb
46c1fc4
590011f
eed479f
39ffbc7
2a72fc3
b11367c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm not a fan of props like this. Do we need these props? Since we are going to only use this layout in the
OverviewPage
I think we can render it directly and there is no need to pass them as props. Eg.If we want to follow your approach, I suggest splitting them into even smaller components.
And then in OverviewPage:
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.
With such approach you allow to render something else than expected in page layout which can break the layout. Render props is a useful pattern to ensure content to be rendered in specific place.
Wouldn't like to change it.
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 agree with Rafał here. I feel that we are unnecessarily complicating this layout. As he mentioned we can render it directly in
DashboardPage
. It is a simple layout with three columns. Additionally, I feel that we should not use the word sidebar here. Sidebars are used more to display various types of supplementary information for users. What I mean by that is that when I look at theleftSidebar
, I have a navigation bar popping up on the left side in my mind. But this may be my personal feelings.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.
What is complicated in a property which receives JSX that is rendered in a particular place?
The purpose of layout is to lay specific content out in specific place. By allowing
PageLayout
to render justchildren
so literally anything - it will no longer be a layout component - it will be a dummy wrapper.Agree,
PageLayoutAside
works here better.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.
IMO in the layout components props like
left*
/right*
/bottom*
etc. are misleading because it's not true for mobile-first approach. We do not render these components on the left or right but both on the bottom. If we render this layout directly in theDashboardPage
/OverviewPage
we can understand from the code what is displayed, where and when. Of course, there are cases where this makes sense, but I don't think that's the case here.This is more of an advantage than a disadvantage as it gives us flexibility if this is to be a reusable component 😄.
Why? It forces us to use a specific grid layout. You exactly do the same thing in
PageLayoutSidebar
. Unless I misunderstood something.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.
Ref commit: a533fbb