idibidiart / react-native-responsive-grid

Bringing the Web's Responsive Design to React Native
Other
379 stars 42 forks source link

Parameterize cutoff points #20

Closed peacechen closed 6 years ago

peacechen commented 6 years ago

The hard-coded cutoff points aren't a good fit for our use case. https://github.com/idibidiart/react-native-responsive-grid/blob/master/src/lib/ScreenInfo.js#L54

The code evaluates screen sizes <= 375 as small, 376-767 as medium, 768-1023 as large, etc. Medium tends to be the toughest, as it bleeds into the small range as well as large. The logic is a bit inconsistent since SMALL_Width is the upper cutoff point for small, but MEDIUM_Width sits in the middle of medium. LARGE_Width sits on the lower end of large.

I propose making the cutoffs consistent (all on the lower end or the upper end) and adding them as props. The change would be backwards compatible of course. Would a PR be accepted?

peacechen commented 6 years ago

Added in #23