-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DHIS2-17002): display custom text before and after a section (#373)
* feat(DHIS2-17002): display custom text before and after a section * refactor: apply code review comments
- Loading branch information
Showing
7 changed files
with
131 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
export { | ||
PivotedCategoryComboTableBody, | ||
DisplayOptionsProps, | ||
} from '../category-combo-table-body-pivoted/category-combo-table-body-pivoted.js' | ||
export { PivotedCategoryComboTableBody } from '../category-combo-table-body-pivoted/category-combo-table-body-pivoted.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,24 @@ | ||
import * as DOMPurify from 'dompurify' | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import styles from './section.module.css' | ||
|
||
export const SectionDescription = ({ children }) => { | ||
if (!children) { | ||
return null | ||
} | ||
const html = DOMPurify.sanitize(children, { | ||
ALLOWED_TAGS: ['a', 'b', 'strong', 'underline'], | ||
}) | ||
|
||
return ( | ||
<div | ||
className={styles.sectionDescription} | ||
dangerouslySetInnerHTML={{ __html: html }} | ||
></div> | ||
) | ||
} | ||
|
||
SectionDescription.propTypes = { | ||
children: PropTypes.node, | ||
} |
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
0fdd239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://dhis2-data-entry.netlify.app as production
🚀 Deployed on https://65f87cdcebe2b600a290d064--dhis2-data-entry.netlify.app