Compare commits
1 Commits
dependabot
...
inf-769
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02c4b8b97b |
@@ -13,12 +13,12 @@ const defaultSanitizeOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function HTMLLoader({
|
function HTMLLoader({
|
||||||
htmlNode, componentId, cssClassName, testId,
|
htmlNode, componentId, cssClassName, testId, delay,
|
||||||
}) {
|
}) {
|
||||||
const sanitizedMath = DOMPurify.sanitize(htmlNode, { ...defaultSanitizeOptions });
|
const sanitizedMath = DOMPurify.sanitize(htmlNode, { ...defaultSanitizeOptions });
|
||||||
const previewRef = useRef();
|
const previewRef = useRef();
|
||||||
|
|
||||||
const debouncedPostContent = useDebounce(htmlNode, 500);
|
const debouncedPostContent = useDebounce(htmlNode, delay);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let promise = Promise.resolve(); // Used to hold chain of typesetting calls
|
let promise = Promise.resolve(); // Used to hold chain of typesetting calls
|
||||||
@@ -45,6 +45,7 @@ HTMLLoader.propTypes = {
|
|||||||
componentId: PropTypes.string,
|
componentId: PropTypes.string,
|
||||||
cssClassName: PropTypes.string,
|
cssClassName: PropTypes.string,
|
||||||
testId: PropTypes.string,
|
testId: PropTypes.string,
|
||||||
|
delay: PropTypes.number,
|
||||||
};
|
};
|
||||||
|
|
||||||
HTMLLoader.defaultProps = {
|
HTMLLoader.defaultProps = {
|
||||||
@@ -52,6 +53,7 @@ HTMLLoader.defaultProps = {
|
|||||||
componentId: null,
|
componentId: null,
|
||||||
cssClassName: '',
|
cssClassName: '',
|
||||||
testId: '',
|
testId: '',
|
||||||
|
delay: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default HTMLLoader;
|
export default HTMLLoader;
|
||||||
|
|||||||
@@ -29,7 +29,13 @@ function PostPreviewPane({
|
|||||||
className="float-right p-3"
|
className="float-right p-3"
|
||||||
iconClassNames="icon-size"
|
iconClassNames="icon-size"
|
||||||
/>
|
/>
|
||||||
<HTMLLoader htmlNode={htmlNode} cssClassName="text-primary" componentId="post-preview" testId="post-preview" />
|
<HTMLLoader
|
||||||
|
htmlNode={htmlNode}
|
||||||
|
cssClassName="text-primary"
|
||||||
|
componentId="post-preview"
|
||||||
|
testId="post-preview"
|
||||||
|
delay={500}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="d-flex justify-content-end">
|
<div className="d-flex justify-content-end">
|
||||||
|
|||||||
Reference in New Issue
Block a user