diff --git a/components/sections/Signatures/MessageContent.tsx b/components/sections/Signatures/MessageContent.tsx index 9e57fbd..ae96cce 100644 --- a/components/sections/Signatures/MessageContent.tsx +++ b/components/sections/Signatures/MessageContent.tsx @@ -5,19 +5,21 @@ import { TextArea, Input, Form } from '@/components/elements/FormFields' import { StyledFormArea } from './FormArea.style' import VerifyResult from './VerifyResult' -interface IMessageContent { +export interface IMessageContent { message: string verusId: string signature: string + filled: boolean } -const MessageContent = () => { +const MessageContent = ({ iMessageContent }: { iMessageContent: IMessageContent }) => { const { t } = useTranslation('signatures') const methods = useForm({ mode: 'onBlur' }) const [verusSignature, setVerusSignature] = useState | null>(null) + const [filledVerusSignature, setFilledVerusSignature] = useState(iMessageContent.filled) const [sigResult, setSigResult] = useState() const onSubmit: SubmitHandler = async (values) => { @@ -52,12 +54,13 @@ const MessageContent = () => { const _handleReset = () => { setVerusSignature(null) + setFilledVerusSignature(false) setSigResult(null) methods.reset() } return ( <> - {!verusSignature && ( + {!verusSignature && !filledVerusSignature && (
@@ -80,6 +83,32 @@ const MessageContent = () => { )} + {!verusSignature && filledVerusSignature && ( + + + +