-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix: back handler for Drawer #5745
Changes from all commits
bf5b355
3753c9d
2fd9753
d438612
58f6d1e
0c1a2a8
a9c8908
7f8577d
902ca46
6340532
27ea073
94498c7
ab7113c
f249b08
b50b783
080ce7e
9fe64ea
05aa313
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,10 +52,11 @@ | |
"@react-native-masked-view/masked-view": "^0.2.4", | ||
"@react-native-picker/picker": "^1.9.11", | ||
"@react-navigation/compat": "^5.3.15", | ||
"@react-navigation/drawer": "6.1.4", | ||
"@react-navigation/native": "6.0.2", | ||
"@react-navigation/stack": "6.0.7", | ||
"@react-navigation/drawer": "6.1.7", | ||
"@react-navigation/native": "6.0.5", | ||
"@react-navigation/stack": "6.0.10", | ||
"babel-plugin-transform-remove-console": "^6.9.4", | ||
"babel-polyfill": "^6.26.0", | ||
"dotenv": "^8.2.0", | ||
"electron-context-menu": "^2.3.0", | ||
"electron-log": "^4.3.5", | ||
|
@@ -92,7 +93,7 @@ | |
"react-native-permissions": "^3.0.1", | ||
"react-native-picker-select": "8.0.4", | ||
"react-native-plaid-link-sdk": "^7.1.0", | ||
"react-native-reanimated": "^2.3.0-alpha.1", | ||
"react-native-reanimated": "^2.3.0-beta.3", | ||
Comment on lines
-95
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @Beamanator @parasharrajat this change here seems to have broken the Attachment Picker for me on iOS: https://expensify.slack.com/archives/C01GTK53T8Q/p1635874753343600 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, @kidroca this is PR is reverted now. Thanks for notifying me. |
||
"react-native-render-html": "6.0.0-beta.8", | ||
"react-native-safe-area-context": "^3.1.4", | ||
"react-native-screens": "^3.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import PropTypes from 'prop-types'; | ||
import {windowDimensionsPropTypes} from '../../../../components/withWindowDimensions'; | ||
|
||
const propTypes = { | ||
/** Screens to be passed in the Drawer */ | ||
screens: PropTypes.arrayOf(PropTypes.shape({ | ||
/** Name of the Screen */ | ||
name: PropTypes.string.isRequired, | ||
|
||
/** Component for the Screen */ | ||
component: PropTypes.elementType.isRequired, | ||
|
||
/** Optional params to be passed to the Screen */ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
initialParams: PropTypes.object, | ||
})).isRequired, | ||
|
||
/** Drawer content Component */ | ||
drawerContent: PropTypes.elementType.isRequired, | ||
|
||
/** If it's the main screen, don't wrap the content even if it's a full screen modal. */ | ||
isMainScreen: PropTypes.bool, | ||
|
||
/** Window Dimensions props */ | ||
...windowDimensionsPropTypes, | ||
}; | ||
|
||
export default propTypes; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import withWindowDimensions from '../../../../components/withWindowDimensions'; | ||
import BaseDrawerNavigator from './BaseDrawerNavigator'; | ||
import propTypes from './drawerNavigatorPropTypes'; | ||
|
||
const DrawerNavigator = props => ( | ||
<BaseDrawerNavigator | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
|
||
// On mobile web, the non-legacy (modern) version of the DrawerNavigator has issues opening and closing, | ||
// and the legacy version breaks the layout while resizing on desktop and web. | ||
// eslint-disable-next-line react/jsx-props-no-multi-spaces | ||
useLegacyImplementation={props.isSmallScreenWidth} | ||
/> | ||
); | ||
|
||
DrawerNavigator.propTypes = propTypes; | ||
DrawerNavigator.displayName = 'DrawerNavigator'; | ||
export default withWindowDimensions(DrawerNavigator); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import withWindowDimensions from '../../../../components/withWindowDimensions'; | ||
import BaseDrawerNavigator from './BaseDrawerNavigator'; | ||
import propTypes from './drawerNavigatorPropTypes'; | ||
|
||
const DrawerNavigator = props => ( | ||
<BaseDrawerNavigator | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
useLegacyImplementation={false} | ||
/> | ||
); | ||
|
||
DrawerNavigator.propTypes = propTypes; | ||
DrawerNavigator.displayName = 'DrawerNavigator'; | ||
export default withWindowDimensions(DrawerNavigator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, what needed
babel-polyfill
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/web-support. I don't know the consequences of removing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/web-support. I don't know the consequences of removing this.