forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContextualMenu.Header.Example.tsx
94 lines (90 loc) · 1.77 KB
/
ContextualMenu.Header.Example.tsx
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import * as React from 'react';
import { DefaultButton } from '@fluentui/react-next/lib/compat/Button';
import {
ContextualMenuItemType,
IContextualMenuProps,
IContextualMenuItem,
} from '@fluentui/react-next/lib/ContextualMenu';
export const ContextualMenuHeaderExample: React.FunctionComponent = () => {
return <DefaultButton text="Click for ContextualMenu" menuProps={menuProps} />;
};
const menuItems: IContextualMenuItem[] = [
{
key: 'Actions',
itemType: ContextualMenuItemType.Header,
text: 'Actions',
itemProps: {
lang: 'en-us',
},
},
{
key: 'upload',
iconProps: {
iconName: 'Upload',
style: {
color: 'salmon',
},
},
text: 'Upload',
title: 'Upload a file',
},
{
key: 'rename',
text: 'Rename',
},
{
key: 'share',
iconProps: {
iconName: 'Share',
},
subMenuProps: {
items: [
{
key: 'sharetoemail',
text: 'Share to Email',
iconProps: {
iconName: 'Mail',
},
},
{
key: 'sharetofacebook',
text: 'Share to Facebook',
},
{
key: 'sharetotwitter',
text: 'Share to Twitter',
iconProps: {
iconName: 'Share',
},
},
],
},
text: 'Sharing',
},
{
key: 'navigation',
itemType: ContextualMenuItemType.Header,
text: 'Navigation',
},
{
key: 'properties',
text: 'Properties',
},
{
key: 'print',
iconProps: {
iconName: 'Print',
},
text: 'Print',
},
{
key: 'Bing',
text: 'Go to Bing',
href: 'http://www.bing.com',
target: '_blank',
},
];
const menuProps: IContextualMenuProps = {
shouldFocusOnMount: true,
items: menuItems,
};