Skip to content

Commit

Permalink
hopefully this time?
Browse files Browse the repository at this point in the history
  • Loading branch information
saahithjanapati committed Jul 24, 2023
1 parent c711826 commit 4becc9a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test-site/src/components/HTMLExampleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface CustomRawDataType {
[htmlFieldName]: { html: string }
}

function renderHTMLContent(htmlContent: {__html: string} | undefined) {
function renderHTMLContent(htmlContent: { __html: string } | undefined) {
if ( htmlContent )
{
return <div className="reset-style" dangerouslySetInnerHTML={htmlContent} />;
Expand All @@ -36,15 +36,13 @@ export function HTMLExampleCard(props: CardProps<CustomRawDataType>): JSX.Elemen
cardFeedbackCallback('THUMBS_UP');
}, [cardFeedbackCallback]);

const htmlContent = useMemo(() =>
{return {__html: result.rawData?.[htmlFieldName]?.html}}, [result.rawData?.[htmlFieldName]?.html]);
const html: string = result.rawData?.[htmlFieldName]?.html;
const htmlContent = useMemo(() => { return { __html: html }; }, [html]);

return (
<div className={builtInCssClasses.container}>
<p className={builtInCssClasses.header}>HTML Card</p>
<button onClick={onClickTitle} className={builtInCssClasses.title}>{result.rawData.name}</button>


{renderHTMLContent(htmlContent)}
<button onClick={onClick} className={builtInCssClasses.thumbsFeedbackContainer}>Feedback</button>
</div>
Expand Down

0 comments on commit 4becc9a

Please sign in to comment.