feat(profile): add settings navigation button to profile page#5
feat(profile): add settings navigation button to profile page#5
Conversation
Move settings button from hidden header to visible location in the BasicBoard gradient header. The previous implementation relied on navigation.setOptions which didn't work since headerShown is false. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of ChangesHello @AnnatarHe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new settings navigation button directly within the profile page's Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully moves the settings button from the navigation header into the BasicBoard component on the profile page. The code changes are clean, including the removal of unused imports and the old header button logic. I've added a couple of suggestions to improve accessibility and TypeScript type safety. Overall, great work on this feature!
| <TouchableOpacity | ||
| onPress={props.onSettingsPress} | ||
| style={styles.settingsButton} | ||
| > | ||
| <Text style={styles.settingsIcon}>⚙︎</Text> | ||
| </TouchableOpacity> |
There was a problem hiding this comment.
For better accessibility, especially for screen reader users, it's a good practice to add accessibilityLabel and accessibilityRole to icon-only buttons.
<TouchableOpacity
onPress={props.onSettingsPress}
style={styles.settingsButton}
accessibilityRole="button"
accessibilityLabel="Settings"
>
<Text style={styles.settingsIcon}>⚙︎</Text>
</TouchableOpacity>
| const handleSettingsPress = useCallback(() => { | ||
| (navigation as any).navigate(RouteKeys.ProfileSettings) | ||
| }, [navigation]) |
There was a problem hiding this comment.
To avoid using as any and to leverage TypeScript's type safety, it's better to type the navigation object. You can achieve this by providing a generic type to the useNavigation hook.
First, update your imports:
import { NavigationProp, useNavigation } from '@react-navigation/native';
import { RouteKeys, RouteParamList } from '../../routes';Then, update the useNavigation call where navigation is declared:
const navigation = useNavigation<NavigationProp<RouteParamList>>();This will provide full type safety for navigation actions.
| const handleSettingsPress = useCallback(() => { | |
| (navigation as any).navigate(RouteKeys.ProfileSettings) | |
| }, [navigation]) | |
| const handleSettingsPress = useCallback(() => { | |
| navigation.navigate(RouteKeys.ProfileSettings) | |
| }, [navigation]) |
Summary
Test plan
🤖 Generated with Claude Code