-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default border to AccessoryView and fix style prop types
- Loading branch information
1 parent
560e9c4
commit 7a29bfc
Showing
4 changed files
with
85 additions
and
98 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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
TouchableOpacity, | ||
} from 'react-native'; | ||
|
||
import Arrow from '../Arrow'; | ||
|
||
const AccessoryArrowButton = ({ hidden = false, disabled = false, onPress, ...props }) => { | ||
if (hidden) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<TouchableOpacity | ||
disabled={disabled} | ||
style={props.style} | ||
onPress={onPress}> | ||
{ props.customButton ? props.customButton : ( | ||
<Arrow | ||
direction={props.direction} | ||
disabled={disabled} | ||
tintColor={props.tintColor} /> | ||
)} | ||
</TouchableOpacity> | ||
); | ||
} | ||
|
||
AccessoryArrowButton.propTypes = { | ||
customButton: PropTypes.element, | ||
tintColor: PropTypes.string.isRequired, | ||
direction: PropTypes.string.isRequired, | ||
disabled: PropTypes.bool.isRequired, | ||
hidden: PropTypes.bool.isRequired, | ||
onPress: PropTypes.func.isRequired, | ||
} | ||
|
||
export default AccessoryArrowButton; |