From 3132a39816c2137dcc4df0d9e23019200fce9384 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 19 Apr 2023 00:57:41 +0100 Subject: [PATCH] Fix sponsor opener --- src/components/Sponsor/sponsor.js | 4 ++-- src/components/TopicDetail/TopicDetail.tsx | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Sponsor/sponsor.js b/src/components/Sponsor/sponsor.js index 8390791e1..3d3975610 100644 --- a/src/components/Sponsor/sponsor.js +++ b/src/components/Sponsor/sponsor.js @@ -1,12 +1,12 @@ import { sponsorHidden } from '../../stores/page'; -function showHideSponsor(isHidden) { +function showHideSponsor(shouldHide) { const ad = document.querySelector('#sponsor-ad'); if (!ad) { return; } - if (isHidden) { + if (shouldHide) { ad.classList.add('hidden'); ad.classList.remove('flex'); } else { diff --git a/src/components/TopicDetail/TopicDetail.tsx b/src/components/TopicDetail/TopicDetail.tsx index cc5258fc9..a096c9cb5 100644 --- a/src/components/TopicDetail/TopicDetail.tsx +++ b/src/components/TopicDetail/TopicDetail.tsx @@ -84,7 +84,6 @@ export function TopicDetail() { // Close the topic detail when user clicks outside the topic detail useOutsideClick(topicRef, () => { setIsActive(false); - sponsorHidden.set(false); }); useKeydown('Escape', () => {