-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mock api * remove comments * comments * Trying to get the PDF import to work * Add paragraph pattern * Stub fieldset element type * Wire mock PDF data to typesafe objects --------- Co-authored-by: Daniel Naab <[email protected]>
- Loading branch information
1 parent
e5d777c
commit b4ecf4b
Showing
33 changed files
with
1,811 additions
and
122 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { type FormElementComponent } from '../../Form'; | ||
import { type ParagraphElement } from '@atj/forms/src/config/elements/paragraph'; | ||
|
||
const ParagraphElementEdit: FormElementComponent<ParagraphElement> = ({ | ||
element, | ||
}) => { | ||
const { register } = useFormContext(); | ||
return ( | ||
<div className="grid-row grid-gap"> | ||
<div className="grid-col grid-col-10 flex-align-self-end"> | ||
<label className="usa-label"> | ||
Text Element | ||
<input | ||
className="usa-input" | ||
{...register(`${element.id}.data.text`)} | ||
type="text" | ||
></input> | ||
</label> | ||
</div> | ||
<div className="grid-col grid-col-2 flex-align-self-end"> | ||
<label className="usa-label"> | ||
<p className="usa-hint font-ui-3xs">Style</p> | ||
<select className="usa-select" {...register(`${element.id}.type`)}> | ||
<option value={'paragraph'}>Question</option> {/* this is a stub */} | ||
<option value={'paragraph'}>Title</option> {/* this is a stub */} | ||
<option value={'paragraph'}>Instructions</option>{' '} | ||
{/* this is a stub */} | ||
</select> | ||
</label> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ParagraphElementEdit; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
import { type Pattern } from '@atj/forms'; | ||
import { type ParagraphElement } from '@atj/forms/src/config/elements/paragraph'; | ||
|
||
import { type FormElementComponent } from '../../../Form'; | ||
|
||
const FormSummary: FormElementComponent<Pattern<ParagraphElement>> = ({ | ||
pattern, | ||
}) => { | ||
return ( | ||
<> | ||
<p>{pattern.data.text}</p> | ||
</> | ||
); | ||
}; | ||
export default FormSummary; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
import { type Pattern } from '@atj/forms'; | ||
import { type ParagraphElement } from '@atj/forms/src/config/elements/paragraph'; | ||
|
||
import { type FormElementComponent } from '../../../Form'; | ||
|
||
const FormSummary: FormElementComponent<Pattern<ParagraphElement>> = ({ | ||
pattern, | ||
}) => { | ||
return ( | ||
<> | ||
<p>{pattern.data.text}</p> | ||
</> | ||
); | ||
}; | ||
export default FormSummary; |
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
Oops, something went wrong.