daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const ButtonWithComponent = (Comp) => props =>
  2. <TouchableOpacity
  3.   onPress={props.onPress}
  4.   style={{
  5.     paddingHorizontal: 10,
  6.     flexDirection: 'row',
  7.     justifyContent: 'flex-end',
  8.     alignItems: 'center'
  9.   }}
  10.   hitSlop={{ left: 5, right: 5, top: 5, bottom: 5 }}
  11. >
  12.   <Comp />
  13. </TouchableOpacity>;
  14.    
  15. const PencilButton = ButtonWithComponent(
  16.     <Icon name="pencil" color={APP_MAIN_COLOR} size={30} type="entypo" />
  17. );
  18.  
  19. class myClass extends Component {
  20.  
  21. ...
  22.  
  23. render() {
  24.     return (
  25.         <PencilButton />
  26.     );
  27. }
  28.  
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top