Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove the blog link from banner #2609

Merged
merged 6 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kwenta/app",
"version": "7.4.0",
"version": "7.4.3",
"scripts": {
"dev": "next",
"build": "next build",
Expand Down
3 changes: 1 addition & 2 deletions packages/app/src/constants/announcement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions packages/app/src/sections/shared/Layout/HomeLayout/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<BannerViewProps> = ({ mode, onDismiss, onDetails }) => {
Expand All @@ -33,7 +33,7 @@ const BannerView: React.FC<BannerViewProps> = ({ mode, onDismiss, onDetails }) =
const linkSize = isMobile ? 'small' : 'medium'

return (
<FuturesBannerContainer onClick={onDetails}>
<FuturesBannerContainer onClick={onDetails} hasDetails={!!BANNER_LINK_URL}>
<FuturesBannerLinkWrapper>
<FuturesLink size={linkSize}>
<strong>Important: </strong>
Expand Down Expand Up @@ -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'),
[]
)

Expand Down Expand Up @@ -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;
Expand Down
Loading