added default "Select Organization Size" option and improve select safety with optional chaining
This commit is contained in:
parent
c72d3957f8
commit
a025ac34d7
@ -159,6 +159,7 @@ const SubscriptionForm = ({ currentStep, setCurrentStep, setStepStatus }) => {
|
|||||||
<Label htmlFor="organizationSize" required>
|
<Label htmlFor="organizationSize" required>
|
||||||
Organization Size
|
Organization Size
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
<select
|
<select
|
||||||
id="organizationSize"
|
id="organizationSize"
|
||||||
className="form-select shadow-none border py-1 px-2"
|
className="form-select shadow-none border py-1 px-2"
|
||||||
@ -167,12 +168,14 @@ const SubscriptionForm = ({ currentStep, setCurrentStep, setStepStatus }) => {
|
|||||||
required: "Organization size is required",
|
required: "Organization size is required",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{orgSize.map((org) => (
|
<option value="">Select Organization Size</option>
|
||||||
|
{orgSize?.map((org) => (
|
||||||
<option key={org.val} value={org.val}>
|
<option key={org.val} value={org.val}>
|
||||||
{org.name}
|
{org.name}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
{errors.organizationSize && (
|
{errors.organizationSize && (
|
||||||
<div className="danger-text">
|
<div className="danger-text">
|
||||||
{errors.organizationSize.message}
|
{errors.organizationSize.message}
|
||||||
@ -193,13 +196,17 @@ const SubscriptionForm = ({ currentStep, setCurrentStep, setStepStatus }) => {
|
|||||||
{industryLoading ? (
|
{industryLoading ? (
|
||||||
<option value="">Loading...</option>
|
<option value="">Loading...</option>
|
||||||
) : (
|
) : (
|
||||||
data?.map((indu) => (
|
<>
|
||||||
|
<option value="">Select Industry</option>
|
||||||
|
{data?.map((indu) => (
|
||||||
<option key={indu.id} value={indu.id}>
|
<option key={indu.id} value={indu.id}>
|
||||||
{indu.name}
|
{indu.name}
|
||||||
</option>
|
</option>
|
||||||
))
|
))}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
{errors.industryId && (
|
{errors.industryId && (
|
||||||
<div className="danger-text">
|
<div className="danger-text">
|
||||||
{errors.industryId.message}
|
{errors.industryId.message}
|
||||||
@ -217,6 +224,7 @@ const SubscriptionForm = ({ currentStep, setCurrentStep, setStepStatus }) => {
|
|||||||
className="form-select shadow-none border py-1 px-2 small"
|
className="form-select shadow-none border py-1 px-2 small"
|
||||||
{...register("reference")}
|
{...register("reference")}
|
||||||
>
|
>
|
||||||
|
<option value="">Select Reference</option>
|
||||||
{reference.map((org) => (
|
{reference.map((org) => (
|
||||||
<option key={org.val} value={org.val}>
|
<option key={org.val} value={org.val}>
|
||||||
{org.name}
|
{org.name}
|
||||||
@ -237,7 +245,10 @@ const SubscriptionForm = ({ currentStep, setCurrentStep, setStepStatus }) => {
|
|||||||
className="btn btn-label-primary d-flex align-items-center me-2"
|
className="btn btn-label-primary d-flex align-items-center me-2"
|
||||||
>
|
>
|
||||||
{isPending ? (
|
{isPending ? (
|
||||||
<span><i className='bx bx-loader-alt bx-md bx-spin me-2'></i>Please Wait...</span>
|
<span>
|
||||||
|
<i className="bx bx-loader-alt bx-md bx-spin me-2"></i>
|
||||||
|
Please Wait...
|
||||||
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span className="me-1">Next</span>
|
<span className="me-1">Next</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user