Skip to content

Instantly share code, notes, and snippets.

@vojtatranta
Created November 30, 2016 10:53
Show Gist options
  • Save vojtatranta/fa55bde2c06c3921329ffdf343cd5c48 to your computer and use it in GitHub Desktop.
Save vojtatranta/fa55bde2c06c3921329ffdf343cd5c48 to your computer and use it in GitHub Desktop.
// před tim
<TouchableOpacity onPress={() => this.handleToggleDay('Mo')} style={[styles.weekIcontouch, this.selected('Mo')]}>
<Text style={[styles.weekIcon, this.selectedText('Mo')]}>{I18n.t('_general.week.mondayShort')}</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.handleToggleDay('Tu')}>
<Text>{I18n.t('_general.week.tuesdayShort')}</Text>
</TouchableOpacity>
... a dalsi dny v tydnu
//komponenta
class TouchableDay extends React.Component {
_handlePress = () => {
this.props.onDayPress(this.props.dayCode)
}
return() {
return (
<TouchableOpacity onPresst={this._handlePress} style={this.props.style}>
{this.props.children}
</TouchableOpacity>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment