idibidiart/react-native-responsive-grid

Parameterize cutoff points

peacechen opened this issue · 1 comments

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?

Added in #23