File size: 996 Bytes
5913525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* DO NOT EDIT

@todo This file is copied from GUI and should be pulled out into a shared library.

See https://github.com/LLK/scratch-paint/issues/13 */

/* NOTE:

Edited to add range prop

*/

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';

import styles from './input.css';

const Input = props => {
    const {small, range, ...componentProps} = props;
    return (
        <input

            {...componentProps}

            className={classNames(

                styles.inputForm,

                props.className,

                {

                    [styles.inputSmall]: small && !range,

                    [styles.inputSmallRange]: small && range

                }

            )}

        />
    );
};

Input.propTypes = {
    className: PropTypes.string,
    range: PropTypes.bool,
    small: PropTypes.bool
};

Input.defaultProps = {
    range: false,
    small: false
};

export default Input;