fixed proptypes bug, changed validationmessage to use mode

This commit is contained in:
Ben Wheeler 2019-08-16 17:58:10 -04:00
parent 0998171a67
commit ff2cab476d
4 changed files with 9 additions and 10 deletions

View file

@ -34,15 +34,15 @@ const FormikInput = ({
/>
{error ? (
<ValidationMessage
isError
className={validationClassName}
message={error}
mode="error"
/>
) : toolTip && (
<ValidationMessage
isOk
className={validationClassName}
message={toolTip}
mode="info"
/>
)}
</div>
@ -52,7 +52,7 @@ const FormikInput = ({
FormikInput.propTypes = {
className: PropTypes.string,
error: PropTypes.string,
toolTip: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
toolTip: PropTypes.string,
type: PropTypes.string,
validationClassName: PropTypes.string,
wrapperClassName: PropTypes.string

View file

@ -37,9 +37,9 @@ const FormikSelect = ({
</Field>
{error && (
<ValidationMessage
isError
className={validationClassName}
message={error}
mode="error"
/>
)}
</div>

View file

@ -9,8 +9,8 @@ const ValidationMessage = props => (
className={classNames(
'validation-message',
{
'validation-error': props.isError,
'validation-ok': props.isOk
'validation-error': props.mode === 'error',
'validation-info': props.mode === 'info'
},
props.className
)}
@ -21,9 +21,8 @@ const ValidationMessage = props => (
ValidationMessage.propTypes = {
className: PropTypes.string,
isError: PropTypes.bool,
isOk: PropTypes.bool,
message: PropTypes.string
message: PropTypes.string,
mode: PropTypes.string
};
module.exports = ValidationMessage;

View file

@ -59,7 +59,7 @@
}
}
.validation-ok {
.validation-info {
background-color: $ui-blue;
&:before {