INNER CODE UNIT · JavaScript
showActionSheet
zulip/zulip-mobile · src/action-sheets/index.js:886
function showActionSheet<Args: { _: GetText, ... }>(params: {
showActionSheetWithOptions: ShowActionSheetWithOptions,
options: Array<Button<Args>>,
args: Args,
...
}) {
const { showActionSheetWithOptions, options, args, ...rest } = params;
const titles = options.map(button => args._(button.title));
showActionSheetWithOptions(
{ ...rest, options: titles, cancelButtonIndex: titles.length - 1 },
makeButtonCallback(options, args),
);
}
export const showMessageActionSheet = (args: {|
showActionSheetWithOptions: ShowActionSheetWithOptions,
callbacks: {|
dispatch: Dispatch,