Skip to content

Commit

Permalink
Change variable to check validate fail
Browse files Browse the repository at this point in the history
  • Loading branch information
hungoptimizely committed Nov 20, 2023
1 parent 2630c2a commit a1ee9c3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export interface ElementWrapperProps{
}

export default function ElementWrapper(props: ElementWrapperProps){
const failClass = props.validationResults?.some(r => !r.valid) ? "ValidationFail" : "ValidationSuccess";
const isFail = props.validationResults?.some(r => !r.valid);

return (
<>
{props.isVisible && (
<div className={`Form__Element ${props.className} ${failClass}`}>
<div className={`Form__Element ${props.className} ${isFail ? "ValidationFail" : "ValidationSuccess"}`}>
{props.children}
</div>
)}
Expand Down

0 comments on commit a1ee9c3

Please sign in to comment.