ShortcutItem.tsx
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';
import { BGScroll, Card, ListItem } from '../component/View';
import {
clearShortcutItems,
ShortcutItem,
setShortcutItems,
} from 'react-native-quick-actions';
import { NativeModules, Alert } from 'react-native';
const items: ShortcutItem[] = [
{
type: 'Library',
title: 'Shortcut',
subtitle: 'Show shortcut page',
userInfo: { url: 'ngplay://open.my.app/ShortcutItem?id=trigger' },
icon: 'Compose',
},
];
const ShortcutPage = () => {
return (
<BGScroll>
<Card round>
<ListItem title="set" onPress={() => setShortcutItems(items)} />
<ListItem title="clear" onPress={clearShortcutItems} />
<ListItem
title="post"
onPress={() => {
NativeModules.RNQuickActionManager.postLaunchOptions();
}}
/>
<ListItem
title="initial"
onPress={() => {
Alert.alert(
'',
JSON.stringify(NativeModules.RNQuickActionManager.initialAction)
);
}}
/>
</Card>
</BGScroll>
);
};
export default ShortcutPage;