Instantly share code, notes, and snippets.
-
mastra.ai
- San Francisco
- mastra.ai
- @AbhiAiyer
abhiaiyer91
/ rn-button.jsx
Last active
April 4, 2017 19:40
— forked from GollyJer/rn-button.js
React Native Button
This file contains hidden or 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
import React from 'react'; | |
import { withProps } from 'recompose'; | |
import { Text, TouchableNativeFeedback, TouchableOpacity, View, Platform } from 'react-native'; | |
import styles from './styles.js'; | |
function Button({ Component, buttonStyle, textStyle, onPress, title, disabled }) { | |
return ( | |
<Component disabled={disabled} onPress={onPress}> | |
<View style={buttonStyle}> | |
<Text style={textStyle}>{title}</Text> |
abhiaiyer91
/ rn-button.js
Created
April 4, 2017 19:38
— forked from GollyJer/rn-button.js
React Native Button
This file contains hidden or 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
import React from 'react'; | |
import { Text, TouchableNativeFeedback, TouchableOpacity, View, Platform } from 'react-native'; | |
import styles from './styles.js'; | |
const Button = ({ color, onPress, title, disabled }) => { | |
let Touchable; | |
const buttonStyle = [styles.button]; | |
const textStyle = [styles.text]; | |
switch (Platform.OS) { |