|
1 | 1 | "use client"; |
2 | 2 |
|
3 | | -import { toNHSAppHomePage } from "@src/utils/navigation"; |
4 | | -import styles from "./styles.module.css"; |
5 | 3 | import MainContent from "@src/app/_components/nhs-frontend/MainContent"; |
6 | | -import { useEffect, useState } from "react"; |
| 4 | +import { useEffect } from "react"; |
7 | 5 |
|
8 | 6 | const SessionLogout = () => { |
9 | | - const [isOpenInNHSApp, setIsOpenInNHSApp] = useState(false); |
10 | | - |
11 | 7 | useEffect(() => { |
12 | | - setIsOpenInNHSApp(window.nhsapp.tools.isOpenInNHSApp()); |
| 8 | + if (window.nhsapp.tools.isOpenInNHSApp()) { |
| 9 | + window.nhsapp.navigation.goToHomePage(); |
| 10 | + } |
13 | 11 | }, []); |
14 | 12 |
|
15 | | - return isOpenInNHSApp ? ( |
16 | | - <> |
17 | | - <MainContent> |
18 | | - <title>You have been logged out</title> |
19 | | - <div className={styles.logoutScreen}> |
20 | | - <div className={styles.logoutBanner}> |
21 | | - <h4>For your security, you need to login again.</h4> |
22 | | - </div> |
23 | | - <div className={styles.logoutContent}> |
24 | | - <h1>You have logged out</h1> |
25 | | - </div> |
26 | | - <div className={styles.logBackInButton}> |
27 | | - <button |
28 | | - className="nhsuk-button nhsuk-button--reverse nhsapp-button" |
29 | | - onClick={toNHSAppHomePage} |
30 | | - > |
31 | | - Log back in |
32 | | - </button> |
33 | | - </div> |
34 | | - </div> |
35 | | - </MainContent> |
36 | | - </> |
37 | | - ) : ( |
38 | | - <> |
39 | | - <MainContent> |
40 | | - <title>You have been logged out</title> |
41 | | - <h1>You have been logged out</h1> |
42 | | - <p> |
43 | | - For security, you're automatically logged out if you have not used |
44 | | - the service for 10 minutes. |
45 | | - </p> |
46 | | - <p> |
47 | | - If you were entering information, it has not been saved and you will |
48 | | - need to re-enter it. |
49 | | - </p> |
50 | | - <div className={styles.continueButton}> |
51 | | - <button |
52 | | - className="nhsuk-button nhsapp-button" |
53 | | - onClick={toNHSAppHomePage} |
54 | | - > |
55 | | - Continue |
56 | | - </button> |
57 | | - </div> |
58 | | - </MainContent> |
59 | | - </> |
| 13 | + return ( |
| 14 | + <MainContent> |
| 15 | + <title>You have logged out</title> |
| 16 | + <h1>You have logged out</h1> |
| 17 | + <p> |
| 18 | + If you were entering information, it has not been saved and you will |
| 19 | + need to re-enter it. |
| 20 | + </p> |
| 21 | + <p> |
| 22 | + To continue, close the tab which has the service open and login again. |
| 23 | + </p> |
| 24 | + </MainContent> |
60 | 25 | ); |
61 | 26 | }; |
62 | 27 |
|
|
0 commit comments