You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Mobile: Accessibility: Add checked/unchecked accessibility information to the "sort notes by" dialog (#11411)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { Alert, Platform } from 'react-native';
|
||||
import { DialogControl, DialogType, MenuChoice, PromptButton, PromptDialogData, PromptOptions } from '../types';
|
||||
import { DialogControl, DialogType, MenuChoice, PromptButtonSpec, PromptDialogData, PromptOptions } from '../types';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
import { useMemo, useRef } from 'react';
|
||||
|
||||
@ -32,7 +32,7 @@ const useDialogControl = (setPromptDialogs: SetPromptDialogs) => {
|
||||
}]);
|
||||
});
|
||||
},
|
||||
prompt: (title: string, message: string, buttons: PromptButton[] = defaultButtons, options?: PromptOptions) => {
|
||||
prompt: (title: string, message: string, buttons: PromptButtonSpec[] = defaultButtons, options?: PromptOptions) => {
|
||||
// Alert.alert doesn't work on web.
|
||||
if (Platform.OS !== 'web') {
|
||||
// Note: Alert.alert provides a more native style on iOS.
|
||||
@ -71,11 +71,11 @@ const useDialogControl = (setPromptDialogs: SetPromptDialogs) => {
|
||||
key: `menu-dialog-${nextDialogIdRef.current++}`,
|
||||
title: '',
|
||||
message: title,
|
||||
buttons: choices.map(choice => ({
|
||||
text: choice.text,
|
||||
buttons: choices.map(({ id, ...buttonProps }) => ({
|
||||
...buttonProps,
|
||||
onPress: () => {
|
||||
dismiss();
|
||||
resolve(choice.id);
|
||||
resolve(id);
|
||||
},
|
||||
})),
|
||||
onDismiss: dismiss,
|
||||
|
Reference in New Issue
Block a user