forked from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
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,62 @@ | ||
/* eslint-disable object-curly-newline */ | ||
/* eslint-disable import/no-cycle */ | ||
/* eslint-disable import/no-unresolved */ | ||
import { Component } from 'preact'; | ||
import { html } from 'htm/preact'; | ||
import { hnodeAs } from './loan-application-form.js'; | ||
|
||
export default class BasicUserDetailsStep extends Component { | ||
static parse(block) { | ||
const [ | ||
introWrapper, | ||
guidanceWrapper, | ||
disclaimerWrapper, | ||
submitButtonWrapper, | ||
] = [...block.children].map((row) => row.firstElementChild); | ||
const intro = introWrapper.children; | ||
const guidance = guidanceWrapper.children; | ||
const disclaimer = disclaimerWrapper.children; | ||
const submitButton = submitButtonWrapper.firstElementChild; | ||
return { intro, guidance, disclaimer, submitButton }; | ||
} | ||
|
||
static defaults = { | ||
into: html`<p>Introduction</p>`, | ||
guidance: html`<p>guidance</p>`, | ||
disclaimer: html`<p>Disclaimer</p>`, | ||
submitButton: html`<button>Submit</button>`, | ||
}; | ||
|
||
render() { | ||
const { | ||
intro, | ||
guidance, | ||
disclaimer, | ||
submitButton, | ||
} = this.props.config; | ||
|
||
return html` | ||
<form> | ||
<div class="basic-user-details-step-description"> | ||
${intro} | ||
</div> | ||
<div class="basic-user-details-step-fields"> | ||
<input type="text" name="fullname" placeholder="Full Name" /> | ||
<input type="text" name="email" placeholder="Email" /> | ||
<input type="text" name="date-of-birth" placeholder="DOB" /> | ||
<input type="text" name="city" placeholder="Search City" /> | ||
<button type="submit"> | ||
${hnodeAs(submitButton, 'span')} | ||
</button> | ||
</div> | ||
<div class="basic-user-details-step-guidance"> | ||
${guidance} | ||
</div> | ||
<div class="basic-user-details-step-disclaimer"> | ||
<input type="checkbox" name="disclaimer" value="accepted" /> | ||
${disclaimer} | ||
</div> | ||
</form> | ||
`; | ||
} | ||
} |
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