-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #311 #315
base: react-native-app-prototype
Are you sure you want to change the base?
fixes #311 #315
Conversation
<View style={{ marginTop: 15 }}> | ||
<Text style={styles.infoTitle}>{title.toUpperCase()}</Text> | ||
<TouchableOpacity style={styles.infoTextWrapper} onPress={onPress}> | ||
{icon && <Image source={icon} style={styles.image} resizeMode="contain"/>} | ||
<Text style={styles.text}>{text}</Text> | ||
{arrow && <Image source={arrow} style={styles.arrow} resizeMode="contain"/>} | ||
{!!(counter || counter === 0) && |
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.
Can counter be non-numeric or why is this check needed?
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.
Zero value will be treated as falsy and React will try to render it outside of Text tag, which will cause an error.
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.
Sure, but the check allows any truthy value or zero, only excluding null and undefined. If those values are not possible, the whole check is redundant.
} | ||
|
||
render() { | ||
const { teams, loading } = this.props; | ||
const { teams, loading, isAuthenticated, isGuestSession } = this.props; | ||
if (!isAuthenticated && isGuestSession) return this.renderGuestTeams(); |
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.
Please, add PropTypes for teams, loading, isAuthenticated, isGuestSession
No description provided.