Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ The below props allow modification of the Android ActionSheet. They have no effe
| showSeparators | boolean | No | false |
| containerStyle | ViewStyle | No | |
| separatorStyle | ViewStyle | No | |
| useModal | boolean | No | false |
| destructiveColor | string | No | #d32f2f |

#### `icons` (optional)

Expand Down Expand Up @@ -150,6 +150,9 @@ Modify the look of the separators rather than use the default look.
#### `useModal`: (optional)
Wrap the ActionSheet with a Modal, in order to show in front of other Modals that were already opened ([issue reference](https://github.com/expo/react-native-action-sheet/issues/164)).

#### `destructiveColor`: (optional)
Modify color for text of destructive option.

## Try it out

Try it in Expo: https://expo.io/@community/react-native-action-sheet-example
Expand Down
3 changes: 2 additions & 1 deletion src/ActionSheet/ActionGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export default class ActionGroup extends React.Component<Props> {
options,
icons,
destructiveButtonIndex,
destructiveColor = DESTRUCTIVE_COLOR,
onSelect,
startIndex,
length,
Expand All @@ -92,7 +93,7 @@ export default class ActionGroup extends React.Component<Props> {
const defaultColor = tintColor
? tintColor
: (textStyle || {}).color || BLACK_87PC_TRANSPARENT;
const color = i === destructiveButtonIndex ? DESTRUCTIVE_COLOR : defaultColor;
const color = i === destructiveButtonIndex ? destructiveColor : defaultColor;
const iconSource = icons != null ? icons[i] : null;

optionViews.push(
Expand Down
2 changes: 2 additions & 0 deletions src/ActionSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default class ActionSheet extends React.Component<Props, State> {
icons,
tintIcons,
destructiveButtonIndex,
destructiveColor,
textStyle,
tintColor,
title,
Expand Down Expand Up @@ -135,6 +136,7 @@ export default class ActionSheet extends React.Component<Props, State> {
icons={icons}
tintIcons={tintIcons === undefined ? true : tintIcons}
destructiveButtonIndex={destructiveButtonIndex}
destructiveColor={destructiveColor}
onSelect={this._onSelect}
startIndex={0}
length={optionsArray.length}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export interface ActionSheetOptions extends ActionSheetIOSOptions {
containerStyle?: ViewStyle;
separatorStyle?: ViewStyle;
useModal?: boolean;
destructiveColor?: string;
}