-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add Light & Dark theme support #62
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
Conversation
Co-authored-by: pushpender-singh-ap <73298854+pushpender-singh-ap@users.noreply.github.com>
Co-authored-by: pushpender-singh-ap <73298854+pushpender-singh-ap@users.noreply.github.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
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.
Pull request overview
This PR implements a comprehensive light and dark theme system for the InkNest application, adding support for three theme modes (light, dark, and system) with Redux persistence and React Context for theme management.
Key Changes:
- Added theme infrastructure with color palettes, ThemeProvider context, and useTheme hook
- Integrated theme mode state in Redux with persistence support
- Updated Settings screen with theme toggle and partially applied theme colors throughout the UI
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Theme/colors.js | Defines light and dark color palettes with semantic tokens for backgrounds, text, navigation, buttons, and status colors |
| src/Theme/ThemeContext.js | Implements ThemeProvider component and useTheme hook for accessing theme colors and mode |
| src/Theme/index.js | Exports theme module public API |
| src/Redux/Reducers/index.js | Adds themeMode state management with setThemeMode action |
| src/Screens/Settings/index.js | Adds theme toggle UI with cycling modes and applies theme colors to some settings items |
| src/Navigation/BottomNavigation.js | Updates tab bar colors to use theme-aware colors |
| App.js | Integrates ThemeProvider into the application component hierarchy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| */ | ||
| export function useTheme() { | ||
| const context = useContext(ThemeContext); | ||
| if (!context) { |
Copilot
AI
Nov 25, 2025
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.
The check if (!context) will never be true because the ThemeContext is created with a default value (lines 13-17). This error handling won't work as intended. Consider removing the default value from createContext() (pass undefined instead) to make this check effective, or remove the check entirely if a default fallback is desired.
| settingsItem: '#FFFFFF', | ||
| settingsItemText: '#000000', |
Copilot
AI
Nov 25, 2025
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.
The dark theme colors for settingsItem (white) and settingsItemText (black) appear to be inverted. In dark mode, the background should be dark and text should be light, but here it's the opposite. This will result in white backgrounds with black text in dark mode, which contradicts the dark theme design. Consider changing settingsItem to a dark color (e.g., 'rgba(255, 255, 255, 0.05)') and settingsItemText to a light color (e.g., '#FFFFFF').
| settingsItem: '#FFFFFF', | |
| settingsItemText: '#000000', | |
| settingsItem: 'rgba(255, 255, 255, 0.05)', | |
| settingsItemText: '#FFFFFF', |
| alignItems: 'center', | ||
| justifyContent: 'space-between', | ||
| }} | ||
| onPress={handleThemeToggle}> |
Copilot
AI
Nov 25, 2025
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.
The theme toggle TouchableOpacity is missing accessibility properties. Consider adding accessibilityRole="button", accessibilityLabel, and accessibilityHint to improve screen reader support. For example:
accessibilityRole="button"
accessibilityLabel={`Theme: ${getThemeModeLabel(themeMode)}`}
accessibilityHint="Double tap to cycle through System, Light, and Dark theme modes"| onPress={handleThemeToggle}> | |
| onPress={handleThemeToggle} | |
| accessibilityRole="button" | |
| accessibilityLabel={`Theme: ${getThemeModeLabel(themeMode)}`} | |
| accessibilityHint="Double tap to cycle through System, Light, and Dark theme modes" | |
| > |
User description
Implements a theme system supporting Light, Dark, and System (follows device) modes with Redux persistence.
Changes
Theme Context (
src/Theme/)colors.js: Light/dark color palettes (backgrounds, text, navigation, buttons, status colors)ThemeContext.js: Provider component anduseTheme()hookuseColorScheme()when mode is "system"Redux Integration
themeModestate ('light' | 'dark' | 'system') with persistencesetThemeModeactionUI Updates
Usage
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
PR Type
Enhancement
Description
Implements complete light and dark theme system with Redux persistence
Adds ThemeProvider context for theme colors and mode management
Integrates theme support in Settings screen with mode toggle
Updates BottomNavigation and UI components to use theme colors
Supports system, light, and dark theme modes with automatic cycling
Diagram Walkthrough
File Walkthrough
colors.js
Define light and dark color palettessrc/Theme/colors.js
color tokens
and settings
ThemeContext.js
Create theme context and provider componentsrc/Theme/ThemeContext.js
context
preference
index.js
Export theme module public APIsrc/Theme/index.js
index.js
Add Redux theme mode state managementsrc/Redux/Reducers/index.js
index.js
Add theme toggle UI and apply theme colorssrc/Screens/Settings/index.js
modes
BottomNavigation.js
Apply theme colors to bottom navigationsrc/Navigation/BottomNavigation.js
tabBarInactiveTintColor
App.js
Integrate ThemeProvider into app rootApp.js
PaperProvider