mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
01856633a1
Summary: we need to change the text color of the cancel button in `ActionSheetIOS` but `tintColor` changes the all button text color except `destructiveButtonIndex` so I have added `cancelButtonTintColor` prop to change only the text color of the cancel button ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Changed] - added `cancelButtonTintColor` prop for `ActionSheetIOS` to change only the text color of the cancel button Pull Request resolved: https://github.com/facebook/react-native/pull/31972 Test Plan: With this PR you can change the cancel text button of `ActionSheetIOS` by this `cancelButtonTintColor` prop | <img src="https://user-images.githubusercontent.com/36044436/128414537-c4454786-a5cf-49d2-8225-1ff26c9c5058.png" /> | <img src="https://user-images.githubusercontent.com/36044436/128414549-74a21509-711e-48e0-baf1-3718beae1598.png" /> | <img src="https://user-images.githubusercontent.com/36044436/128414559-4bee9d1a-ac9f-4cd2-b158-5c4c441158ec.png" /> | |-|-|-| Reviewed By: lunaleaps Differential Revision: D30878022 Pulled By: yungsters fbshipit-source-id: c70204f9f2510c75d8e9bed4e0fba79f1c941a1f
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
* @format
|
|
*/
|
|
|
|
import type {TurboModule} from '../TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
|
|
|
|
export interface Spec extends TurboModule {
|
|
+getConstants: () => {||};
|
|
+showActionSheetWithOptions: (
|
|
options: {|
|
|
+title?: ?string,
|
|
+message?: ?string,
|
|
+options: ?Array<string>,
|
|
+destructiveButtonIndices?: ?Array<number>,
|
|
+cancelButtonIndex?: ?number,
|
|
+anchor?: ?number,
|
|
+tintColor?: ?number,
|
|
+cancelButtonTintColor?: ?number,
|
|
+userInterfaceStyle?: ?string,
|
|
+disabledButtonIndices?: Array<number>,
|
|
|},
|
|
callback: (buttonIndex: number) => void,
|
|
) => void;
|
|
+showShareActionSheetWithOptions: (
|
|
options: {|
|
|
+message?: ?string,
|
|
+url?: ?string,
|
|
+subject?: ?string,
|
|
+anchor?: ?number,
|
|
+tintColor?: ?number,
|
|
+cancelButtonTintColor?: ?number,
|
|
+excludedActivityTypes?: ?Array<string>,
|
|
+userInterfaceStyle?: ?string,
|
|
|},
|
|
failureCallback: (error: {|
|
|
+domain: string,
|
|
+code: string,
|
|
+userInfo?: ?Object,
|
|
+message: string,
|
|
|}) => void,
|
|
successCallback: (completed: boolean, activityType: ?string) => void,
|
|
) => void;
|
|
}
|
|
|
|
export default (TurboModuleRegistry.get<Spec>('ActionSheetManager'): ?Spec);
|