react-native-navigation-drawer-extension icon indicating copy to clipboard operation
react-native-navigation-drawer-extension copied to clipboard

Using 'drawerScreenWidth' prop on landscape orientation

Open Danite opened this issue 4 years ago • 6 comments
trafficstars

I was wondering if there was a reason for setting the drawer width to a constant when the orientation is landscape and ignoring the drawerScreenWidth prop?

this.drawerWidth = this.isLandscape()
        ? MaxWidthOnLandscapeMode // <-- This constant
        : _resolveDrawerSize(props.drawerScreenWidth, this.screenWidth);

Danite avatar May 10 '21 10:05 Danite

Hmm, I'm not familiar with the reasoning behind this, maybe @rodriigovieira can answer that?

lukebrandonfarrell avatar May 10 '21 11:05 lukebrandonfarrell

Hello! I would like to add that drawerScreenHeight doesn't react on any value also.

definder avatar May 20 '21 14:05 definder

@Danite I'll investigate it next week, to see if there's something to be improved there.

Hello! I would like to add that drawerScreenHeight doesn't react on any value also.

Did that present any issues?

rodriigovieira avatar May 20 '21 15:05 rodriigovieira

@Danite I don't think the same width should be applied to the drawer when it is in both directions. For example, you might specify a width to use on landscape mode that's too big to be used on portrait mode, or a small width in portrait mode that would look weirdly small on landscape mode.

Ideally, I believe we should have two properties, one to define the width in landscape mode, and another to define it in portrait mode (this one we already have).

Sadly, I don't have time at this moment to work on this feature, but we're always welcome to PRs!

rodriigovieira avatar May 30 '21 20:05 rodriigovieira

@Danite if you make a PR for this, I'll be happy to review

lukebrandonfarrell avatar Jun 01 '21 12:06 lukebrandonfarrell

@rodriigovieira That's a good point, I also think that it would be better to have 2 properties for this kind of configuration, do you think that it should be defined also for the height? Thanks for the answer!

@lukebrandonfarrell I'll take a look!

Danite avatar Jun 01 '21 13:06 Danite