Commit 1a6fe3c1 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

chore: remove more unused exports (#5515)

* chore: remove more unused exports

* remove surveypopup

* rm NewMenu
parent a49ff491
...@@ -12,12 +12,7 @@ import { Wallet } from '@ethersproject/wallet' ...@@ -12,12 +12,7 @@ import { Wallet } from '@ethersproject/wallet'
const TEST_PRIVATE_KEY = '0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e770523b4666d19' const TEST_PRIVATE_KEY = '0xe580410d7c37d26c6ad1a837bbae46bc27f9066a466fb3a66e770523b4666d19'
// address of the above key // address of the above key
export const TEST_ADDRESS_NEVER_USE = new Wallet(TEST_PRIVATE_KEY).address const TEST_ADDRESS_NEVER_USE = new Wallet(TEST_PRIVATE_KEY).address
export const TEST_ADDRESS_NEVER_USE_SHORTENED = `${TEST_ADDRESS_NEVER_USE.substr(
0,
6
)}...${TEST_ADDRESS_NEVER_USE.substr(-4, 4)}`
const provider = new JsonRpcProvider('https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847', 4) const provider = new JsonRpcProvider('https://goerli.infura.io/v3/4bf032f2d38a4ed6bb975b80d6340847', 4)
const signer = new Wallet(TEST_PRIVATE_KEY, provider) const signer = new Wallet(TEST_PRIVATE_KEY, provider)
......
...@@ -7,7 +7,7 @@ import { RowBetween } from '../Row' ...@@ -7,7 +7,7 @@ import { RowBetween } from '../Row'
type ButtonProps = Omit<ButtonPropsOriginal, 'css'> type ButtonProps = Omit<ButtonPropsOriginal, 'css'>
export const BaseButton = styled(RebassButton)< const BaseButton = styled(RebassButton)<
{ {
padding?: string padding?: string
width?: string width?: string
......
import { Trans } from '@lingui/macro'
import { useWeb3React } from '@web3-react/core'
import { SupportedChainId } from 'constants/chains'
import { AlertOctagon } from 'react-feather'
import styled from 'styled-components/macro'
import { ExternalLink } from 'theme'
import { isL2ChainId } from '../../utils/chains'
const Root = styled.div`
background-color: ${({ theme }) => (theme.darkMode ? '#888D9B' : '#CED0D9')};
border-radius: 18px;
color: black;
display: flex;
flex-direction: row;
font-size: 14px;
margin: 12px auto;
padding: 16px;
width: 100%;
max-width: 880px;
`
const WarningIcon = styled(AlertOctagon)`
margin: auto 16px auto 0;
min-height: 22px;
min-width: 22px;
`
const ReadMoreLink = styled(ExternalLink)`
color: black;
text-decoration: underline;
`
function Wrapper({ children }: { children: React.ReactNode }) {
return (
<Root>
<WarningIcon />
<div>{children}</div>
</Root>
)
}
/**
* Shows a downtime warning for the network if it's relevant
*/
export default function DowntimeWarning() {
const { chainId } = useWeb3React()
if (!isL2ChainId(chainId)) {
return null
}
switch (chainId) {
case SupportedChainId.OPTIMISM:
case SupportedChainId.OPTIMISM_GOERLI:
return (
<Wrapper>
<Trans>
Optimism is in Beta and may experience downtime. Optimism expects planned downtime to upgrade the network in
the near future. During downtime, your position will not earn fees and you will be unable to remove
liquidity.{' '}
<ReadMoreLink href="https://help.uniswap.org/en/articles/5406082-what-happens-if-the-optimistic-ethereum-network-experiences-downtime">
Read more.
</ReadMoreLink>
</Trans>
</Wrapper>
)
case SupportedChainId.ARBITRUM_ONE:
case SupportedChainId.ARBITRUM_RINKEBY:
return (
<Wrapper>
<Trans>
Arbitrum is in Beta and may experience downtime. During downtime, your position will not earn fees and you
will be unable to remove liquidity.{' '}
<ReadMoreLink href="https://help.uniswap.org/en/articles/5576122-arbitrum-network-downtime">
Read more.
</ReadMoreLink>
</Trans>
</Wrapper>
)
default:
return null
}
}
...@@ -9,8 +9,8 @@ import { Line } from './Line' ...@@ -9,8 +9,8 @@ import { Line } from './Line'
import { ChartEntry, LiquidityChartRangeInputProps } from './types' import { ChartEntry, LiquidityChartRangeInputProps } from './types'
import Zoom, { ZoomOverlay } from './Zoom' import Zoom, { ZoomOverlay } from './Zoom'
export const xAccessor = (d: ChartEntry) => d.price0 const xAccessor = (d: ChartEntry) => d.price0
export const yAccessor = (d: ChartEntry) => d.activeLiquidity const yAccessor = (d: ChartEntry) => d.activeLiquidity
export function Chart({ export function Chart({
id = 'liquidityChartRangeInput', id = 'liquidityChartRangeInput',
......
...@@ -5,12 +5,12 @@ export interface ChartEntry { ...@@ -5,12 +5,12 @@ export interface ChartEntry {
price0: number price0: number
} }
export interface Dimensions { interface Dimensions {
width: number width: number
height: number height: number
} }
export interface Margins { interface Margins {
top: number top: number
right: number right: number
bottom: number bottom: number
......
...@@ -3,7 +3,7 @@ import useTokenLogoSource from 'hooks/useAssetLogoSource' ...@@ -3,7 +3,7 @@ import useTokenLogoSource from 'hooks/useAssetLogoSource'
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
export const MissingImageLogo = styled.div<{ size?: string }>` const MissingImageLogo = styled.div<{ size?: string }>`
--size: ${({ size }) => size}; --size: ${({ size }) => size};
border-radius: 100px; border-radius: 100px;
color: ${({ theme }) => theme.textPrimary}; color: ${({ theme }) => theme.textPrimary};
......
This diff is collapsed.
...@@ -34,7 +34,7 @@ interface SearchBarDropdownSectionProps { ...@@ -34,7 +34,7 @@ interface SearchBarDropdownSectionProps {
eventProperties: Record<string, unknown> eventProperties: Record<string, unknown>
} }
export const SearchBarDropdownSection = ({ const SearchBarDropdownSection = ({
toggleOpen, toggleOpen,
suggestions, suggestions,
header, header,
......
...@@ -15,13 +15,6 @@ const L2Icon = styled.img` ...@@ -15,13 +15,6 @@ const L2Icon = styled.img`
margin-right: 16px; margin-right: 16px;
` `
export const Controls = styled.div`
align-items: center;
display: flex;
justify-content: flex-start;
padding: 0 20px 20px 20px;
`
const BodyText = styled.div` const BodyText = styled.div`
color: ${({ color }) => color}; color: ${({ color }) => color};
display: flex; display: flex;
...@@ -46,7 +39,7 @@ const SHOULD_SHOW_ALERT = { ...@@ -46,7 +39,7 @@ const SHOULD_SHOW_ALERT = {
[SupportedChainId.CELO_ALFAJORES]: true, [SupportedChainId.CELO_ALFAJORES]: true,
} }
export type NetworkAlertChains = keyof typeof SHOULD_SHOW_ALERT type NetworkAlertChains = keyof typeof SHOULD_SHOW_ALERT
const BG_COLORS_BY_DARK_MODE_AND_CHAIN_ID: { const BG_COLORS_BY_DARK_MODE_AND_CHAIN_ID: {
[darkMode in 'dark' | 'light']: { [chainId in NetworkAlertChains]: string } [darkMode in 'dark' | 'light']: { [chainId in NetworkAlertChains]: string }
......
import { Trans } from '@lingui/macro'
import { sendEvent } from 'components/analytics'
import { AutoColumn } from 'components/Column'
import { RowFixed } from 'components/Row'
import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp'
import { useEffect } from 'react'
import { MessageCircle, X } from 'react-feather'
import { useShowSurveyPopup } from 'state/user/hooks'
import styled, { useTheme } from 'styled-components/macro'
import { ExternalLink, ThemedText } from 'theme'
import { Z_INDEX } from 'theme/zIndex'
import BGImage from '../../assets/images/survey-orb.svg'
const Wrapper = styled(AutoColumn)`
background: #edeef2;
position: relative;
border-radius: 12px;
padding: 18px;
max-width: 360px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
color: ${({ theme }) => theme.deprecated_text1};
overflow: hidden;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
max-width: 100%;
`}
`
const BGOrb = styled.img`
position: absolute;
right: -64px;
top: -64px;
width: 180px;
z-index: ${Z_INDEX.sticky};
`
const WrappedCloseIcon = styled(X)`
position: absolute;
top: 10px;
right: 10px;
width: 20px;
height: 20px;
stroke: #7c7c80;
z-index: ${Z_INDEX.fixed};
:hover {
cursor: pointer;
opacity: 0.8;
}
`
const END_TIMESTAMP = 1642272346 // Jan 15th
export default function SurveyPopup() {
const theme = useTheme()
const [showPopup, setShowSurveyPopup] = useShowSurveyPopup()
// show popup to 1% of users
useEffect(() => {
// has not visited page during A/B testing if undefined
if (showPopup === undefined) {
if (Math.random() < 0.01) {
setShowSurveyPopup(true)
// log a case of succesful view
sendEvent({
category: 'Survey',
action: 'Saw Survey',
})
}
}
}, [setShowSurveyPopup, showPopup])
// limit survey to 24 hours based on timestamps
const timestamp = useCurrentBlockTimestamp()
const durationOver = timestamp ? timestamp.toNumber() > END_TIMESTAMP : false
return (
<>
{!showPopup || durationOver ? null : (
<Wrapper gap="10px">
<WrappedCloseIcon
onClick={() => {
sendEvent({
category: 'Survey',
action: 'Clicked Survey Link',
})
setShowSurveyPopup(false)
}}
/>
<BGOrb src={BGImage} />
<ExternalLink href="https://www.surveymonkey.com/r/YGWV9VD">
<RowFixed>
<MessageCircle stroke={theme.deprecated_black} size="20px" strokeWidth="1px" />
<ThemedText.DeprecatedWhite fontWeight={600} color={theme.deprecated_black} ml="6px">
<Trans>Tell us what you think ↗</Trans>
</ThemedText.DeprecatedWhite>
</RowFixed>
</ExternalLink>
<ThemedText.DeprecatedBlack
style={{ zIndex: Z_INDEX.fixed }}
fontWeight={400}
fontSize="12px"
color={theme.deprecated_black}
>
<Trans>Take a 10 minute survey to help us improve your experience in the Uniswap app.</Trans>
</ThemedText.DeprecatedBlack>
</Wrapper>
)}
</>
)
}
import { useWeb3React } from '@web3-react/core'
import { AlertCircle, CheckCircle } from 'react-feather'
import styled, { useTheme } from 'styled-components/macro'
import { useTransaction } from '../../state/transactions/hooks'
import { ThemedText } from '../../theme'
import { ExternalLink } from '../../theme'
import { ExplorerDataType, getExplorerLink } from '../../utils/getExplorerLink'
import { TransactionSummary } from '../AccountDetails/TransactionSummary'
import { AutoColumn } from '../Column'
import { AutoRow } from '../Row'
const RowNoFlex = styled(AutoRow)`
flex-wrap: nowrap;
`
export default function TransactionPopup({ hash }: { hash: string }) {
const { chainId } = useWeb3React()
const tx = useTransaction(hash)
const theme = useTheme()
if (!tx) return null
const success = Boolean(tx.receipt && tx.receipt.status === 1)
return (
<RowNoFlex>
<div style={{ paddingRight: 16 }}>
{success ? (
<CheckCircle color={theme.deprecated_green1} size={24} />
) : (
<AlertCircle color={theme.deprecated_red1} size={24} />
)}
</div>
<AutoColumn gap="8px">
<ThemedText.DeprecatedBody fontWeight={500}>
<TransactionSummary info={tx.info} />
</ThemedText.DeprecatedBody>
{chainId && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
View on Explorer
</ExternalLink>
)}
</AutoColumn>
</RowNoFlex>
)
}
...@@ -4,7 +4,7 @@ import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analyti ...@@ -4,7 +4,7 @@ import { BrowserEvent, ElementName, EventName, PageName } from '@uniswap/analyti
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { ButtonGray, ButtonPrimary, ButtonText } from 'components/Button' import { ButtonGray, ButtonPrimary, ButtonText } from 'components/Button'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import { FlyoutAlignment, NewMenu } from 'components/Menu' import { FlyoutAlignment, Menu } from 'components/Menu'
import PositionList from 'components/PositionList' import PositionList from 'components/PositionList'
import { RowBetween, RowFixed } from 'components/Row' import { RowBetween, RowFixed } from 'components/Row'
import { SwitchLocaleLink } from 'components/SwitchLocaleLink' import { SwitchLocaleLink } from 'components/SwitchLocaleLink'
...@@ -63,7 +63,7 @@ const ButtonRow = styled(RowFixed)` ...@@ -63,7 +63,7 @@ const ButtonRow = styled(RowFixed)`
flex-direction: row-reverse; flex-direction: row-reverse;
`}; `};
` `
const Menu = styled(NewMenu)` const PoolMenu = styled(Menu)`
margin-left: 0; margin-left: 0;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
flex: 1 1 auto; flex: 1 1 auto;
...@@ -75,7 +75,7 @@ const Menu = styled(NewMenu)` ...@@ -75,7 +75,7 @@ const Menu = styled(NewMenu)`
width: 100%; width: 100%;
} }
` `
const MenuItem = styled.div` const PoolMenuItem = styled.div`
align-items: center; align-items: center;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -221,40 +221,40 @@ export default function Pool() { ...@@ -221,40 +221,40 @@ export default function Pool() {
const menuItems = [ const menuItems = [
{ {
content: ( content: (
<MenuItem> <PoolMenuItem>
<Trans>Create a pool</Trans> <Trans>Create a pool</Trans>
<PlusCircle size={16} /> <PlusCircle size={16} />
</MenuItem> </PoolMenuItem>
), ),
link: '/add/ETH', link: '/add/ETH',
external: false, external: false,
}, },
{ {
content: ( content: (
<MenuItem> <PoolMenuItem>
<Trans>Migrate</Trans> <Trans>Migrate</Trans>
<ChevronsRight size={16} /> <ChevronsRight size={16} />
</MenuItem> </PoolMenuItem>
), ),
link: '/migrate/v2', link: '/migrate/v2',
external: false, external: false,
}, },
{ {
content: ( content: (
<MenuItem> <PoolMenuItem>
<Trans>V2 liquidity</Trans> <Trans>V2 liquidity</Trans>
<Layers size={16} /> <Layers size={16} />
</MenuItem> </PoolMenuItem>
), ),
link: '/pool/v2', link: '/pool/v2',
external: false, external: false,
}, },
{ {
content: ( content: (
<MenuItem> <PoolMenuItem>
<Trans>Learn</Trans> <Trans>Learn</Trans>
<BookOpen size={16} /> <BookOpen size={16} />
</MenuItem> </PoolMenuItem>
), ),
link: 'https://docs.uniswap.org/', link: 'https://docs.uniswap.org/',
external: true, external: true,
...@@ -273,7 +273,7 @@ export default function Pool() { ...@@ -273,7 +273,7 @@ export default function Pool() {
</ThemedText.LargeHeader> </ThemedText.LargeHeader>
<ButtonRow> <ButtonRow>
{showV2Features && ( {showV2Features && (
<Menu <PoolMenu
menuItems={menuItems} menuItems={menuItems}
flyoutAlignment={FlyoutAlignment.LEFT} flyoutAlignment={FlyoutAlignment.LEFT}
ToggleUI={(props: any) => ( ToggleUI={(props: any) => (
......
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