Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 35 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import React from 'react'; |
||
2 | import PropTypes from 'prop-types'; |
||
3 | import styled from 'styled-components'; |
||
4 | |||
5 | export class BasicButton extends React.PureComponent { |
||
6 | static propTypes = { |
||
7 | className: PropTypes.string, |
||
8 | func: PropTypes.func, |
||
9 | text: PropTypes.string, |
||
10 | }; |
||
11 | |||
12 | static defaultProps = {}; |
||
13 | |||
14 | render() { |
||
15 | const { className, text } = this.props; |
||
16 | const { func } = this.props; |
||
17 | return ( |
||
18 | <button className={className} type="button" onClick={() => func()}> |
||
19 | {text} |
||
20 | </button> |
||
21 | ); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | export default styled(BasicButton)` |
||
26 | height: 30px; |
||
27 | width: 120px; |
||
28 | border: none; |
||
29 | margin: 5px; |
||
30 | cursor: pointer; |
||
31 | font-size: 13px; |
||
32 | text-align: center; |
||
33 | background: lightgrey; |
||
34 | `; |
||
35 |