Skip to content

Commit

Permalink
add element for praStatement
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocio De Santiago authored and Rocio De Santiago committed Nov 13, 2024
1 parent 584982f commit d295f36
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 13 additions & 0 deletions services/ui-src/src/components/report/Elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ export const subHeaderElement = (props: PageElementProps) => {
);
};

export const praStatementElement = (props: ParagraphTemplate) => {
return (
<Stack>
{props?.title && (
<Text fontSize="16px" fontWeight="bold">
{props.title}
</Text>
)}
<Text fontSize="16px">{props.text}</Text>
</Stack>
);
};

export const paragraphElement = (props: PageElementProps) => {
const element = props.element as ParagraphTemplate;

Expand Down
11 changes: 4 additions & 7 deletions services/ui-src/src/components/report/ReportPageWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useStore } from "utils";
import { FormProvider, useForm } from "react-hook-form";
import { FormPageTemplate } from "types/report";
import { praStatement } from "../../../../app-api/utils/constants";
import { paragraphElement } from "./Elements";
import { praStatementElement } from "./Elements";

export const ReportPageWrapper = () => {
const {
Expand Down Expand Up @@ -95,6 +95,8 @@ export const ReportPageWrapper = () => {
</Box>
{!currentPage.hideNavButtons && parentPage && (
<>
{/* TO-DO: solidify the Divider behavior for our form controls vs elements in a page
i.e, when table appears as the last element on a form page */}
<Divider></Divider>
<Flex width="100%">
{parentPage.index > 0 && (
Expand All @@ -115,12 +117,7 @@ export const ReportPageWrapper = () => {
)}
</Flex>
<Box flex="auto">
{parentPage.index == 0 &&
paragraphElement({
element: praStatement,
index: 0,
formkey: "praStatement",
})}
{parentPage.index == 0 && praStatementElement(praStatement)}
</Box>
</>
)}
Expand Down

0 comments on commit d295f36

Please sign in to comment.