-
Notifications
You must be signed in to change notification settings - Fork 125
/
InterstitialPage.jsx
79 lines (70 loc) · 2.02 KB
/
InterstitialPage.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import React, { useEffect, useMemo } from 'react';
import PropType from 'prop-types';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
import CrisisLineConnectButton from '../components/CrisisLineConnectButton';
const InterstitialPage = props => {
const { acknowledge, type } = props;
useEffect(() => {
focusElement(document.querySelector('h1'));
}, []);
const continueButtonText = useMemo(
() => {
switch (type) {
case 'reply':
return 'Continue to reply';
case 'draft':
return 'Continue to draft';
default:
return 'Continue to start message';
}
},
[type],
);
return (
<div className="interstitial-page">
<h1>
Only use messages for <span className="no-word-wrap">non-urgent</span>{' '}
needs
</h1>
<div>
<p>
Your care team may take up to <strong>3 business days</strong> to
reply.
</p>
<va-button
data-testid="continue-button"
onClick={acknowledge}
text={continueButtonText}
/>
<h2 className="vads-u-font-size--h3">
If you need help sooner, use one of these urgent communication
options:
</h2>
<ul>
<li>
<p>
<strong>
If you’re in crisis or having thoughts of suicide,{' '}
</strong>{' '}
connect with our Veterans Crisis Line. We offer confidential
support anytime, day or night.
</p>
<CrisisLineConnectButton />
</li>
<li>
<p>
<strong>If you think your life or health is in danger, </strong>{' '}
call <va-telephone contact="911" /> or go to the nearest emergency
room.
</p>
</li>
</ul>
</div>
</div>
);
};
InterstitialPage.propTypes = {
acknowledge: PropType.func,
type: PropType.string,
};
export default InterstitialPage;