Skip to content

Commit

Permalink
Fix: purify incorrect import
Browse files Browse the repository at this point in the history
  • Loading branch information
VitroidFPV committed Dec 8, 2024
1 parent 2cb9857 commit 52cea37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Sponsors/PartnerOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { useColorMode } from '@docusaurus/theme-common';
import { sanitize } from 'dompurify';
import DOMPurify from 'dompurify';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';

Expand All @@ -26,5 +26,5 @@ export default function PartnerOverview(): React.JSX.Element {
);
}

return <div id="partner_overview" className="min-h-[54px]" dangerouslySetInnerHTML={{ __html: sanitize(data) }} />;
return <div id="partner_overview" className="min-h-[54px]" dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(data) }} />;
}
4 changes: 2 additions & 2 deletions src/components/Sponsors/SponsorBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { useColorMode } from '@docusaurus/theme-common';
import { sanitize } from 'dompurify';
import DOMPurify from 'dompurify';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';

Expand Down Expand Up @@ -45,7 +45,7 @@ export default function SponsorBanner(): React.JSX.Element {
return (
<div>
{data ? (
<div className={`transition-opacity duration-1000 min-h-[99px] ${loading ? 'opacity-0' : 'opacity-100'}`} dangerouslySetInnerHTML={{ __html: sanitize(data) }} />
<div className={`transition-opacity duration-1000 min-h-[99px] ${loading ? 'opacity-0' : 'opacity-100'}`} dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(data) }} />
) : (
<div className="min-h-[99px] text-2xl flex justify-center items-center">
<FontAwesomeIcon className="mr-2" icon={faSpinner} spin />
Expand Down

0 comments on commit 52cea37

Please sign in to comment.