Sha256: 108765cb5e54e4b39761258dfd07435675d2e6599243fa070a07325c634e9e3a
Contents?: true
Size: 1.07 KB
Versions: 15
Compression:
Stored size: 1.07 KB
Contents
import React from 'react'; import PropTypes from "prop-types"; import classnames from 'classnames'; import Caption from "../pb_caption/_caption.jsx"; const propTypes = { className: PropTypes.string, name: PropTypes.string, label: PropTypes.string, placeholder: PropTypes.string, type: PropTypes.string, value: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]) }; const defaultProps = { type: "text" }; class Input extends React.Component { render() { const { className, name, label, placeholder, type, value } = this.props; const css = classnames([ `input_field`, className, ]) return ( <div className="pb_input"> <Caption text={label} /> <div className="input_wrapper"> <input className={css} name={name} placeholder={placeholder} type={type} value={value} /> </div> </div> ) } } Input.propTypes = propTypes; Input.defaultProps = defaultProps; export default Input;
Version data entries
15 entries across 15 versions & 1 rubygems