feat: add backgroundColor property to CourierInboxTheme#43
Draft
feat: add backgroundColor property to CourierInboxTheme#43
Conversation
Adds a new optional backgroundColor property to the CourierInboxTheme TypeScript
interface and bridges it to both native iOS and Android implementations.
Usage:
const theme: CourierInboxTheme = {
backgroundColor: '#0C111D',
// ...other theme properties
};
This allows users to customize the background color of the entire inbox view,
including tabs, message lists, and scroll areas on both platforms.
Requires corresponding changes in:
- trycourier/courier-ios (backgroundColor on CourierInboxTheme)
- trycourier/courier-android (backgroundColor on CourierInboxTheme)
Resolves #32
Co-authored-by: Mike Miller <mike@mikemiller.design>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new optional
backgroundColorproperty toCourierInboxThemethat allows users to customize the background color of the entire inbox view on both iOS and Android.Resolves #32
Problem
Users cannot set the background color of the inbox. The issue reporter tried various approaches including
components.messageList.container.backgroundColorbut nothing works because the theme has nobackgroundColorfield.Solution
Added
backgroundColor?: stringto theCourierInboxThemeTypeScript interface and bridged it to both native platforms:src/models/CourierInboxTheme.tsx): AddedbackgroundColor?: stringto theCourierInboxThemeinterfaceios/CourierInboxReactNativeManager.swift): Maps thebackgroundColorstring from the RN theme dictionary to the nativeCourierInboxThemeconstructorandroid/src/main/java/com/courierreactnative/CourierInboxViewManager.kt): Maps thebackgroundColorstring from the RN theme ReadableMap to the nativeCourierInboxThemeconstructorDocs/2_Inbox.md): Updated the styled inbox example to show the new propertyUsage
Dependencies
This PR requires corresponding changes in the native SDKs to add the
backgroundColorproperty toCourierInboxTheme:backgroundColor: UIColor?toCourierInboxThemeand apply it to the inbox's stack view, scroll view, table view, and tab bar. Changes are prepared in branchcursor/add-inbox-background-color-d185(pending push access).@ColorInt backgroundColor: Int?toCourierInboxThemeand apply it to the root layout, tab layout, recycler view, and swipe refresh layout. Changes are prepared in branchcursor/add-inbox-background-color-d185(pending push access).The native SDK versions referenced by this package (
Courier_iOS 5.8.0andcourier-android 5.3.0) will need to be updated to versions that include thebackgroundColorproperty.Files Changed
src/models/CourierInboxTheme.tsxbackgroundColor?: stringto interfaceios/CourierInboxReactNativeManager.swiftbackgroundColorto native iOS themeandroid/src/main/java/com/courierreactnative/CourierInboxViewManager.ktbackgroundColorto native Android themeDocs/2_Inbox.mdbackgroundColor