Fix sponsor opener

pull/3832/head
Kamran Ahmed 2 years ago
parent 03f9fa51ff
commit 3132a39816
  1. 4
      src/components/Sponsor/sponsor.js
  2. 1
      src/components/TopicDetail/TopicDetail.tsx

@ -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 {

@ -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', () => {

Loading…
Cancel
Save