diff --git a/src/components/fields/e-signature-field/e-signature-field.styles.ts b/src/components/fields/e-signature-field/e-signature-field.styles.ts index 3eb75dd06..f0434f0cc 100644 --- a/src/components/fields/e-signature-field/e-signature-field.styles.ts +++ b/src/components/fields/e-signature-field/e-signature-field.styles.ts @@ -13,6 +13,9 @@ export const ErrorWrapper = styled.div` color: ${Colour["text-error"]}; outline: none; ${Font["body-sm-semibold"]} + display: flex; + gap: ${Spacing["spacing-4"]}; + align-items: center; `; export const TryAgain = styled.button` diff --git a/src/components/fields/e-signature-field/e-signature-field.tsx b/src/components/fields/e-signature-field/e-signature-field.tsx index 5e3624beb..871dac314 100644 --- a/src/components/fields/e-signature-field/e-signature-field.tsx +++ b/src/components/fields/e-signature-field/e-signature-field.tsx @@ -1,4 +1,5 @@ import { Form } from "@lifesg/react-design-system/form"; +import { ExclamationCircleFillIcon } from "@lifesg/react-icons/exclamation-circle-fill"; import { CanceledError } from "axios"; import isEmpty from "lodash/isEmpty"; import { useEffect, useRef, useState } from "react"; @@ -191,10 +192,13 @@ export const ESignatureField = (props: IGenericFieldProps 0) { return ( - {uploadRuleRef.current?.errorMessage || ERROR_MESSAGES.ESIGNATURE.UPLOAD} - handleChange(signatureDataURL)}> - Please try again. - + + + {uploadRuleRef.current?.errorMessage || ERROR_MESSAGES.ESIGNATURE.UPLOAD} + handleChange(signatureDataURL)}> + Please try again. + + {uploadErrorCount >= 3 && ( Refresh this page if you cannot upload your signature. @@ -207,10 +211,13 @@ export const ESignatureField = (props: IGenericFieldProps 0 && hasValue(value)) { return ( - Failed to load. - loadImage(value.fileId, value.fileUrl)}> - Please try again. - + + + Failed to load. + loadImage(value.fileId, value.fileUrl)}> + Please try again. + + {loadErrorCount >= 3 && ( Refresh this page if your signature failed to load. @@ -220,7 +227,12 @@ export const ESignatureField = (props: IGenericFieldProps{error?.message}; + return ( + + + {error?.message} + + ); }; return (