mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-02 03:47:28 -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 ? (
|
{error ? (
|
||||||
<ValidationMessage
|
<ValidationMessage
|
||||||
isError
|
|
||||||
className={validationClassName}
|
className={validationClassName}
|
||||||
message={error}
|
message={error}
|
||||||
|
mode="error"
|
||||||
/>
|
/>
|
||||||
) : toolTip && (
|
) : toolTip && (
|
||||||
<ValidationMessage
|
<ValidationMessage
|
||||||
isOk
|
|
||||||
className={validationClassName}
|
className={validationClassName}
|
||||||
message={toolTip}
|
message={toolTip}
|
||||||
|
mode="info"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@ const FormikInput = ({
|
||||||
FormikInput.propTypes = {
|
FormikInput.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
error: PropTypes.string,
|
error: PropTypes.string,
|
||||||
toolTip: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
toolTip: PropTypes.string,
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
validationClassName: PropTypes.string,
|
validationClassName: PropTypes.string,
|
||||||
wrapperClassName: PropTypes.string
|
wrapperClassName: PropTypes.string
|
||||||
|
|
|
@ -37,9 +37,9 @@ const FormikSelect = ({
|
||||||
</Field>
|
</Field>
|
||||||
{error && (
|
{error && (
|
||||||
<ValidationMessage
|
<ValidationMessage
|
||||||
isError
|
|
||||||
className={validationClassName}
|
className={validationClassName}
|
||||||
message={error}
|
message={error}
|
||||||
|
mode="error"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,8 +9,8 @@ const ValidationMessage = props => (
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'validation-message',
|
'validation-message',
|
||||||
{
|
{
|
||||||
'validation-error': props.isError,
|
'validation-error': props.mode === 'error',
|
||||||
'validation-ok': props.isOk
|
'validation-info': props.mode === 'info'
|
||||||
},
|
},
|
||||||
props.className
|
props.className
|
||||||
)}
|
)}
|
||||||
|
@ -21,9 +21,8 @@ const ValidationMessage = props => (
|
||||||
|
|
||||||
ValidationMessage.propTypes = {
|
ValidationMessage.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
isError: PropTypes.bool,
|
message: PropTypes.string,
|
||||||
isOk: PropTypes.bool,
|
mode: PropTypes.string
|
||||||
message: PropTypes.string
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ValidationMessage;
|
module.exports = ValidationMessage;
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.validation-ok {
|
.validation-info {
|
||||||
background-color: $ui-blue;
|
background-color: $ui-blue;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
|
|
Loading…
Reference in a new issue