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
fix(profile): navigate to AuthProfile for current user #263
fix(profile): navigate to AuthProfile for current user #263
Conversation
Previously the current user could find and follow himself from the search screen. Need to navigate the current user to auth profile screen. Closes: gitpoint#247
> | ||
<ImageContainerComponent | ||
style={styles.avatarContainer} | ||
const CorrectScreen = |
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.
Variable names are written in lowerCamelCase. And it's better to call the variable userScreen
.
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.
Ah, my bad. I'll fix it
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.
Everything is fine, small things need to be fixed.
onPress={() => | ||
navigation.navigate('Profile', { | ||
navigation.navigate(CorrectScreen ? 'AuthProfile' : 'Profile', { |
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.
You can just left CorrectScreen
, because we store the name of the screen, then you do not need a ternary operator.
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.
Got it
<ImageContainerComponent | ||
style={styles.avatarContainer} | ||
onPress={() => | ||
navigation.navigate(CorrectScreen ? 'AuthProfile' : 'Profile', { |
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.
Similarly, see above.
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.
👌
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.
Beautiful 😍 thank you matey!
Closes #247
UserListItem
component statefulstate.auth.user
AuthProfileScreen