expo / expo/react-native-action-sheet

Can't apply dark theme for action sheet in iOS

Open
#325 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.6k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

userInterfaceStyle: "dark" doesn't work for iOS.

Styling code is as this:

const ShowActionSheetButton = ({
imageUrl,
withTitle = false,
withMessage = false,
withIcons = false,
withSeparators = false,
withCancelButtonTintColor = false,
useModal = false,
onClose,
}) => {
const anchorRef = useRef(null);
const { showActionSheetWithOptions } = useActionSheet();

const showActionSheet = () => {
const options = ["Save", "Share", "Cancel"];
const icons = withIcons
? [icon("save"), icon("share"), icon("cancel")]
: undefined;
const titleOption = withTitle ? "Choose An Action" : undefined;
const messageOption = withMessage
? "This library tries to mimic the native share sheets as close as possible."
: undefined;
const containerStyle = {backgroundColor: "black"};
const tintColor = "white";
showActionSheetWithOptions(
{
options,
icons,
title: titleOption,
message: messageOption,
userInterfaceStyle: "dark", //Here is setting the interface, but it doesn't work
containerStyle,
tintColor,
cancelButtonIndex: 2,
showSeparators: withSeparators,
cancelButtonTintColor: withCancelButtonTintColor
? "#D93F0B"
: undefined,
useModal,
},
);
};

useEffect(() => {
if (imageUrl) {
showActionSheet();
}
}, [imageUrl]);
};

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.