conditional display of back link if saved rep

This commit is contained in:
2024-06-06 06:39:34 +01:00
parent 04b3326e4e
commit 28db6d87f5
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>
)}