grapp-dev / stacks

A set of components for building layouts in React Native. Powered by React Native Unistyles.
https://stacks.grapp.dev
MIT License
982 stars 24 forks source link

Grid not working as expected #28

Closed oliverdolgener closed 3 years ago

oliverdolgener commented 3 years ago

First of all thank you so much for this awesome library. We're starting to use it in our production app and we're already loving it.

We notice some unexpected behaviour while playing around with the Grid component.

That makes it a bit hard to work with. Maybe you could have a look.

We use it like that:

<StacksProvider spacing={4} breakpoints={{ tablet: 600, desktop: 940 }}>
  {... Navigators & Stuff}
  <Grid columns={4} gutter={8} margin={16} />
</StacksProvider>

As you can see it applies 16px of margin to the right side but uses 8px of gutter for the left side. We were expecting margin to be applied to both sides.

Thanks in advance!

mobily commented 3 years ago

@oliverdolgener hey! thanks for reporting this issue :) to be honest, after rewriting to ReScript I didn't check if the Grid component works fine πŸ™ˆ

mobily commented 3 years ago

@oliverdolgener πŸ‘‹ Grid calculations have been fixed in v1.3.1, now it accepts the ResponsiveProp format and multiplied values (instead of "real" ones) 😊 see the screenshot below, I'm using the same values as you provided in the original post: <Grid columns={4} gutter={8} margin={16} /> (edit: it's of course: <Grid columns={4} gutter={2} margin={4} />)

CleanShot 2021-09-19 at 12 06 01@2x