hide reps button & add rich text for reps

This commit is contained in:
2022-10-12 12:23:26 +01:00
parent 33053a578b
commit 96387db56e
22 changed files with 531 additions and 79 deletions
+35 -13
View File
@@ -128,6 +128,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -144,6 +145,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -160,6 +162,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -176,6 +179,7 @@ let MakeRepresentation = (props) => {
onHandleSubmit={onHandleSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
break;
@@ -204,16 +208,18 @@ let MakeRepresentation = (props) => {
setRepresentationSubmit={setRepresentationSubmit}
currentView={currentView}
setSubmitBack={setSubmitBack}
props={props}
/>
);
}
};
const onHandleSubmit = (values) => {
console.log(
values.representationCapacity,
currentView.representationCapacity
);
// console.log(
// values,
// values.representationCapacity,
// currentView.representationCapacity
// );
// console.log(_.isEmpty(currentView.representationCapacity));
// console.log(
@@ -228,15 +234,22 @@ let MakeRepresentation = (props) => {
.replace(/(\band|[\s\-\+\(\)\,\&])/g, "")
.toLowerCase()
)
: setRepresentationSubmit(true);
: setRepresentationSubmit("true");
window.alert(`You submitted:\n\n${JSON.stringify(values, null, 2)}`);
};
const repForm = props.props.form;
// console.log(
// "waht is representationSubmit:",
// currentView.representationSubmit
// );
return (
<div>
<form onSubmit={handleSubmit(onHandleSubmit)}>
{representationSubmit == true ? (
{currentView.representationSubmit == "true" ? (
<RepCompleteSubmit
formObj={formObj}
capacityOptionsArr={capacityOptionsArr}
@@ -253,13 +266,22 @@ let MakeRepresentation = (props) => {
) : (
<>
{!session ? (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn("email")}
>
Sign in to raise representation
</button>
<>
<div>
<p className="govuk-body">
Some text in here to explain about
raising a representation and why logging
in
</p>
</div>
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn("email")}
>
Sign in to raise representation
</button>
</>
) : (
<>
<h1 className="govuk-heading-l">