Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Your contact preference page UI, conditionals to follow in separate t…
…icket (#29431)
- Loading branch information
1 parent
bfd5397
commit 40a42fe
Showing
8 changed files
with
123 additions
and
62 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/applications/ask-va/components/PrefillAlertAndTitle.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); |
36 changes: 36 additions & 0 deletions
36
src/applications/ask-va/config/chapters/personalInformation/yourContactInformation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// import emailUI from '@department-of-veterans-affairs/platform-forms-system/email'; | ||
// import phoneUI from '@department-of-veterans-affairs/platform-forms-system/phone'; | ||
import { | ||
emailSchema, | ||
emailUI, | ||
phoneSchema, | ||
phoneUI, | ||
radioSchema, | ||
radioUI, | ||
} from 'platform/forms-system/src/js/web-component-patterns'; | ||
import PrefillAlertAndTitle from '../../../components/PrefillAlertAndTitle'; | ||
import { CHAPTER_3, contactOptions } from '../../../constants'; | ||
|
||
const yourContactInformationPage = { | ||
uiSchema: { | ||
'ui:description': PrefillAlertAndTitle, | ||
phoneNumber: phoneUI(), | ||
emailAddress: emailUI(), | ||
contactPreference: radioUI({ | ||
title: CHAPTER_3.CONTACT_PREF.QUESTION_1, | ||
description: '', | ||
labels: contactOptions, | ||
}), | ||
}, | ||
schema: { | ||
type: 'object', | ||
required: ['phoneNumber', 'emailAddress', 'contactPreference'], | ||
properties: { | ||
phoneNumber: phoneSchema, | ||
emailAddress: emailSchema, | ||
contactPreference: radioSchema(Object.keys(contactOptions)), | ||
}, | ||
}, | ||
}; | ||
|
||
export default yourContactInformationPage; |
34 changes: 0 additions & 34 deletions
34
src/applications/ask-va/config/chapters/personalInformation/yourPhoneAndEmail.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters