Skip to content
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

feat: Add tintColor prop to Image component #34534

Conversation

gabrieldonadel
Copy link
Collaborator

Summary

This adds the tintColor prop to the Image component to replace the non-standard style.tintColor as requested on #34424, so that React Native for Web does not have to deopt styles for Image rendering. I didn't have to change anything on Android as tintColor was already being passed down to the native component as a prop. This PR also updates RNTester ImageExample in order to facilitate the manual QA.

Changelog

[General] [Added] - Add tintColor prop to Image component

Test Plan

  1. Open the RNTester app and navigate to the Image page
  2. Test the tintColor prop through the Tint Color section
Screen.Recording.2022-08-30.at.10.07.40.mov

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Aug 30, 2022
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Aug 30, 2022
@analysis-bot
Copy link

analysis-bot commented Aug 30, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,618,411 -16,010
android hermes armeabi-v7a 7,032,642 -13,701
android hermes x86 7,918,495 -17,781
android hermes x86_64 7,892,105 -16,023
android jsc arm64-v8a 9,495,505 -16,335
android jsc armeabi-v7a 8,273,117 -14,012
android jsc x86 9,433,307 -18,115
android jsc x86_64 10,026,303 -16,341

Base commit: 10ea6fb
Branch: main

@facebook-github-bot
Copy link
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

analysis-bot commented Aug 30, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 10ea6fb
Branch: main

@@ -14,6 +14,7 @@ import type {SyntheticEvent, LayoutEvent} from '../Types/CoreEventTypes';
import type {EdgeInsetsProp} from '../StyleSheet/EdgeInsetsPropType';
import type {ImageSource} from './ImageSource';
import type {ViewStyleProp, ImageStyleProp} from '../StyleSheet/StyleSheet';
import type {____ColorValue_Internal} from '../StyleSheet/StyleSheetTypes';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll want to import the type like this:

import type {ColorValue} from './StyleSheet';

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've just updated it.

@facebook-github-bot
Copy link
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gabrieldonadel in 7a6f0e4.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 31, 2022
@gabrieldonadel gabrieldonadel deleted the feat/add-tint-color-to-image branch August 31, 2022 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Needs TypeScript Update Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants