Commit a14d2df8 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

feat: add thumbnails to /about (#5586)

* remove these icons

* destructure

* move to constants

* update thumbnails
parent 09511b06
import swapSrc from './images/swap.png'
import walletsSrc from './images/wallets.png'
export const CARDS = [
{
to: '/swap',
title: 'Swap tokens',
description: 'Discover and swap top tokens on Ethereum, Polygon, Optimism, and more.',
},
{
to: '/nfts',
title: 'Trade NFTs',
description: 'Buy & sell NFTs across marketplaces to find more listings at better prices.',
},
{
to: '/pool',
title: 'Earn fees',
description: 'Provide liquidity to pools on Uniswap and earn fees on swaps.',
},
{
to: 'https://support.uniswap.org/',
external: true,
title: 'Build dApps',
description: 'Build on the largest DeFi protocol on Ethereum with our tools.',
},
]
export const STEPS = [
{
title: 'Connect a wallet',
description: 'Connect your preferred crypto wallet to the Uniswap Interface.',
imgSrc: walletsSrc,
},
{
title: 'Swap!',
description: 'Trade crypto and NFTs through Uniswap’s platform',
imgSrc: swapSrc,
},
]
import coinbaseWalletIcon from 'assets/images/coinbaseWalletIcon.svg'
import metaMaskIcon from 'assets/images/metamask.png'
import phantomIcon from 'assets/images/phantom.png'
import rainbowIcon from 'assets/images/rainbow.png'
import walletConnectIcon from 'assets/images/walletConnectIcon.svg'
import { ButtonOutlined } from 'components/Button' import { ButtonOutlined } from 'components/Button'
import { Box } from 'nft/components/Box' import { useState } from 'react'
import { DiscordIconMenu, GithubIconMenu, TwitterIconMenu } from 'nft/components/icons'
import { ReactNode, useState } from 'react'
import { useIsDarkMode } from 'state/user/hooks' import { useIsDarkMode } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components/macro' import styled from 'styled-components/macro'
import { BREAKPOINTS } from 'theme' import { BREAKPOINTS } from 'theme'
import Card from './Card' import Card from './Card'
import { CARDS, STEPS } from './constants'
import Step from './Step' import Step from './Step'
import { SubTitle, Title } from './Title' import { SubTitle, Title } from './Title'
const MOBILE_BREAKPOINT = BREAKPOINTS.md const MOBILE_BREAKPOINT = BREAKPOINTS.md
const IconRow = styled.span`
display: flex;
flex-direction: row;
`
const Icon = ({ href, children }: { href?: string; children: ReactNode }) => {
return (
<Box
as={href ? 'a' : 'div'}
href={href ?? undefined}
target={href ? '_blank' : undefined}
rel={href ? 'noopener noreferrer' : undefined}
display="flex"
flexDirection="column"
color="textPrimary"
background="none"
border="none"
justifyContent="center"
textAlign="center"
marginRight="12"
>
{children}
</Box>
)
}
const Page = styled.span<{ isDarkMode: boolean }>` const Page = styled.span<{ isDarkMode: boolean }>`
width: 100%; width: 100%;
align-self: center; align-self: center;
...@@ -97,23 +65,6 @@ const CardGrid = styled.div` ...@@ -97,23 +65,6 @@ const CardGrid = styled.div`
} }
` `
const WalletIconGrid = styled.div`
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 50px;
`
const WalletIconRow = styled.div`
display: flex;
gap: 50px;
`
const WalletIcon = styled.img`
width: 100px;
height: 100px;
`
const InfoButton = styled(ButtonOutlined)` const InfoButton = styled(ButtonOutlined)`
font-size: 24px; font-size: 24px;
line-height: 32px; line-height: 32px;
...@@ -145,48 +96,16 @@ const IntroCopy = styled.p` ...@@ -145,48 +96,16 @@ const IntroCopy = styled.p`
margin: 0; margin: 0;
` `
const GetStarted = styled.div` const ThumbnailContainer = styled.div`
margin-bottom: 100px; align-self: center;
` `
const CARDS = [ const Thumbnail = styled.img`
{ width: 100%;
to: '/swap', `
title: 'Swap tokens',
description: 'Discover and swap top tokens on Ethereum, Polygon, Optimism, and more.',
},
{
to: '/nfts',
title: 'Trade NFTs',
description: 'Buy & sell NFTs across marketplaces to find more listings at better prices.',
},
{
to: '/pool',
title: 'Earn fees',
description: 'Provide liquidity to pools on Uniswap and earn fees on swaps.',
},
{
to: 'https://support.uniswap.org/',
external: true,
title: 'Build dApps',
description: 'Build on the largest DeFi protocol on Ethereum with our tools.',
},
]
const STEPS = [
{
title: 'Connect a wallet',
description: 'Connect your preferred crypto wallet to the Uniswap Interface.',
},
{
title: 'Swap!',
description: 'Trade crypto and NFTs through Uniswap’s platform',
},
]
export default function About() { export default function About() {
const isDarkMode = useIsDarkMode() const isDarkMode = useIsDarkMode()
const theme = useTheme()
const [selectedStepIndex, setSelectedStepIndex] = useState(0) const [selectedStepIndex, setSelectedStepIndex] = useState(0)
...@@ -214,24 +133,12 @@ export default function About() { ...@@ -214,24 +133,12 @@ export default function About() {
<Card key={card.title} {...card} /> <Card key={card.title} {...card} />
))} ))}
</CardGrid> </CardGrid>
<Body>
<div> <div>
<GetStarted>
<SubTitle isDarkMode={isDarkMode}>Get Started</SubTitle> <SubTitle isDarkMode={isDarkMode}>Get Started</SubTitle>
</GetStarted> <Body>
<WalletIconGrid> <ThumbnailContainer>
<WalletIconRow> <Thumbnail alt="Thumbnail" src={STEPS[selectedStepIndex]?.imgSrc} />
<WalletIcon src={metaMaskIcon} alt="MetaMask" /> </ThumbnailContainer>
<WalletIcon src={walletConnectIcon} alt="WalletConnect" />
<WalletIcon src={coinbaseWalletIcon} alt="Coinbase Wallet" />
</WalletIconRow>
<WalletIconRow>
<WalletIcon src={rainbowIcon} alt="Rainbow" />
<WalletIcon src={phantomIcon} alt="Phantom" />
<WalletIcon src={walletConnectIcon} alt="WalletConnect" />
</WalletIconRow>
</WalletIconGrid>
</div>
<StepList> <StepList>
{STEPS.map((step, index) => ( {STEPS.map((step, index) => (
<Step <Step
...@@ -239,22 +146,13 @@ export default function About() { ...@@ -239,22 +146,13 @@ export default function About() {
onClick={() => setSelectedStepIndex(index)} onClick={() => setSelectedStepIndex(index)}
index={index} index={index}
key={step.title} key={step.title}
{...step} title={step.title}
description={step.description}
/> />
))} ))}
</StepList> </StepList>
</Body> </Body>
<IconRow> </div>
<Icon href="https://discord.com/invite/FCfyBSbCU5">
<DiscordIconMenu width={24} height={24} color={theme.textSecondary} />
</Icon>
<Icon href="https://twitter.com/Uniswap">
<TwitterIconMenu width={24} height={24} color={theme.textSecondary} />
</Icon>
<Icon href="https://github.com/Uniswap">
<GithubIconMenu width={24} height={24} color={theme.textSecondary} />
</Icon>
</IconRow>
</Content> </Content>
</Page> </Page>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment