From 049a7d1d6a78bdbce8035928827bd530e6b89e48 Mon Sep 17 00:00:00 2001 From: Vignesh Mohankumar Date: Wed, 7 Dec 2022 18:46:40 -0500 Subject: [PATCH] feat: add learn more button (#5572) * fix pointer * buttons * fix gap * buttons wrapper * order --- src/components/Button/index.tsx | 17 +-------- src/components/swap/styleds.tsx | 3 +- src/pages/Landing/index.tsx | 66 ++++++++++++++++++++++++++------- 3 files changed, 55 insertions(+), 31 deletions(-) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 864c603fff..f1695fc3d9 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -7,7 +7,7 @@ import { RowBetween } from '../Row' type ButtonProps = Omit -const BaseButton = styled(RebassButton)< +export const BaseButton = styled(RebassButton)< { padding?: string width?: string @@ -211,30 +211,15 @@ export const ButtonEmpty = styled(BaseButton)` } ` -export const ButtonCTA = styled(BaseButton)<{ redesignFlag?: boolean }>` - background: linear-gradient(10deg, rgba(255, 0, 199, 1) 0%, rgba(255, 159, 251, 1) 100%); - width: fit-content; - border-radius: 24px; - border: none; - padding: 16px 77.5px; - margin-left: 12px; - margin-bottom: 12px; - color: ${({ theme }) => theme.white}; - &:hover { - opacity: 75%; - } -` export const ButtonText = styled(BaseButton)` padding: 0; width: fit-content; background: none; text-decoration: none; &:focus { - // eslint-disable-next-line @typescript-eslint/no-unused-vars text-decoration: underline; } &:hover { - // text-decoration: underline; opacity: 0.9; } &:active { diff --git a/src/components/swap/styleds.tsx b/src/components/swap/styleds.tsx index 722afe8c6a..a3dd816ade 100644 --- a/src/components/swap/styleds.tsx +++ b/src/components/swap/styleds.tsx @@ -30,8 +30,9 @@ export const SwapWrapper = styled.main<{ margin?: string; maxWidth?: string; ope border: 1px solid ${({ theme }) => theme.backgroundOutline}; padding: 8px; z-index: ${Z_INDEX.deprecated_content}; - cursor: ${({ open }) => (open ? 'pointer' : 'suto')}; + cursor: ${({ open }) => open && 'pointer'}; transition: transform 250ms ease; + &:hover { border: 1px solid ${({ theme, open }) => (open ? theme.accentAction : theme.backgroundOutline)}; transform: ${({ open }) => (open ? `translateY(-4px)` : `none`)}; diff --git a/src/pages/Landing/index.tsx b/src/pages/Landing/index.tsx index 3b51665cdd..21e5665e98 100644 --- a/src/pages/Landing/index.tsx +++ b/src/pages/Landing/index.tsx @@ -1,6 +1,7 @@ -import { ButtonCTA } from 'components/Button' +import { BaseButton } from 'components/Button' +import { LandingPageVariant, useLandingPageFlag } from 'featureFlags/flags/landingPage' import Swap from 'pages/Swap' -import { PropsWithChildren } from 'react' +import { useLocation } from 'react-router-dom' import { Link } from 'react-router-dom' import { useIsDarkMode } from 'state/user/hooks' import styled from 'styled-components/macro' @@ -71,7 +72,28 @@ const SubText = styled.h3` } ` -const Button = styled(ButtonCTA)` +const CTAButton = styled(BaseButton)` + padding: 16px; + border-radius: 24px; + color: ${({ theme }) => theme.white}; + + &:hover { + opacity: 50%; + } +` + +const ButtonCTA = styled(CTAButton)` + background: linear-gradient(10deg, rgba(255, 0, 199, 1) 0%, rgba(255, 159, 251, 1) 100%); + border: none; +` + +const ButtonCTASecondary = styled(CTAButton)` + background: none; + border: ${({ theme }) => `1px solid ${theme.textPrimary}`}; +` + +const ButtonCTAText = styled.p` + margin: 0px; font-size: 16px; white-space: nowrap; @@ -84,29 +106,45 @@ const Button = styled(ButtonCTA)` } ` -const TitleContentWrapper = styled.span` +const TitleWrapper = styled.span` max-width: 720px; ` -const ContentWrapper = styled.span` - max-width: 720px; +const ActionsWrapper = styled.span` + display: flex; + justify-content: center; + gap: 24px; + width: 100%; + + & > * { + max-width: 288px; + flex: 1; + } ` -export default function Landing(props: PropsWithChildren) { +export default function Landing() { const isDarkMode = useIsDarkMode() + const location = useLocation() + const isOpen = location.pathname === '/' + + if (useLandingPageFlag() === LandingPageVariant.Control || !isOpen) return null + return ( <> - + Trade crypto & NFTs with confidence. Uniswap is the best way to buy, sell, and manage your tokens and NFTs. - - - - + + + + Continue + + + Learn More + +