-
Notifications
You must be signed in to change notification settings - Fork 0
YPE-1001: Add dark mode ability to BibleTextView React component #93
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
🦋 Changeset detectedLatest commit: be87934 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
- Add theme prop (light/dark) to BibleTextView for text theme control - Implement theme inheritance from YouVersionProvider via useTheme hook - Add data-yv-sdk and data-yv-theme attributes for CSS styling - Pass theme prop from BibleReader to BibleTextView - Add yv:bg-background wrapper to all BibleTextView Storybook stories - Rename prop from 'background' to 'theme' for semantic clarity
Added changeset for adding dark mode theme support to BibleTextView and BibleReader
01af498 to
ad6971e
Compare
Greptile SummaryThis PR adds dark mode support to the
The implementation is clean, follows existing patterns in the codebase, and properly handles theme fallbacks. All loading and error states are wrapped with the theme attributes ensuring consistent theming across all component states. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant BibleReader
participant BibleReaderContext
participant BibleTextView
participant useTheme
participant YouVersionProvider
participant DOM
User->>BibleReader: Renders with background prop
BibleReader->>useTheme: Call useTheme() hook
useTheme->>YouVersionProvider: Access YouVersionContext
YouVersionProvider-->>useTheme: Return theme ('light' or 'dark')
useTheme-->>BibleReader: Return providerTheme
BibleReader->>BibleReaderContext: Store theme = background || providerTheme
BibleReader->>DOM: Set data-yv-theme attribute
BibleReader->>BibleTextView: Pass theme prop
BibleTextView->>useTheme: Call useTheme() hook
useTheme->>YouVersionProvider: Access YouVersionContext
YouVersionProvider-->>useTheme: Return theme ('light' or 'dark')
useTheme-->>BibleTextView: Return providerTheme
BibleTextView->>BibleTextView: Compute currentTheme = theme || providerTheme
BibleTextView->>DOM: Wrap with div[data-yv-sdk][data-yv-theme]
DOM-->>User: Rendered with theme-aware CSS
|
bmanquen
left a comment
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.
One small comment, great work!
Jira Ticket: https://lifechurch.atlassian.net/browse/YPE-1001
The goal of this is to add dark mode ability to the BibleTextView React component. It's a little odd trying to figure this one out because it requires updating the actual component itself. And so updating the component and not just the story requires me to say that this is a minor bump in the change set for the package. But it was fun to work on.
This change also results in BibleReader needing to be updated as well. And so I did a small update for BibleReader.