Merged PR 1182: conditional display of back link if saved rep

conditional display of back link if saved rep

Related work items: #11353
This commit is contained in:
Robert Bond
2024-06-06 05:40:28 +00:00
4 changed files with 55 additions and 48 deletions
@@ -208,20 +208,21 @@ const RepAgent = (props) => {
>
{t("common:continue-button")}
</button>
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationCapacity",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
{router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationCapacity",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)}
</div>
</div>
)}
@@ -192,19 +192,21 @@ const RepAppellant = (props) => {
>
{t("common:continue-button")}
</button>
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
{router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)}
</div>
</div>
)}
@@ -480,19 +480,21 @@ let RepLPA = (props) => {
>
{t("common:continue-button")}
</button>
<a
onClick={() => {
//setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
{router.query.state != "edit" && (
<a
onClick={() => {
//setRepresentationCapacity();
props.updateField(
"representationForm",
"representationType",
""
);
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)}
</>
)}
</div>
@@ -116,14 +116,16 @@ const RepLandOwner = (props) => {
>
{t("common:continue-button")}
</button>
<a
onClick={() => {
setRepresentationCapacity();
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
{router.query.state != "edit" && (
<a
onClick={() => {
setRepresentationCapacity();
}}
className="govuk-link"
>
{t("common:back-link")}
</a>
)}
</div>
</div>
)}