diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 62df50f1..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -14.17.0 diff --git a/components/admin/permit-holders/Header.tsx b/components/admin/permit-holders/Header.tsx index 8553ec85..33b93ad3 100644 --- a/components/admin/permit-holders/Header.tsx +++ b/components/admin/permit-holders/Header.tsx @@ -1,4 +1,3 @@ -import { useRouter } from 'next/router'; import { Alert, AlertIcon, @@ -19,7 +18,6 @@ import { ChevronDownIcon, ChevronLeftIcon } from '@chakra-ui/icons'; // Chakra U import Link from 'next/link'; // Link import { ApplicantStatus } from '@lib/graphql/types'; import PermitHolderStatusBadge from '@components/admin/PermitHolderStatusBadge'; -import ConfirmDeleteApplicantModal from '@components/admin/permit-holders/table/ConfirmDeleteApplicantModal'; import SetPermitHolderToInactiveModal from '@components/admin/permit-holders/table/ConfirmSetInactiveModal'; import SetPermitHolderToActiveModal from '@components/admin/permit-holders/table/ConfirmSetActiveModal'; import AdditionalNotesModal from '@components/admin/permit-holders/additional-notes/Modal'; @@ -39,8 +37,6 @@ export default function PermitHolderHeader({ applicant: { id, name, status, inactiveReason, notes }, refetch, }: PermitHolderHeaderProps) { - const router = useRouter(); - // Set Permit Holder Inactive/Active modal state const { isOpen: isSetPermitHolderStatusModalOpen, @@ -48,13 +44,6 @@ export default function PermitHolderHeader({ onClose: onCloseSetPermitHolderStatusModal, } = useDisclosure(); - // Delete applicant modal state - const { - isOpen: isDeleteApplicantModalOpen, - onOpen: onOpenDeleteApplicantModal, - onClose: onCloseDeleteApplicantModal, - } = useDisclosure(); - // Additional notes modal state const { isOpen: isNotesModalOpen, @@ -108,13 +97,6 @@ export default function PermitHolderHeader({ > {`Set as ${status === 'ACTIVE' ? 'Inactive' : 'Active'}`} - - {'Delete Permit Holder'} - @@ -161,17 +143,6 @@ export default function PermitHolderHeader({ onClose={onCloseSetPermitHolderStatusModal} /> )} - { - /* Do not refetch, redirect to permit holders page */ - }} - onClose={() => { - onCloseDeleteApplicantModal(); - router.push('/admin/permit-holders'); - }} - /> {/* Additional notes modal */} - Gender: {gender === 'OTHER' && otherGender ? otherGender : titlecase(gender)} + Gender: {gender === 'OTHER' ? otherGender : titlecase(gender)} diff --git a/components/admin/permit-holders/permit-holder-information/EditModal.tsx b/components/admin/permit-holders/permit-holder-information/EditModal.tsx index ba6c1734..b6af3fd7 100644 --- a/components/admin/permit-holders/permit-holder-information/EditModal.tsx +++ b/components/admin/permit-holders/permit-holder-information/EditModal.tsx @@ -76,7 +76,6 @@ export default function EditUserInformationModal({ }} validationSchema={permitHolderInformationSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => (
diff --git a/components/admin/permit-holders/table/ConfirmDeleteApplicantModal.tsx b/components/admin/permit-holders/table/ConfirmDeleteApplicantModal.tsx deleted file mode 100644 index db86f3f8..00000000 --- a/components/admin/permit-holders/table/ConfirmDeleteApplicantModal.tsx +++ /dev/null @@ -1,115 +0,0 @@ -import { SyntheticEvent } from 'react'; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalFooter, - ModalBody, - Button, - Text, - useToast, -} from '@chakra-ui/react'; -import { useMutation } from '@tools/hooks/graphql'; -import { - DeleteApplicantRequest, - DeleteApplicantResponse, - DELETE_APPLICANT, -} from '@tools/admin/permit-holders/permit-holders-table'; - -type ConfirmDeleteApplicantModalProps = { - readonly isOpen: boolean; - readonly applicantId: number; - readonly refetch: () => void; - readonly onClose: () => void; -}; - -/** - * Delete applicant confirmation modal - */ -export default function ConfirmDeleteApplicantModal({ - isOpen, - applicantId, - refetch, - onClose, -}: ConfirmDeleteApplicantModalProps) { - const toast = useToast(); - - // API call to deleteApplicant - const [deleteApplicant] = useMutation( - DELETE_APPLICANT, - { - onCompleted: data => { - if (data.deleteApplicant.ok) { - toast({ - status: 'success', - description: `Permit holder successfully deleted.`, - }); - } else { - toast({ - status: 'error', - description: `Failed to delete permit holder.`, - }); - } - }, - } - ); - - // Close modal handler - const handleClose = () => { - onClose(); - }; - - // Sets permit holder status to inactive and closes modal - const handleSubmit = async (event: SyntheticEvent) => { - event.preventDefault(); - await deleteApplicant({ - variables: { input: { id: applicantId } }, - }); - refetch(); - onClose(); - }; - - return ( - - - - - - - {`Delete Permit Holder`} - - - - - Are you sure you want to delete this permit holder? This action is irreversible. - - - - All of this user's data, including associated applications and permits will be - permanently deleted. - - - - If you would like to retain this data, please cancel and mark this user as inactive - instead. - - - - - - - - - - ); -} diff --git a/components/admin/requests/Header.tsx b/components/admin/requests/Header.tsx index 878aedb8..e823f8ba 100644 --- a/components/admin/requests/Header.tsx +++ b/components/admin/requests/Header.tsx @@ -1,33 +1,15 @@ -import { useRouter } from 'next/router'; -import { - Alert, - AlertIcon, - Box, - Button, - Flex, - HStack, - Link, - Menu, - MenuButton, - MenuItem, - MenuList, - Text, - useDisclosure, - VStack, -} from '@chakra-ui/react'; // Chakra UI -import { ChevronDownIcon, ChevronLeftIcon } from '@chakra-ui/icons'; // Chakra UI icon +import { Box, Flex, HStack, Text, Link, VStack, Alert, AlertIcon } from '@chakra-ui/react'; // Chakra UI +import { ChevronLeftIcon } from '@chakra-ui/icons'; // Chakra UI icon import NextLink from 'next/link'; // Link import RequestStatusBadge from '@components/admin/RequestStatusBadge'; // Request status badge import ShopifyBadge from '@components/admin/ShopifyBadge'; import PermitTypeBadge from '@components/admin/PermitTypeBadge'; -import ConfirmDeleteRequestModal from './delete/ConfirmDeleteRequestModal'; import { ApplicationStatus, ApplicationType, PermitType } from '@lib/graphql/types'; import { titlecase } from '@tools/string'; import { formatDateYYYYMMDD, formatDateYYYYMMDDLocal } from '@lib/utils/date'; import { getPermanentPermitExpiryDate } from '@lib/utils/permit-expiry'; type RequestHeaderProps = { - readonly id: number; readonly applicationType: ApplicationType; readonly permitType: PermitType; readonly createdAt: Date; @@ -42,7 +24,6 @@ type RequestHeaderProps = { /** * Header of View Request page - * @param id Application id * @param applicationType Type of application * @param permitType Type of permit * @param createdAt Date permit was created at @@ -55,7 +36,6 @@ type RequestHeaderProps = { * @param reasonForRejection Reason for rejecting application */ export default function RequestHeader({ - id, applicationType, permitType, createdAt, @@ -75,8 +55,6 @@ export default function RequestHeader({ expiryDateText = `Expiry date: ${formatDateYYYYMMDD(permitExpiry)}`; } else if (permitType === 'TEMPORARY' && !!temporaryPermitExpiry) { expiryDateText = `This permit will expire: ${formatDateYYYYMMDD(temporaryPermitExpiry)}`; - } else if (applicationType === 'REPLACEMENT' && !!permitExpiry) { - expiryDateText = `This permit will expire: ${formatDateYYYYMMDD(permitExpiry)}`; } else if (permitType === 'PERMANENT') { expiryDateText = `This permit will expire: ${formatDateYYYYMMDD( getPermanentPermitExpiryDate() @@ -85,15 +63,6 @@ export default function RequestHeader({ expiryDateText = null; } - const router = useRouter(); - - // Delete application modal state - const { - isOpen: isDeleteApplicationModalOpen, - onOpen: onOpenDeleteApplicationModal, - onClose: onCloseDeleteApplicationModal, - } = useDisclosure(); - return ( @@ -119,27 +88,6 @@ export default function RequestHeader({ Received on {formatDateYYYYMMDDLocal(createdAt)} at{' '} {createdAt.toLocaleTimeString('en-CA')} - - } - height="30px" - bg="background.gray" - _hover={{ bg: 'background.grayHover' }} - color="black" - > - More Actions - - - - {'Delete Request'} - - - {displayShopifyUrl && ( @@ -179,17 +127,6 @@ export default function RequestHeader({ )} - { - /* Do not refetch, redirect to main page */ - }} - onClose={() => { - onCloseDeleteApplicationModal(); - router.push('/admin'); - }} - /> ); diff --git a/components/admin/requests/additional-questions/EditModal.tsx b/components/admin/requests/additional-questions/EditModal.tsx index b7af9dad..6c2b0181 100644 --- a/components/admin/requests/additional-questions/EditModal.tsx +++ b/components/admin/requests/additional-questions/EditModal.tsx @@ -61,7 +61,6 @@ export default function EditAdditionalInformationModal({ initialValues={{ additionalInformation: additionalInformation }} validationSchema={editAdditionalQuestionsSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => (
diff --git a/components/admin/requests/delete/ConfirmDeleteRequestModal.tsx b/components/admin/requests/delete/ConfirmDeleteRequestModal.tsx deleted file mode 100644 index dabba9e0..00000000 --- a/components/admin/requests/delete/ConfirmDeleteRequestModal.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { SyntheticEvent } from 'react'; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalFooter, - ModalBody, - Button, - Text, - useToast, -} from '@chakra-ui/react'; -import { useMutation } from '@tools/hooks/graphql'; -import { - DeleteApplicationRequest, - DeleteApplicationResponse, - DELETE_APPLICATION_MUTATION, -} from '@tools/admin/requests/delete-request-modal'; - -type ConfirmDeleteRequestModalProps = { - readonly isOpen: boolean; - readonly applicationId: number; - readonly refetch: () => void; - readonly onClose: () => void; -}; - -/** - * Delete request confirmation modal - */ -export default function ConfirmDeleteRequestModal({ - isOpen, - applicationId, - refetch, - onClose, -}: ConfirmDeleteRequestModalProps) { - const toast = useToast(); - - // API call to deleteApplication - const [deleteApplication] = useMutation( - DELETE_APPLICATION_MUTATION, - { - onCompleted: data => { - if (data.deleteApplication.ok) { - toast({ - status: 'success', - description: `Request successfully deleted.`, - }); - } else { - toast({ - status: 'error', - description: `Failed to delete request.`, - }); - } - }, - } - ); - - // Close modal handler - const handleClose = () => { - onClose(); - }; - - // Sets permit holder status to inactive and closes modal - const handleSubmit = async (event: SyntheticEvent) => { - event.preventDefault(); - await deleteApplication({ - variables: { input: { id: applicationId } }, - }); - refetch(); - onClose(); - }; - - return ( - - - - - - - {`Delete Request`} - - - - - Are you sure you want to delete this request? This action is irreversible. - - - - All data associated with this request will be permanently deleted and will no longer - show under the permit holder's recent apps. - - - - - - - - - - - ); -} diff --git a/components/admin/requests/doctor-information/EditModal.tsx b/components/admin/requests/doctor-information/EditModal.tsx index 1235fbd5..d41568f9 100644 --- a/components/admin/requests/doctor-information/EditModal.tsx +++ b/components/admin/requests/doctor-information/EditModal.tsx @@ -80,7 +80,6 @@ export default function EditDoctorInformationModal({ initialValues={{ doctorInformation }} validationSchema={editPhysicianInformationSchema} onSubmit={handleSubmit} - validateOnMount > {({ isValid }) => (
diff --git a/components/admin/requests/guardian-information/EditModal.tsx b/components/admin/requests/guardian-information/EditModal.tsx index 4e50a7ae..c66c2984 100644 --- a/components/admin/requests/guardian-information/EditModal.tsx +++ b/components/admin/requests/guardian-information/EditModal.tsx @@ -136,7 +136,6 @@ const EditGuardianInformationModal: FC = ({ children, guardianInformation }} validationSchema={editGuardianInformationSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/admin/requests/payment-information/EditModal.tsx b/components/admin/requests/payment-information/EditModal.tsx index f79db65f..65827b15 100644 --- a/components/admin/requests/payment-information/EditModal.tsx +++ b/components/admin/requests/payment-information/EditModal.tsx @@ -66,7 +66,6 @@ export default function EditPaymentDetailsModal({ initialValues={{ paymentInformation }} validationSchema={editPaymentInformationSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/admin/requests/permit-holder-information/Card.tsx b/components/admin/requests/permit-holder-information/Card.tsx index a64b95c5..2f0aee3a 100644 --- a/components/admin/requests/permit-holder-information/Card.tsx +++ b/components/admin/requests/permit-holder-information/Card.tsx @@ -94,8 +94,6 @@ const Card: FC = props => { | null; if (type === 'NEW') { const validatedData = await permitHolderInformationSchema.validate(permitHolderData); - // TODO: Remove this once schema is updated - validatedData.otherGender = ''; ({ data } = await updateNewPermitHolderInformation({ variables: { input: { id: applicationId, ...validatedData } }, diff --git a/components/admin/requests/permit-holder-information/EditModal.tsx b/components/admin/requests/permit-holder-information/EditModal.tsx index 2c890145..31a010ab 100644 --- a/components/admin/requests/permit-holder-information/EditModal.tsx +++ b/components/admin/requests/permit-holder-information/EditModal.tsx @@ -79,7 +79,6 @@ export default function EditPermitHolderInformationModal({ initialValues={{ permitHolder: { ...permitHolderInformation } }} validationSchema={editRequestPermitHolderInformationSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/admin/requests/physician-assessment/EditModal.tsx b/components/admin/requests/physician-assessment/EditModal.tsx index d2a317e9..869cf1b0 100644 --- a/components/admin/requests/physician-assessment/EditModal.tsx +++ b/components/admin/requests/physician-assessment/EditModal.tsx @@ -63,7 +63,6 @@ export default function EditPhysicianAssessmentModal({ }} validationSchema={editPhysicianAssessmentSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/admin/requests/processing/TasksCard.tsx b/components/admin/requests/processing/TasksCard.tsx index 6d3d482f..b9048833 100644 --- a/components/admin/requests/processing/TasksCard.tsx +++ b/components/admin/requests/processing/TasksCard.tsx @@ -106,8 +106,8 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa const [generateInvoice, { loading: generateInvoiceLoading }] = useMutation(GENERATE_INVOICE_MUTATION); - const handleGenerateInvoice = async (isDonation: boolean) => { - await generateInvoice({ variables: { input: { applicationId, isDonation } } }); + const handleGenerateInvoice = async () => { + await generateInvoice({ variables: { input: { applicationId } } }); refetch(); }; @@ -184,7 +184,6 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa paidThroughShopify, shopifyConfirmationNumber, shopifyOrderNumber, - donationAmount, processing: { status, appNumber, @@ -328,6 +327,7 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa ) : null} + {/* Task 2: Hole punch parking permit: Mark as complete (CHECK) */} ) : null} - {/* Task 3: Review Information: Review Information (MODAL) */} + + {/* Task 3: Create a new wallet card: Mark as complete (CHECK) */} + {walletCardCreated && !reviewRequestCompleted ? ( + + ) : !walletCardCreated && !reviewRequestCompleted ? ( + + ) : null} + + + {/* Task 4: Review Information: Review Information (MODAL) */} + handleReviewRequestInformation(true)} onUndo={() => { @@ -410,14 +464,11 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa loading={reviewRequestInformationLoading} /> - {/* Task 4: Generate Invoice */} + + {/* Task 5: Generate Invoice */} = 20 - ? 'Generate invoice and donation receipt' - : 'Generate invoice' - } + id={5} + label="Generate invoice" description="Invoice number will be automatically assigned" isCompleted={invoice !== null} showLog={showTaskLog} @@ -436,13 +487,9 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa height="35px" bg="background.gray" _hover={!reviewRequestCompleted ? undefined : { bg: 'background.grayHover' }} + disabled={!reviewRequestCompleted || generateInvoiceLoading} color="black" - onClick={() => { - Number(donationAmount) >= 20 - ? handleGenerateInvoice(true) - : handleGenerateInvoice(false); - }} - isDisabled={!reviewRequestCompleted || generateInvoiceLoading} + onClick={handleGenerateInvoice} isLoading={generateInvoiceLoading} loadingText="Generate document" fontWeight="normal" @@ -473,9 +520,10 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa )} - {/* Task 5: Upload document: Choose document (UPLOAD FILE) */} + + {/* Task 6: Upload document: Choose document (UPLOAD FILE) */} - {/* Task 6: Create a new wallet card: Mark as complete (CHECK) */} - - {walletCardCreated ? ( - - ) : ( - - )} - + {/* Task 7: Mail out: Mark as complete (CHECK) */} handleMailOut(false)} - isDisabled={mailOutLoading} + disabled={mailOutLoading} isLoading={mailOutLoading} loadingText="Undo" fontWeight="normal" @@ -588,10 +585,10 @@ export default function ProcessingTasksCard({ applicationId }: ProcessingTasksCa marginLeft="auto" height="35px" bg="background.gray" - _hover={!walletCardCreated ? undefined : { bg: 'background.grayHover' }} + _hover={documentsUrl === null ? undefined : { bg: 'background.grayHover' }} color="black" + disabled={documentsUrl === null || mailOutLoading} onClick={() => handleMailOut(true)} - isDisabled={!walletCardCreated || mailOutLoading} isLoading={mailOutLoading} loadingText="Mark as complete" fontWeight="normal" diff --git a/components/admin/requests/reason-for-replacement/EditModal.tsx b/components/admin/requests/reason-for-replacement/EditModal.tsx index 01fc674b..49031c72 100644 --- a/components/admin/requests/reason-for-replacement/EditModal.tsx +++ b/components/admin/requests/reason-for-replacement/EditModal.tsx @@ -64,7 +64,6 @@ export default function EditReasonForReplacementModal({ }} validationSchema={editReasonForReplacementFormSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/IdentityVerification.tsx b/components/applicant/renewals/IdentityVerification.tsx index 2b512c69..bc3202c2 100644 --- a/components/applicant/renewals/IdentityVerification.tsx +++ b/components/applicant/renewals/IdentityVerification.tsx @@ -124,7 +124,6 @@ const IdentityVerification: FC = () => { }} validationSchema={verifyIdentitySchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/RenewalForm/AdditionalInformationSection.tsx b/components/applicant/renewals/RenewalForm/AdditionalInformationSection.tsx index 464ed427..1d5408c9 100644 --- a/components/applicant/renewals/RenewalForm/AdditionalInformationSection.tsx +++ b/components/applicant/renewals/RenewalForm/AdditionalInformationSection.tsx @@ -48,7 +48,6 @@ const AdditionalInformationSection: FC = () => { initialValues={{ ...additionalInformation }} validationSchema={additionalQuestionsSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx b/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx index 96fc785f..23e465be 100644 --- a/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx +++ b/components/applicant/renewals/RenewalForm/ContactInformationSection.tsx @@ -59,7 +59,6 @@ const ContactInformationSection: FC = () => { }} validationSchema={applicantFacingRenewalContactSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/RenewalForm/DoctorInformationSection.tsx b/components/applicant/renewals/RenewalForm/DoctorInformationSection.tsx index ddafb165..37cbb4db 100644 --- a/components/applicant/renewals/RenewalForm/DoctorInformationSection.tsx +++ b/components/applicant/renewals/RenewalForm/DoctorInformationSection.tsx @@ -87,7 +87,6 @@ const DoctorInformationSection: FC = () => { }} validationSchema={applicantFacingRenewalDoctorSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/RenewalForm/DonationSection.tsx b/components/applicant/renewals/RenewalForm/DonationSection.tsx index aa5870cb..f72701ff 100644 --- a/components/applicant/renewals/RenewalForm/DonationSection.tsx +++ b/components/applicant/renewals/RenewalForm/DonationSection.tsx @@ -35,7 +35,6 @@ const DonationSection: FC = () => { }} validationSchema={applicantFacingRenewalDonationSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/applicant/renewals/RenewalForm/PersonalAddressSection.tsx b/components/applicant/renewals/RenewalForm/PersonalAddressSection.tsx index 2ed5c0eb..674f5147 100644 --- a/components/applicant/renewals/RenewalForm/PersonalAddressSection.tsx +++ b/components/applicant/renewals/RenewalForm/PersonalAddressSection.tsx @@ -64,7 +64,6 @@ const PersonalAddressSection: FC = () => { }} validationSchema={applicantFacingRenewalPersonalAddressSchema} onSubmit={handleSubmit} - validateOnMount > {({ values, isValid }) => ( diff --git a/components/form/CheckboxField.tsx b/components/form/CheckboxField.tsx index f67eece3..478bbccf 100644 --- a/components/form/CheckboxField.tsx +++ b/components/form/CheckboxField.tsx @@ -13,13 +13,13 @@ const CheckboxField: FC = props => { const isChecked = field.value; return ( - + {children} - {meta.error || null} + {meta.touched && meta.error ? meta.error : null} diff --git a/components/form/CheckboxGroupField.tsx b/components/form/CheckboxGroupField.tsx index e6ecfde2..0b961dcd 100644 --- a/components/form/CheckboxGroupField.tsx +++ b/components/form/CheckboxGroupField.tsx @@ -24,14 +24,14 @@ const CheckboxGroupField: FC = props => { }; return ( - + {label} {children} - {meta.error || null} + {meta.touched && meta.error ? meta.error : null} diff --git a/components/form/DateField.tsx b/components/form/DateField.tsx index 263f83c7..63145e10 100644 --- a/components/form/DateField.tsx +++ b/components/form/DateField.tsx @@ -29,12 +29,12 @@ const DateField: FC = props => { }; return ( - + {label} - {meta.error || null} + {meta.touched && meta.error ? meta.error : null} {children} diff --git a/components/form/NumberField.tsx b/components/form/NumberField.tsx index d1cb4057..ca45745f 100644 --- a/components/form/NumberField.tsx +++ b/components/form/NumberField.tsx @@ -21,14 +21,14 @@ const NumberField: FC = props => { const [field, meta] = useField(name); return ( - + {label} - {meta.error || null} + {meta.touched && meta.error ? meta.error : null} {children} diff --git a/components/form/RadioGroupField.tsx b/components/form/RadioGroupField.tsx index cfba0323..cd0971e9 100644 --- a/components/form/RadioGroupField.tsx +++ b/components/form/RadioGroupField.tsx @@ -24,14 +24,14 @@ const RadioGroupField: FC = props => { }; return ( - + {label && {label}} {children} - {meta.error || null} + {meta.touched && meta.error ? meta.error : null} diff --git a/components/form/SelectField.tsx b/components/form/SelectField.tsx index 2a373bfc..81f82ccf 100644 --- a/components/form/SelectField.tsx +++ b/components/form/SelectField.tsx @@ -20,12 +20,12 @@ const SelectField: FC = props => { const [field, meta] = useField(name); return ( - + {label}