-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
42 lines (37 loc) · 1.07 KB
/
App.js
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
import React from 'react';
import 'devextreme/dist/css/dx.common.css';
import 'devextreme/dist/css/dx.light.css';
import DropDownButton from 'devextreme-react/drop-down-button';
const actions = [
{ id: 1, text: 'My profile', icon: 'user' },
{ id: 2, text: 'Messages', icon: 'email' },
{ id: 3, text: 'Contacts', icon: 'group' },
{ id: 4, text: 'Log out', icon: 'runner' }
];
const dropDownOptions = {
height: 150
};
class App extends React.Component {
logAction(e) {
console.log(e.itemData.text + ' was clicked');
}
logButtonClick() {
console.log('Main button was clicked');
}
render() {
return (
<DropDownButton
text="Sandra Johnson"
icon="user"
items={actions}
keyExpr="id"
displayExpr="text"
onItemClick={this.logAction}
splitButton={true}
onButtonClick={this.logButtonClick}
dropDownOptions={dropDownOptions}
/>
);
}
}
export default App;