-
Notifications
You must be signed in to change notification settings - Fork 126
/
PrefillAlertAndTitle.jsx
47 lines (42 loc) · 1.08 KB
/
PrefillAlertAndTitle.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
import { isLoggedIn } from '@department-of-veterans-affairs/platform-user/selectors';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
const Title = () => (
<>
<legend className="schemaform-block-title">
<h3 className="vads-u-color--gray-dark vads-u-margin-top--24">
Your contact information
</h3>
</legend>
</>
);
const PrefillAlertAndTitle = ({ loggedIn }) => {
return loggedIn ? (
<>
<va-alert
close-btn-aria-label="Close notification"
status="info"
uswds
visible
>
<p className="vads-u-margin-y--0">
We’ve prefilled some of your information from your account. If you
need to correct anything, you can edit the form fields below.
</p>
</va-alert>
<Title />
</>
) : (
<Title />
);
};
PrefillAlertAndTitle.propTypes = {
loggedIn: PropTypes.bool,
};
function mapStateToProps(state) {
return {
loggedIn: isLoggedIn(state),
};
}
export default connect(mapStateToProps)(PrefillAlertAndTitle);