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: add page layout, header, panel #56

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

fran-ink
Copy link
Contributor

@fran-ink fran-ink commented Dec 3, 2024

⚠️ Do not merge this yet, I want a PR branch to test some thing 😄

But basically, adds a couple of layout components to help users have a consistent experience through the apps. I still wanted to keep it very flexible, so the structure is the following:

<InkLayout {...navProps}>
  <InkPageLayout columns={1 | 2 | 3}>
     <InkPanel>Stuff in column one</InkPanel>
     <InkPanel>
          <InkHeader title="Header for Panel 2" />
         <div>Stuff in column two</div>
     </InkPanel>
     ...
  </InkPageLayout>
</InkLayout>

I noticed the layout for the app was the same as the Modal, so this structure also allows us to reuse the Panel and Header components for the Modal.

You can also center the panel with centered: true. What is really nice is if you have one element, it will center it. But if you have two, it will keep the header at the top, but center the second one. I think this makes for a very nice experience.

I know it's like... 3 layers of nested components, but I do prefer the way we can compose a layout with all of them, and it still allows people to inject their own layout, but still reuse the panels.

@fran-ink fran-ink requested a review from a team as a code owner December 3, 2024 20:55
@fran-ink fran-ink force-pushed the feat/ink-page-layout branch from 74de668 to 92c8261 Compare December 3, 2024 20:56
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-56.d2yrqj5dnlvopf.amplifyapp.com

@fran-ink fran-ink force-pushed the feat/ink-page-layout branch from 92c8261 to 1ffd3cb Compare December 4, 2024 15:00
@fran-ink fran-ink merged commit 67e6010 into main Dec 5, 2024
5 checks passed
@fran-ink fran-ink deleted the feat/ink-page-layout branch December 5, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant