Fix search modal
This commit is contained in:
parent
82cf070c06
commit
43ff67238c
6 changed files with 27 additions and 25 deletions
|
@ -2,6 +2,8 @@ import React from 'react';
|
|||
import { Field, FieldProps } from 'formik';
|
||||
import classNames from 'classnames';
|
||||
import InputError from '@/components/elements/InputError';
|
||||
import Label from '@/components/elements/Label';
|
||||
import tw from 'twin.macro';
|
||||
|
||||
interface Props {
|
||||
id?: string;
|
||||
|
@ -18,10 +20,10 @@ const FormikFieldWrapper = ({ id, name, label, className, description, validate,
|
|||
{
|
||||
({ field, form: { errors, touched } }: FieldProps) => (
|
||||
<div className={classNames(className, { 'has-error': touched[field.name] && errors[field.name] })}>
|
||||
{label && <label htmlFor={id} className={'input-dark-label'}>{label}</label>}
|
||||
{label && <Label htmlFor={id}>{label}</Label>}
|
||||
{children}
|
||||
<InputError errors={errors} touched={touched} name={field.name}>
|
||||
{description ? <p className={'input-help'}>{description}</p> : null}
|
||||
{description || null}
|
||||
</InputError>
|
||||
</div>
|
||||
)
|
||||
|
|
Reference in a new issue