fix いろいろ

This commit is contained in:
shibafu
2020-08-17 16:08:35 +09:00
parent f37a9c79f4
commit 228b1cdaaa
4 changed files with 49 additions and 45 deletions

View File

@@ -0,0 +1,16 @@
import * as React from 'react';
type FieldErrorProps = {
errors?: string[];
};
export const FieldError: React.FC<FieldErrorProps> = ({ errors }) =>
(errors && errors.length > 0 && <div className="invalid-feedback">{errors[0]}</div>) || null;
export const StandaloneFieldError: React.FC<FieldErrorProps> = ({ errors }) =>
(errors && errors.length > 0 && (
<div className="form-group col-sm-12" style={{ marginTop: '-1rem' }}>
<small className="text-danger">{errors[0]}</small>
</div>
)) ||
null;