-
Notifications
You must be signed in to change notification settings - Fork 22
making the radio button a touch target for the thread select screen #713
making the radio button a touch target for the thread select screen #713
Conversation
Awesome, thanks for the PR @saranrapjs! Looking at the code now, I think there's a (more) simple fix. Will insert a couple comments. |
{ selected && <Image style={styles.buttonImage} source={require('./statics/check.png')} /> } | ||
{ selected && <View style={[styles.buttonSelected, disabled && styles.buttonDisabled]} /> } | ||
</TouchableOpacity> | ||
) | ||
} | ||
|
||
RadioButton.defaultProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, this component is just a simple stateless component. It's a function that takes in props and return a component. Setting defaultProps
has no effect I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stateless components are no different from class components: they will pull in static properties like defaultProps
/propTypes
in the same way. I wasn't exactly sure where all else this radio button was being used, & had wanted to have a default in case!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow cool, didn't know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you have any questions about that. Just seems like the simple solution. Easier to understand than passing a callback to two different components, one nested inside the other.
textile is great! i've honestly waiting for something like this to bubble up and am excited to see how usable it is even for not p2p heads like me :)
this PR fixes something i ran into when initially poking around in the app, where tapping on the radio button in the "Thread select" view for an image wouldn't select the corresponding thread. hopefully uncontroversial, but let me know if there's anything i should do differently