Label.js 505 B

123456789101112131415161718192021222324
  1. import React from 'react'
  2. const labelStyle = {
  3. display: 'block',
  4. width: '165px',
  5. color: 'rgba(0, 0, 0, 0.65)',
  6. marginRight: '20px',
  7. marginBottom: '10px',
  8. }
  9. const labelName = {
  10. display: 'inline-block',
  11. width: '50px',
  12. }
  13. class Label extends React.PureComponent {
  14. render() {
  15. let {style, children, name} = this.props
  16. let mergedStyle = {...labelStyle, ...style}
  17. return <label style={mergedStyle}><span style={labelName}>{name}</span>{children}</label>
  18. }
  19. }
  20. export default Label