Completed
Pull Request — master (#132)
by
unknown
05:25
created

client/components/elements/basic-button.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 35
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 21
mnd 0
bc 0
fnc 1
dl 0
loc 35
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A BasicButton.render 0 8 1
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