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

Add per-page layout #82

Merged
merged 1 commit into from
Dec 28, 2022
Merged

Add per-page layout #82

merged 1 commit into from
Dec 28, 2022

Conversation

AbdBarho
Copy link
Collaborator

This PR builds on the discussion in #76

Some layout fixes are necessary, mainly removing the h-full mx-auto.

@fozziethebeat
Copy link
Collaborator

I'll review this after my PR finally goes in.

Copy link
Collaborator

@fozziethebeat fozziethebeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Will approve after you've merged in my PR changes.

getLayout?: (page: React.ReactElement) => React.ReactNode;
};

export const getLayout = (page: React.ReactElement) => (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is pretty magical. Can you add some high level comments on how it works. My understanding is that any new page component should set a getLayout field and use this method. That'll use this one unified layout.

Should we name this as something a little more specific like getDefaultLayout in the situation where we have another layout?

Copy link
Collaborator Author

@AbdBarho AbdBarho Dec 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are totally right, I changed it now so it is the default global layout (you don't have to specify anything in the components), with the option of overriding if needed.

with the ability to be overridden per-page
@fozziethebeat fozziethebeat merged commit 43550f6 into LAION-AI:main Dec 28, 2022
@AbdBarho AbdBarho deleted the layout branch December 28, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants