ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Swipe Left -> Right breaks the drawer

Open leesolway opened this issue 10 years ago • 2 comments

Hiya! So you think it's broken or missing a feature eh?

Welllllll, it just might be. Do me a favor and check the following.

  • [ ] Issue does not already exist
  • Identify exactly what aspect your issue is about
    • [x ] ignite base application
    • [ ] ignite the cli
    • [ ] ignite generated code

Also, for the quickest assistance please run ignite doctor and paste in everything (including the lines with 3 backticks).

Swiping from left to right reveals a small portion of the drawer, but breaks the application. The drawer does not open correctly and can not be closed.

leesolway avatar Sep 13 '16 09:09 leesolway

@leesolway can you post your NavigationDrawer.js?

lukabers avatar Sep 20 '16 08:09 lukabers


import React, { PropTypes, Component } from 'react'
import Drawer from 'react-native-drawer'
import { DefaultRenderer, Actions as NavigationActions } from 'react-native-router-flux'
import DrawerContent from '../Containers/DrawerContent'
import { connect } from 'react-redux'
import Styles from './Styles/NavigationDrawerStyle'

/* *******************
* Documentation: https://github.com/root-two/react-native-drawer
********************/

class NavigationDrawer extends Component {
  render () {
    const state = this.props.navigationState
    const children = state.children
    return (
      <Drawer
        ref='navigation'
        type='displace'
        open={state.open}
        onOpen={() => NavigationActions.refresh({key: state.key, open: true})}
        onClose={() => NavigationActions.refresh({key: state.key, open: false})}
        content={<DrawerContent />}
        styles={Styles}
        tapToClose
        openDrawerOffset={0.2}
        panCloseMask={0.2}
        negotiatePan
        tweenHandler={(ratio) => ({
          main: { opacity: Math.max(0.54, 1 - ratio) }
        })}
      >
        <DefaultRenderer navigationState={children[0]} onNavigate={this.props.onNavigate} />
      </Drawer>
    )
  }
}

NavigationDrawer.propTypes = {
  navigationState: PropTypes.object
}

const mapStateToProps = (state) => {
  return {
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(NavigationDrawer)

leesolway avatar Sep 28 '16 13:09 leesolway