1import React from 'react';
2import PropTypes from 'prop-types';
3import ProtoInput from './ProtoInput';
5const Input = props => {
7 const _disabled = props.disabled === true ? 'br-gray-30' : '';
9 // This enables all children of this component to share the state of this
11 const childrenWithProps = React.Children.map(props.children, child => {
13 displayPass: props.displayPass,
14 displayFailure: props.displayFailure,
15 focussed: props.focussed,
16 beenFocussed: props.beenFocussed,
19 return React.cloneElement(child, propsToPass)
22 const className = props.advanced
23 ? `${props.valClassname} ${props.className}`
24 : `br-gray-50 f-br-blue outline-blue ${props.className}`
28 <div className={'relative'}>
31 // prop-focussed={props.focussed.toString()}
32 className={`p-3 b-2 b-solid flex ${_disabled} ${className}`}
33 onChange={e => props.onChange(e.target.value)} />
35 props.displayFailure === true && props.advanced === true
36 ? <div className={'yellow text-600 h-6 mt-1 fs-3'}>{props.error}</div>
48 focussed: PropTypes.bool,
49 beenFocussed: PropTypes.bool,
50 hasSubmitted: PropTypes.bool,
51 displayPass: PropTypes.bool,
52 displayFailure: PropTypes.bool,
53 advanced: PropTypes.bool,
54 error: PropTypes.string,
55 valClassname: PropTypes.string,
56 size: PropTypes.oneOf(['s', 'm', 'l', 'xl']),
65 displayFailure: false,
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list