breeffy/react-native-monorepo

Allow dynamically-sized width

nandorojo opened this issue · 1 comments

At the moment, the calendar uses a static windowWidth variable. This prevents you from making custom-width calendar sizes. Ideally you could pass in a width prop. The best-case-scenario would be to wrap the calendar in a View and use onLayout to stretch its size, although this would result in a flash of hiding it, so perhaps it should just be handled by the user if they want that.

Also, rather than Dimensions.get('window').width, it should use useWindowDimensions so that the state updates if the width changes, such as a phone rotation.

@nandorojo When it comes to Dimensions.get('window').width I remember I had some issues / bugs with it and had to revert back to using Dimensions.get('window').width.