Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show dynamic drawerWidth. #6

Open
HeroSony opened this issue Nov 6, 2019 · 5 comments
Open

Show dynamic drawerWidth. #6

HeroSony opened this issue Nov 6, 2019 · 5 comments

Comments

@HeroSony
Copy link

HeroSony commented Nov 6, 2019

After I test it on others device it looks like the behind drawer appeared, so how can we hide it or dynamically calculate drawerWidth?

image

@gaetanozappi
Copy link
Owner

gaetanozappi commented Nov 7, 2019

Hi @HeroSony ,

  • First of all there is a typology of question structure to make these kind of requests, and I took time to realize it, with various questions that help me to better understand how to help you.
    I would like to ask you to respect the documentation I wrote with commitment to the issues.
  • Second, please be more discursive to explain the problem.

If you publish the code it would be more helpful.

@HeroSony
Copy link
Author

Hi @gaetanozappi , thank for reply and sorry for not including the code.

DrawerComponent.js

...
render() {
    return (
       <NavigationDrawerLayout
        percent={68.1}
        //statusBar="#008cff"
        statusBarTransparency={0.3}
        type={this.state.type}
        drawerPosition="left"
        selected="opt0"
        window="menu"
        color="#fff"
        backgroundColor="#fff" //303030
        // imageBackground={{ uri: "https://c.wallhere.com/photos/aa/44/glare_colorful_bright_circles-679384.jpg!d" }}
        topBackgroundColor="#000"
        first={'name'}
        second={'phone'}
        badgeFunction={e => {
          return e > 99 ? '99+' : e
        }}
        account={[
          {
            username: 'kheansenghort',
            name: 'Kheang Senghort',
            email: 'khengsenghort@gmail.com',
            image: 'https://cdn1.iconfinder.com/data/icons/avatar-2-2/512/Casual_Man_2-512.png',
            phone: '0189702323',
            badgeText: '100',
            badgeColor: '#fff',
            badgeBackground: '#303030',
            circle: ['transparent', 'transparent'],
          },
        ]}
        menu={[
            {
              type: 'menu',
              name: 'history',
              title: 'History',
              icon: 'history',
              colorText: '#575757',
              colorTextFocus: '#607D8B',
              colorIcon: '#575757',
              colorIconFocus: '#607D8B',
              background: 'transparent',
              backgroundFocus: '#e8e8e8',
            },
        ]}
        onPress={e => {
          const { route } = e
          let params = {}
          console.log('Menu:', e)

          if (route) {
            this.props.navigation.navigate(route, params)
          }
        }}
        />
       )
  }
...

DrawerNavigator.js

...
export default createDrawerNavigator(
  {
    HomeStack: HomeStackNavigator,
    SettingsStack: SettingsStackNavigator,
    PaymentStack: PaymentStackNavigator,

  },
  {
    contentComponent: DrawerComponent,
    overlayColor: 'rgba(0, 0, 0, 0.5)',
    drawerBackgroundColor: 'rgba(255,255,255,0)',
  }
)

@gaetanozappi
Copy link
Owner

@HeroSony :

  • Does it happen on all tested devices?
  • What happens put percent = {75}?
  • Can you make a gif or video to see what happens and in what situation?
  • Try removing this:
    overlayColor: 'rgba(0, 0, 0, 0.5)'

If you can give me more information, I will be able to better understand the problem.

@HeroSony
Copy link
Author

Hello @gaetanozappi
Below images are tested on 2 devices:
I set percent = {75} and, removed overlayColor: 'rgba(0, 0, 0, 0.5)'

  • Galaxy Grand Prime (Drawer not yet open)
    image

  • Galaxy Grand Prime (Drawer opened)
    image

  • Samsung A50 (Drawer not yet open)
    image

  • Samsung A50 (Drawer opened)
    image

@gaetanozappi
Copy link
Owner

Hi @HeroSony , the problem you have is only Samsung A50?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants