1import React from 'react';
2import PropTypes from 'prop-types';
3import ProtoInput from './ProtoInput';
5const Input = props => {
6 const _disabled = props.disabled === true ? 'br-gray-30' : '';
8 // This enables all children of this component to share the state of this
10 const childrenWithProps = React.Children.map(props.children, child => {
12 displayPass: props.displayPass,
13 displayFailure: props.displayFailure,
14 focussed: props.focussed,
15 beenFocussed: props.beenFocussed,
18 return React.cloneElement(child, propsToPass);
21 const className = props.advanced
22 ? `${props.valClassname} ${props.className}`
23 : `br-gray-50 f-br-blue outline-blue ${props.className}`;
26 <div className={'relative'}>
29 // prop-focussed={props.focussed.toString()}
30 className={`p-3 b-2 b-solid flex ${_disabled} ${className}`}
31 onChange={e => props.onChange(e.target.value)}
33 {props.displayFailure === true && props.advanced === true ? (
34 <div className={'yellow text-600 h-6 mt-1 fs-3'}>{props.error}</div>
44 focussed: PropTypes.bool,
45 beenFocussed: PropTypes.bool,
46 hasSubmitted: PropTypes.bool,
47 displayPass: PropTypes.bool,
48 displayFailure: PropTypes.bool,
49 advanced: PropTypes.bool,
50 error: PropTypes.string,
51 valClassname: PropTypes.string,
52 size: PropTypes.oneOf(['s', 'm', 'l', 'xl']),
60 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