-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathButton.jsx
More file actions
36 lines (36 loc) · 828 Bytes
/
Button.jsx
File metadata and controls
36 lines (36 loc) · 828 Bytes
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
import React from 'react';
const styleMapping = {
primary: {
marginLeft: '10px',
color: '#fff',
backgroundColor: '#409eff',
borderColor: '#409eff',
padding: '12px 20px',
fontSize: '14px',
borderRadius: '4px',
outline: 'none',
border: '1px solid #dcdfe6',
cursor: 'pointer',
},
warning: {
marginLeft: '10px',
color: '#fff',
backgroundColor: '#e6a23c',
borderColor: '#e6a23c',
padding: '12px 20px',
fontSize: '14px',
borderRadius: '4px',
outline: 'none',
border: '1px solid #dcdfe6',
cursor: 'pointer',
},
};
export default class Button extends React.Component {
constructor(props) {
super(props);
}
render() {
var type = this.props.type || 'primary';
return <button style={styleMapping[type]}>{type} Button</button>;
}
}