From 51dd78a62945896d0719f064b39943498e73e451 Mon Sep 17 00:00:00 2001 From: leifu Date: Sat, 15 Jul 2023 17:42:49 +0300 Subject: [PATCH] Fix: Remove the blog link from banner (#2609) --- packages/app/package.json | 2 +- packages/app/src/constants/announcement.ts | 3 +-- .../src/sections/shared/Layout/HomeLayout/Banner.tsx | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 3ef0c20e3..e139642ac 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@kwenta/app", - "version": "7.4.0", + "version": "7.4.3", "scripts": { "dev": "next", "build": "next build", diff --git a/packages/app/src/constants/announcement.ts b/packages/app/src/constants/announcement.ts index 18eb49a92..132454da5 100644 --- a/packages/app/src/constants/announcement.ts +++ b/packages/app/src/constants/announcement.ts @@ -4,8 +4,7 @@ import { MILLISECONDS_PER_DAY } from '@kwenta/sdk/constants' export const BANNER_ENABLED = true // Sets the link destination for the banner component, or renders the banner as // plain, un-clickable text if set to a falsey value (`false`, `null`, '', etc...) -export const BANNER_LINK_URL = - 'https://mirror.xyz/kwenta.eth/Z7hEjkIUDwSXI1VcpG6Z90cAufXWeoC6Gg-TWcIr6jQ' +export const BANNER_LINK_URL = '' // Sets the text displayed on the home page banner export const BANNER_TEXT = 'The staking contracts are currently paused.' // Sets the height of the banner component on desktop diff --git a/packages/app/src/sections/shared/Layout/HomeLayout/Banner.tsx b/packages/app/src/sections/shared/Layout/HomeLayout/Banner.tsx index 3f6301517..8527fd33e 100644 --- a/packages/app/src/sections/shared/Layout/HomeLayout/Banner.tsx +++ b/packages/app/src/sections/shared/Layout/HomeLayout/Banner.tsx @@ -23,7 +23,7 @@ import localStore from 'utils/localStore' type BannerViewProps = { mode: 'mobile' | 'desktop' onDismiss: (e: any) => void - onDetails: () => void + onDetails?: () => void } const BannerView: React.FC = ({ mode, onDismiss, onDetails }) => { @@ -33,7 +33,7 @@ const BannerView: React.FC = ({ mode, onDismiss, onDetails }) = const linkSize = isMobile ? 'small' : 'medium' return ( - + Important: @@ -77,7 +77,7 @@ const Banner = memo(() => { ) const openDetails = useCallback( - () => window.open(BANNER_LINK_URL, '_blank', 'noopener noreferrer'), + () => BANNER_LINK_URL && window.open(BANNER_LINK_URL, '_blank', 'noopener noreferrer'), [] ) @@ -107,14 +107,14 @@ const FuturesLink = styled(Body)` `}; ` -const FuturesBannerContainer = styled.div<{ $compact?: boolean }>` +const FuturesBannerContainer = styled.div<{ $compact?: boolean; hasDetails?: boolean }>` height: ${BANNER_HEIGHT_DESKTOP}px; width: 100%; display: flex; align-items: center; background: ${(props) => props.theme.colors.selectedTheme.newTheme.banner.yellow.background}; margin-bottom: 0; - cursor: pointer; + cursor: ${(props) => (props.hasDetails ? 'pointer' : 'auto')}; ${media.lessThan('md')` position: relative;