Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
whereWillPruningsGo rendering fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaparas1630 committed Aug 13, 2024
1 parent bef9eb0 commit 69f8d4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,20 @@ const StyledPBalance = styled.div`
}
@media (min-width: ${screenSizes.desktop}) {
gap: 24px;
gap: 20px;
p {
font: ${tokens.typographyRegularBody};
}
}
`;

const FontAwesomeContainer = styled.div`
font-size: 18px;
font-size: 16px;
margin-left: -28px;
@media (min-width: ${screenSizes.desktop}) {
margin-left: -40px;
font-size: 24px;
margin-left: -45px;
}
`;
export {
Expand Down
30 changes: 19 additions & 11 deletions frontend/src/Commons/Forms/InputModules/Crops/CropsInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ const CropsInfoComponent: FC<InputModuleProps> = ({
distanceBtwnPlants: BlueberrySchemaString('cropId'),
distanceBtwnRows: BlueberrySchemaString('cropId'),
willPlantsBePruned: Yup.boolean().required('Required'),
whereWillPruningsGo: Yup.string().required('Required'),
whereWillPruningsGo: Yup.string().when('willPlantsBePruned', {
is: true,
then: (schema) => schema.required('Required'),
otherwise: (schema) => schema.notRequired(),
}),
willSawdustBeApplied: Yup.boolean().required('Required'),
});

Expand Down Expand Up @@ -297,18 +301,22 @@ const CropsInfoComponent: FC<InputModuleProps> = ({
mobileWidth="137px"
onChange={(e) => {
handleChange(e, setFieldValue);
console.log(e.target.name, e.target.value);
}}
/>

<CustomSelect
name="whereWillPruningsGo"
id="whereWillPruningsGo"
label="Where will prunings go?"
options={WherePruningsGo}
desktopWidth="226px"
mobileWidth="137px"
onChange={(e) => handleChange(e, setFieldValue)}
/>
{((values.willPlantsBePruned &&
values.willPlantsBePruned.toString().includes('true')) ||
values.willPlantsBePruned === undefined) && (
<CustomSelect
name="whereWillPruningsGo"
id="whereWillPruningsGo"
label="Where will prunings go?"
options={WherePruningsGo}
desktopWidth="226px"
mobileWidth="137px"
onChange={(e) => handleChange(e, setFieldValue)}
/>
)}
</StyledCropsLargeGroup>
<StyledCropsLargeGroup>
<CustomSelect
Expand Down

0 comments on commit 69f8d4e

Please sign in to comment.