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

Can't apply dark theme for action sheet in iOS #325

Open
Alexeichua opened this issue Jun 16, 2024 · 0 comments
Open

Can't apply dark theme for action sheet in iOS #325

Alexeichua opened this issue Jun 16, 2024 · 0 comments

Comments

@Alexeichua
Copy link

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]);
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant