timeout redirect updated

This commit is contained in:
2022-04-20 16:09:31 +01:00
parent 3b1a49e561
commit fba8529417
4 changed files with 24 additions and 9 deletions
+19 -5
View File
@@ -27,6 +27,7 @@ import RepAgent from "./representationAgent";
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
import RepLandOwner from "./representationLandowner";
import RepCompleteSubmit from "./representationCompleteSubmit";
import { useSession, signIn, signOut } from "next-auth/react";
import {
RenderPickList,
@@ -39,6 +40,7 @@ let MakeRepresentation = (props) => {
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const [clearRepForm, setClearRepForm] = useState(false);
const { data: session } = useSession();
const router = useRouter();
const { locale } = router;
@@ -250,11 +252,23 @@ let MakeRepresentation = (props) => {
/>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
{!session ? (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn("email")}
>
Sign in to raise representation
</button>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
</>
)}
</>
)}
</form>