Skip to content

Commit

Permalink
refactor: added some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 committed Dec 20, 2024
1 parent 112c185 commit 2e0f969
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions src/components/SitewideBanner/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ const SitewideBanner = ({
}
};

if (!isVisible) {
if (isVisible) {
return (
<Alert
variant={type}
dismissible={dismissible}
onClose={handleDismiss}
className="mb-4"
>
<Container>
<div dangerouslySetInnerHTML={{ __html: message }} />

Check warning on line 35 in src/components/SitewideBanner/index.jsx

View workflow job for this annotation

GitHub Actions / tests

Dangerous property 'dangerouslySetInnerHTML' found
</Container>
</Alert>
);
} else {

Check failure on line 39 in src/components/SitewideBanner/index.jsx

View workflow job for this annotation

GitHub Actions / tests

Unnecessary 'else' after 'return'
return null;
}

return (
<Alert
variant={type}
dismissible={dismissible}
onClose={handleDismiss}
className="mb-4"
>
<Container>
<div dangerouslySetInnerHTML={{ __html: message }} />
</Container>
</Alert>
);
};

SitewideBanner.propTypes = {
Expand Down
4 changes: 2 additions & 2 deletions src/containers/MainApp/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const MainApp = () => (
<Header />
<SitewideBanner
message={process.env.SITEWIDE_BANNER_CONTENT || ''}
type="primary"
type="warning"
dismissible
cookieName="sitewidebannerDismissed"
cookieName="publisherSiteWideBannerDismissed"
cookieExpiryDays={30}
/>
<main>
Expand Down

0 comments on commit 2e0f969

Please sign in to comment.