-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature: Dark Mode Support #1 #243
Conversation
src/features/home/screen/index.tsx
Outdated
|
||
return ( | ||
<SafeAreaView style={styles.container}> | ||
<Text accessibilityRole={'text'} style={styles.title}> |
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.
<Text accessibilityRole={'text'} style={styles.title}> | |
<Text accessibilityRole="text" style={styles.title}> |
src/features/home/screen/index.tsx
Outdated
</Text> | ||
<Button | ||
accessibilityState={{ disabled: false }} | ||
title={'⚙️'} |
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.
title={'⚙️'} | |
title="⚙️" |
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.
Maybe another improvement would be create a useStyles or useThemedStyles hook that we could use to generate styles for any component just to avoid creating a function called useStyles that uses the useTheme to get access to the theme but WDYT?? @juanchoperezj
Nice work here!! 🚀
thumbColor={WHITE} | ||
ios_backgroundColor={WHITE} | ||
onValueChange={toggleTheme} | ||
value={currentTheme === ColorScheme.dark} |
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.
WDYT if we could add isDarkMode
to the useThemeConfig just to get that constant in all places 🤔
value={currentTheme === ColorScheme.dark} | |
value={isDarkMode} |
The base branch was changed.
I'll add this hook from the branch #244 but in a new one to narrow the number of files changed. |
be240cf
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.
Great work! Only left a few comments :)
src/features/home/screen/index.tsx
Outdated
return ( | ||
<SafeAreaView style={styles.container}> | ||
<Text accessibilityRole="text" style={styles.title}> | ||
Home Screen |
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.
This string could be moved to the locale :)
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.
Done!
<TouchableOpacity | ||
disabled={language === 'es'} | ||
onPress={() => onChangeLanguage('es')} | ||
style={[styles.button, language === 'es' && styles.disabledButton]}> | ||
<Text style={styles.buttonText}>Spanish</Text> | ||
</TouchableOpacity> |
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.
Why not making use of the button component?
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.
Fixed! I was using the following because of the styles, I didn't want to add other props to the button component because is not related to the PR changes.
<View style={styles.option}> | ||
<Text style={styles.optionTitle}>{translate('screen.settings.changeLanguage')}</Text> | ||
<Button | ||
title="Spanish" |
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 is no need to add language texts to the locale files, those could be handled differently according to the project's needs.
Pull request type
Description
Introducing Dark Mode Support using React Navigation Theme.
Note: This PR was started from the branch
feature/i18n
to take advantage of the Settings screen.Jira board reference
Notes:
Tasks:
Preview
UI Changes will be on the second part of this feature.