-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleaned up code, fixed some arrow showing issues
- Loading branch information
1 parent
91a5a05
commit 8aaf7fe
Showing
3 changed files
with
98 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
export default ({children}) => children; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {Pressable} from 'react-native'; | ||
|
||
// Swipeable View is available just on Android/iOS for now. | ||
const propTypes = { | ||
/** this could be set to provide events */ | ||
onPress: PropTypes.func, | ||
|
||
/** can be set to provide styles */ | ||
styles: PropTypes.arrayOf(PropTypes.object), | ||
|
||
/** Children to render. */ | ||
children: PropTypes.oneOfType([ | ||
PropTypes.func, | ||
PropTypes.node, | ||
]).isRequired, | ||
}; | ||
|
||
const defaultProps = { | ||
onPress: () => {}, | ||
styles: [], | ||
}; | ||
|
||
// Swipeable View is available just on Android/iOS for now. Still need to utilize events | ||
function SwipeableView(props) { | ||
return ( | ||
<Pressable style={props.styles} onPress={props.onPress}> | ||
{props.children} | ||
</Pressable> | ||
); | ||
} | ||
|
||
SwipeableView.propTypes = propTypes; | ||
SwipeableView.defaultProps = defaultProps; | ||
|
||
export default SwipeableView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters