Skip to content

Commit

Permalink
Remove div when render submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
hungoptimizely committed Nov 22, 2023
1 parent ec8d0e0 commit 2ef7992
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@ export const SubmitButtonElementBlock = (props: SubmitButtonElementBlockProps) =
//TODO: Need to get submittable status from API
const buttonDisableState = false;

return useMemo(()=>(
<ElementWrapper isVisible={isVisible}>
<button id={element.key}
name="submit"
type="submit"
value={element.key}
{...extraAttr}
disabled={buttonDisableState}
className={isNullOrEmpty(element.properties.image)
? `Form__Element FormExcludeDataRebind FormSubmitButton ${validatorClasses}`
: `Form__Element FormExcludeDataRebind FormSubmitButton FormImageSubmitButton ${validatorClasses}`
}
>
{isNullOrEmpty(element.properties.image) ? element.properties.label : (
<img src={element.properties.image} alt={element.properties.label} />
)}
</button>
</ElementWrapper>
),[isVisible]);
return useMemo(()=>(isVisible && (
<button id={element.key}
name="submit"
type="submit"
value={element.key}
{...extraAttr}
disabled={buttonDisableState}
className={isNullOrEmpty(element.properties.image)
? `Form__Element FormExcludeDataRebind FormSubmitButton ${validatorClasses}`
: `Form__Element FormExcludeDataRebind FormSubmitButton FormImageSubmitButton ${validatorClasses}`
}
>
{isNullOrEmpty(element.properties.image) ? element.properties.label : (
<img src={element.properties.image} alt={element.properties.label} />
)}
</button>
)),[isVisible]);
}

0 comments on commit 2ef7992

Please sign in to comment.