From f880c946c4b9cabbc165285638164e6db4d2de9f Mon Sep 17 00:00:00 2001 From: Dmitriy <34593263+shelegdmitriy@users.noreply.github.com> Date: Tue, 8 Aug 2023 19:06:59 +0300 Subject: [PATCH] Hide nearcon banner on it's own page (#334) --- src/components/banners/NearconBanner.tsx | 26 ++++-------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/components/banners/NearconBanner.tsx b/src/components/banners/NearconBanner.tsx index c1c2131da..68d947a7f 100644 --- a/src/components/banners/NearconBanner.tsx +++ b/src/components/banners/NearconBanner.tsx @@ -5,6 +5,7 @@ import styled from 'styled-components'; import icon from '@/assets/images/nearcon_banner_2023.svg'; import { Button } from '@/components/lib/Button'; import { useBanner } from '@/hooks/useBanner'; +import { useCurrentComponentStore } from '@/stores/current-component'; type FlexProps = { gap?: string; @@ -14,13 +15,6 @@ type FlexProps = { wrap?: string; }; -type TextProps = { - size?: string; - lineHeight?: string; - weight?: string; - color?: string; -}; - const Wrapper = styled.div` background: #00ec97; @@ -32,10 +26,8 @@ const Wrapper = styled.div` display: none !important; } } - &.mobile-button { display: none; - @media (max-width: 380px) { display: inline !important; } @@ -73,31 +65,21 @@ const Flex = styled.div` } `; -const Text = styled.p` - font-family: 'FK Grotesk', sans-serif; - font-size: ${(p) => p.size ?? '18px'}; - line-height: ${(p) => p.lineHeight ?? '1.5'}; - font-weight: ${(p) => p.weight ?? '400'}; - color: ${(p) => p.color ?? '#000'}; - margin: 0; -`; - export const NearconBanner = () => { const [isBannerVisible, setBanners] = useBanner(); + const componentSrc = useCurrentComponentStore(); + const isNearconWidget = componentSrc && componentSrc.src?.includes('nearcon23.near/widget/Index'); const closeBanner = () => { setBanners(!isBannerVisible); }; - if (!isBannerVisible) return null; + if (!isBannerVisible || isNearconWidget) return null; return ( nearcon-banner - - Early Bird Tickets are live! -