1import React from 'react';
2import PropTypes from 'prop-types';
3import ProtoTextarea from './ProtoTextarea';
5const Textarea = 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}`
30 <div className={'relative'}>
33 // prop-focussed={props.focussed.toString()}
34 className={`p-3 b-2 b-solid flex ${_disabled} ${className}`}
35 onChange={e => props.onChange(e.target.value)} />
37 props.displayFailure === true && props.advanced === true
38 ? <div className={'yellow text-600 h-6 mt-1 fs-3 abs'}>{props.error}</div>
49 focussed: PropTypes.bool,
50 beenFocussed: PropTypes.bool,
51 hasSubmitted: PropTypes.bool,
52 displayPass: PropTypes.bool,
53 displayFailure: PropTypes.bool,
54 advanced: PropTypes.bool,
55 error: PropTypes.string,
56 valClassname: PropTypes.string,
57 size: PropTypes.oneOf(['s', 'm', 'l', 'xl']),
61Textarea.defaultProps = {
66 displayFailure: false,
74export default Textarea;
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