MCPcopy Create free account
hub / github.com/0wczar/airframe-react / InputGroupAddon

Function InputGroupAddon

app/components/InputGroupAddon/InputGroupAddon.js:8–27  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

6} from 'reactstrap';
7
8const InputGroupAddon = (props) => {
9 const { children, ...otherProps } = props;
10 const childArr = React.Children.toArray(children);
11 const isFa = _.some(childArr, (child) =>
12 React.isValidElement(child) && child.props.className && _.includes(child.props.className, 'fa'));
13 const isCheckRadio = _.some(childArr, (child) =>
14 React.isValidElement(child) && (child.props.type === 'radio' || child.props.type === 'checkbox'));
15
16 let child = isFa || isCheckRadio ? (
17 <div className="input-group-text">
18 { children }
19 </div>
20 ) : children;
21
22 return (
23 <BsInputGroupAddon { ...otherProps }>
24 { child }
25 </BsInputGroupAddon>
26 );
27}
28InputGroupAddon.propTypes = {
29 ...BsInputGroupAddon.propTypes
30};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected