This commit is contained in:
Marcos Rodriguez Velez 2024-03-09 00:08:07 -04:00
parent 94ace88ba7
commit 32ce3525b8
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
2 changed files with 2 additions and 3 deletions

View File

@ -8,4 +8,4 @@ export interface ActionSheetOptions {
anchor?: number;
}
export type CompletionCallback = (buttonIndex: number) => void;
export type CompletionCallback = (buttonIndex: number) => void;

View File

@ -6,8 +6,7 @@ export default class ActionSheet {
static showActionSheetWithOptions(options: ActionSheetOptions, completion: CompletionCallback): void {
InteractionManager.runAfterInteractions(() => {
const alertOptions = options.options.map((option, index) => {
// Determine the style based on the button index
let style: 'default' | 'cancel' | 'destructive' = 'default'; // Default style
let style: 'default' | 'cancel' | 'destructive' = 'default';
if (index === options.destructiveButtonIndex) {
style = 'destructive';
} else if (index === options.cancelButtonIndex) {