Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => {
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
destructiveButtonIndex: BUTTONS.length - 2,
// title: '标题',
message: '我是描述我是描述',
maskClosable: true,
'data-seed': 'logId',
},
(buttonIndex) => {
this.setState({ actionSheet: BUTTONS[buttonIndex] });
});
}
}
showActionSheet = () => {
const BUTTONS = ['切换账号', '找回密码', '注册', '关闭', '取消'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
destructiveButtonIndex: BUTTONS.length - 2,
// title: 'title',
maskClosable: true,
'data-seed': 'logId',
wrapProps,
},
(buttonIndex) => {
if (buttonIndex === 2) {
this.props.history.replace("/register")
}
});
}
render() {
showActionSheet = () => {
const BUTTONS = ['登录', '关闭', '取消'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS,
cancelButtonIndex: BUTTONS.length - 1,
destructiveButtonIndex: BUTTONS.length - 2,
// title: 'title',
maskClosable: true,
'data-seed': 'logId',
wrapProps,
},
(buttonIndex) => {
if (buttonIndex === 0) {
this.props.history.replace("/login")
}
});
}
return new Promise(resolve => {
ActionSheet.showActionSheetWithOptions(
{
options: [...params.items, params.cancelButtonText || '取消'],
cancelButtonIndex: params.items.length - 1,
destructiveButtonIndex: params.destructiveBtnIndex,
message: params.title,
maskClosable: false,
},
index => {
const result = { index };
if (params.success) {
params.success(result);
} else {
resolve(result);
}
if (params.complete) {
params.complete();
showFilter() {
const BUTTONS = ['All', 'Log', 'Info', 'Warn', 'Error'];
ActionSheet.showActionSheetWithOptions({
options: BUTTONS
}, (i) => {
if (!BUTTONS[i]) {
return
}
logStore.changeLogType(BUTTONS[i])
});
}
renderLogList() {
showActionSheet = () => {
const BUTTONS = [
'Operation1',
'Operation2',
'Operation3',
'Delete',
'Cancel',
];
ActionSheet.showActionSheetWithOptions(
{
title: 'Title',
message: 'Description',
options: BUTTONS,
cancelButtonIndex: 4,
destructiveButtonIndex: 3,
},
(buttonIndex: any) => {
this.setState({ clicked: BUTTONS[buttonIndex] });
},
);
}
showShareActionSheet = () => {