mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
16.14.2019 cd16cb6eed9f2efda538555ba3d8ab6381d94735
Layout issues regarding fieldLength prop.
2 files modified
16 ■■■■ changed files
borgbutler-webapp/src/components/general/forms/FormComponents.jsx 7 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/general/forms/FormSelect.jsx 9 ●●●● patch | view | raw | blame | history
borgbutler-webapp/src/components/general/forms/FormComponents.jsx
@@ -80,10 +80,14 @@
        </UncontrolledTooltip>;
    }
    const {fieldLength, className, hint, hintPlacement, id, ...other} = props;
    let myClassName = className;
    if (fieldLength > 0) {
        myClassName = classNames(`col-sm-${props.fieldLength}`, className);
    }
    return (
        <React.Fragment>
            <Input id={targetId}
                   className={classNames(`col-sm-${props.fieldLength}`, className)}
                   className={myClassName}
                   {...other}
            />
            {tooltip}
@@ -113,7 +117,6 @@
    name: '',
    hint: null,
    hintPlacement: 'top',
    fieldLength: 10,
    value: '',
    min: null,
    max: null,
borgbutler-webapp/src/components/general/forms/FormSelect.jsx
@@ -12,11 +12,15 @@
            {props.hint}
        </UncontrolledTooltip>;
    }
    const {className, hint, hintPlacement, id, ...other} = props;
    const {fieldLength, className, hint, hintPlacement, id, ...other} = props;
    let myClassName = className;
    if (fieldLength > 0) {
        myClassName = classNames(`col-sm-${props.fieldLength}`, className);
    }
    return (
        <React.Fragment>
            <select id={targetId}
                    className={classNames('custom-select form-control form-control-sm mr-1', className)}
                    className={classNames('custom-select form-control form-control-sm mr-1', myClassName)}
                    {...other}
            >
                {props.children}
@@ -31,6 +35,7 @@
    value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
    name: PropTypes.string,
    onChange: PropTypes.func,
    fieldLength: PropTypes.number,
    hint: PropTypes.string,
    hintPlacement: PropTypes.oneOf(['right', 'top']),
    children: PropTypes.node,