mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
fixed proptypes bug, changed validationmessage to use mode
This commit is contained in:
parent
0998171a67
commit
ff2cab476d
4 changed files with 9 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -37,9 +37,9 @@ const FormikSelect = ({
|
|||
</Field>
|
||||
{error && (
|
||||
<ValidationMessage
|
||||
isError
|
||||
className={validationClassName}
|
||||
message={error}
|
||||
mode="error"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.validation-ok {
|
||||
.validation-info {
|
||||
background-color: $ui-blue;
|
||||
|
||||
&:before {
|
||||
|
|
Loading…
Reference in a new issue