diff --git a/src/abis/unisocks.json b/src/abis/unisocks.json deleted file mode 100644 index 661ece2de..000000000 --- a/src/abis/unisocks.json +++ /dev/null @@ -1,471 +0,0 @@ -[ - { - "name": "Transfer", - "inputs": [ - { - "type": "address", - "name": "_from", - "indexed": true - }, - { - "type": "address", - "name": "_to", - "indexed": true - }, - { - "type": "uint256", - "name": "_tokenId", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "Approval", - "inputs": [ - { - "type": "address", - "name": "_owner", - "indexed": true - }, - { - "type": "address", - "name": "_approved", - "indexed": true - }, - { - "type": "uint256", - "name": "_tokenId", - "indexed": true - } - ], - "anonymous": false, - "type": "event" - }, - { - "name": "ApprovalForAll", - "inputs": [ - { - "type": "address", - "name": "_owner", - "indexed": true - }, - { - "type": "address", - "name": "_operator", - "indexed": true - }, - { - "type": "bool", - "name": "_approved", - "indexed": false - } - ], - "anonymous": false, - "type": "event" - }, - { - "outputs": [], - "inputs": [], - "constant": false, - "payable": false, - "type": "constructor" - }, - { - "name": "tokenURI", - "outputs": [ - { - "type": "string", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "_tokenId" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "22405" - }, - { - "name": "tokenByIndex", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "_index" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "631" - }, - { - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_owner" - }, - { - "type": "uint256", - "name": "_index" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1248" - }, - { - "name": "transferFrom", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_from" - }, - { - "type": "address", - "name": "_to" - }, - { - "type": "uint256", - "name": "_tokenId" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "259486" - }, - { - "name": "safeTransferFrom", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_from" - }, - { - "type": "address", - "name": "_to" - }, - { - "type": "uint256", - "name": "_tokenId" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "safeTransferFrom", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_from" - }, - { - "type": "address", - "name": "_to" - }, - { - "type": "uint256", - "name": "_tokenId" - }, - { - "type": "bytes", - "name": "_data" - } - ], - "constant": false, - "payable": false, - "type": "function" - }, - { - "name": "approve", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_approved" - }, - { - "type": "uint256", - "name": "_tokenId" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "38422" - }, - { - "name": "setApprovalForAll", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_operator" - }, - { - "type": "bool", - "name": "_approved" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "38016" - }, - { - "name": "mint", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "_to" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "182636" - }, - { - "name": "changeMinter", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_minter" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "35897" - }, - { - "name": "changeURI", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_newURI" - } - ], - "constant": false, - "payable": false, - "type": "function", - "gas": "35927" - }, - { - "name": "name", - "outputs": [ - { - "type": "string", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "6612" - }, - { - "name": "symbol", - "outputs": [ - { - "type": "string", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "6642" - }, - { - "name": "totalSupply", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "873" - }, - { - "name": "minter", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "903" - }, - { - "name": "socks", - "outputs": [ - { - "type": "address", - "name": "out", - "unit": "Socks" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "933" - }, - { - "name": "newURI", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [], - "constant": true, - "payable": false, - "type": "function", - "gas": "963" - }, - { - "name": "ownerOf", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "arg0" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1126" - }, - { - "name": "balanceOf", - "outputs": [ - { - "type": "uint256", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "arg0" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1195" - }, - { - "name": "getApproved", - "outputs": [ - { - "type": "address", - "name": "out" - } - ], - "inputs": [ - { - "type": "uint256", - "name": "arg0" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1186" - }, - { - "name": "isApprovedForAll", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "address", - "name": "arg0" - }, - { - "type": "address", - "name": "arg1" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1415" - }, - { - "name": "supportsInterface", - "outputs": [ - { - "type": "bool", - "name": "out" - } - ], - "inputs": [ - { - "type": "bytes32", - "name": "arg0" - } - ], - "constant": true, - "payable": false, - "type": "function", - "gas": "1246" - } -] diff --git a/src/components/Badge/RangeBadge.tsx b/src/components/Badge/RangeBadge.tsx index e76a5a8fe..319ad2b17 100644 --- a/src/components/Badge/RangeBadge.tsx +++ b/src/components/Badge/RangeBadge.tsx @@ -24,13 +24,6 @@ const ActiveDot = styled.span` margin-right: 4px; ` -export const DarkBadge = styled.div` - width: fit-content; - border-radius: 8px; - background-color: ${({ theme }) => theme.bg0}; - padding: 4px 6px; -` - export default function RangeBadge({ removed, inRange, diff --git a/src/components/Badge/index.tsx b/src/components/Badge/index.tsx index a2ad343d7..58c53f069 100644 --- a/src/components/Badge/index.tsx +++ b/src/components/Badge/index.tsx @@ -13,7 +13,7 @@ export enum BadgeVariant { WARNING_OUTLINE = 'WARNING_OUTLINE', } -export interface BadgeProps { +interface BadgeProps { variant?: BadgeVariant } diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 00eb452f2..6dbd13b1e 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -149,48 +149,6 @@ export const ButtonSecondary = styled(Base)` } ` -export const ButtonPink = styled(Base)` - background-color: ${({ theme }) => theme.primary1}; - color: white; - - &:focus { - box-shadow: 0 0 0 1pt ${({ theme }) => darken(0.05, theme.primary1)}; - background-color: ${({ theme }) => darken(0.05, theme.primary1)}; - } - &:hover { - background-color: ${({ theme }) => darken(0.05, theme.primary1)}; - } - &:active { - box-shadow: 0 0 0 1pt ${({ theme }) => darken(0.1, theme.primary1)}; - background-color: ${({ theme }) => darken(0.1, theme.primary1)}; - } - &:disabled { - background-color: ${({ theme }) => theme.primary1}; - opacity: 50%; - cursor: auto; - } -` - -export const ButtonUNIGradient = styled(ButtonPrimary)` - color: white; - padding: 4px 8px; - height: 36px; - font-weight: 500; - background-color: ${({ theme }) => theme.bg3}; - background: radial-gradient(174.47% 188.91% at 1.84% 0%, #ff007a 0%, #2172e5 100%), #edeef2; - width: fit-content; - position: relative; - cursor: pointer; - border: none; - white-space: no-wrap; - :hover { - opacity: 0.8; - } - :active { - opacity: 0.9; - } -` - export const ButtonOutlined = styled(Base)` border: 1px solid ${({ theme }) => theme.bg2}; background-color: transparent; @@ -255,27 +213,6 @@ export const ButtonText = styled(Base)` } ` -export const ButtonWhite = styled(Base)` - border: 1px solid #edeef2; - background-color: ${({ theme }) => theme.bg1}; - color: black; - - &:focus { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - box-shadow: 0 0 0 1pt ${darken(0.05, '#edeef2')}; - } - &:hover { - box-shadow: 0 0 0 1pt ${darken(0.1, '#edeef2')}; - } - &:active { - box-shadow: 0 0 0 1pt ${darken(0.1, '#edeef2')}; - } - &:disabled { - opacity: 50%; - cursor: auto; - } -` - const ButtonConfirmedStyle = styled(Base)` background-color: ${({ theme }) => theme.bg3}; color: ${({ theme }) => theme.text1}; diff --git a/src/components/Card/index.tsx b/src/components/Card/index.tsx index a53d5abc2..b1c9d3ebf 100644 --- a/src/components/Card/index.tsx +++ b/src/components/Card/index.tsx @@ -40,12 +40,6 @@ export const YellowCard = styled(Card)` font-weight: 500; ` -export const PinkCard = styled(Card)` - background-color: rgba(255, 0, 122, 0.03); - color: ${({ theme }) => theme.primary1}; - font-weight: 500; -` - export const BlueCard = styled(Card)` background-color: ${({ theme }) => theme.primary5}; color: ${({ theme }) => theme.blue2}; diff --git a/src/components/DoubleLogo/index.tsx b/src/components/DoubleLogo/index.tsx index 99ed48f0b..c13c09250 100644 --- a/src/components/DoubleLogo/index.tsx +++ b/src/components/DoubleLogo/index.tsx @@ -9,7 +9,7 @@ const Wrapper = styled.div<{ margin: boolean; sizeraw: number }>` margin-left: ${({ sizeraw, margin }) => margin && (sizeraw / 3 + 8).toString() + 'px'}; ` -export interface DoubleCurrencyLogoProps { +interface DoubleCurrencyLogoProps { margin?: boolean size?: number currency0?: Currency diff --git a/src/components/Header/URLWarning.tsx b/src/components/Header/URLWarning.tsx deleted file mode 100644 index 3ea635ca2..000000000 --- a/src/components/Header/URLWarning.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import styled from 'styled-components/macro' - -import { AlertTriangle, X } from 'react-feather' -import { useURLWarningToggle, useURLWarningVisible } from '../../state/user/hooks' -import { isMobile } from 'react-device-detect' -import { Trans } from '@lingui/macro' - -const PhishAlert = styled.div<{ isActive: any }>` - width: 100%; - padding: 6px 6px; - background-color: ${({ theme }) => theme.blue1}; - color: white; - font-size: 11px; - justify-content: space-between; - align-items: center; - display: ${({ isActive }) => (isActive ? 'flex' : 'none')}; -` - -export const StyledClose = styled(X)` - :hover { - cursor: pointer; - } -` - -export default function URLWarning() { - const toggleURLWarning = useURLWarningToggle() - const showURLWarning = useURLWarningVisible() - - return isMobile ? ( - -
- - - Make sure the URL is - app.uniswap.org - -
- -
- ) : window.location.hostname === 'app.uniswap.org' ? ( - -
- - - Always make sure the URL is - app.uniswap.org - bookmark it - to be safe. - -
- -
- ) : null -} diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index bcf1e04c6..4307a89ff 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -255,7 +255,7 @@ const StyledExternalLink = styled(ExternalLink).attrs({ `} ` -export const StyledMenuButton = styled.button` +const StyledMenuButton = styled.button` position: relative; width: 100%; height: 100%; diff --git a/src/components/LineChart/data.ts b/src/components/LineChart/data.ts deleted file mode 100644 index da2c7d720..000000000 --- a/src/components/LineChart/data.ts +++ /dev/null @@ -1,152 +0,0 @@ -export const dummyData = [ - { time: '2018-10-19', value: 35.98 }, - { time: '2018-10-22', value: 35.75 }, - { time: '2018-10-23', value: 35.65 }, - { time: '2018-10-24', value: 34.12 }, - { time: '2018-10-25', value: 35.84 }, - { time: '2018-10-26', value: 35.24 }, - { time: '2018-10-29', value: 35.99 }, - { time: '2018-10-30', value: 37.71 }, - { time: '2018-10-31', value: 38.14 }, - { time: '2018-11-01', value: 37.95 }, - { time: '2018-11-02', value: 37.66 }, - { time: '2018-11-05', value: 38.02 }, - { time: '2018-11-06', value: 37.73 }, - { time: '2018-11-07', value: 38.3 }, - { time: '2018-11-08', value: 38.3 }, - { time: '2018-11-09', value: 38.34 }, - { time: '2018-11-12', value: 38.0 }, - { time: '2018-11-13', value: 37.72 }, - { time: '2018-11-14', value: 38.29 }, - { time: '2018-11-15', value: 38.49 }, - { time: '2018-11-16', value: 38.59 }, - { time: '2018-11-19', value: 38.18 }, - { time: '2018-11-20', value: 36.76 }, - { time: '2018-11-21', value: 37.51 }, - { time: '2018-11-23', value: 37.39 }, - { time: '2018-11-26', value: 37.77 }, - { time: '2018-11-27', value: 38.36 }, - { time: '2018-11-28', value: 39.06 }, - { time: '2018-11-29', value: 39.42 }, - { time: '2018-11-30', value: 39.01 }, - { time: '2018-12-03', value: 39.15 }, - { time: '2018-12-04', value: 37.69 }, - { time: '2018-12-06', value: 37.88 }, - { time: '2018-12-07', value: 37.41 }, - { time: '2018-12-10', value: 37.35 }, - { time: '2018-12-11', value: 36.84 }, - { time: '2018-12-12', value: 36.98 }, - { time: '2018-12-13', value: 36.76 }, - { time: '2018-12-14', value: 36.34 }, - { time: '2018-12-17', value: 36.21 }, - { time: '2018-12-18', value: 35.65 }, - { time: '2018-12-19', value: 35.19 }, - { time: '2018-12-20', value: 34.62 }, - { time: '2018-12-21', value: 33.75 }, - { time: '2018-12-24', value: 33.07 }, - { time: '2018-12-26', value: 34.14 }, - { time: '2018-12-27', value: 34.47 }, - { time: '2018-12-28', value: 34.35 }, - { time: '2018-12-31', value: 34.05 }, - { time: '2019-01-02', value: 34.37 }, - { time: '2019-01-03', value: 34.64 }, - { time: '2019-01-04', value: 35.81 }, - { time: '2019-01-07', value: 35.43 }, - { time: '2019-01-08', value: 35.72 }, - { time: '2019-01-09', value: 36.06 }, - { time: '2019-01-10', value: 35.82 }, - { time: '2019-01-11', value: 35.63 }, - { time: '2019-01-14', value: 35.77 }, - { time: '2019-01-15', value: 35.83 }, - { time: '2019-01-16', value: 35.9 }, - { time: '2019-01-17', value: 35.91 }, - { time: '2019-01-18', value: 36.21 }, - { time: '2019-01-22', value: 34.97 }, - { time: '2019-01-23', value: 36.89 }, - { time: '2019-01-24', value: 36.24 }, - { time: '2019-01-25', value: 35.78 }, - { time: '2019-01-28', value: 35.37 }, - { time: '2019-01-29', value: 36.08 }, - { time: '2019-01-30', value: 35.43 }, - { time: '2019-01-31', value: 36.57 }, - { time: '2019-02-01', value: 36.79 }, - { time: '2019-02-04', value: 36.77 }, - { time: '2019-02-05', value: 37.15 }, - { time: '2019-02-06', value: 37.17 }, - { time: '2019-02-07', value: 37.68 }, - { time: '2019-02-08', value: 37.6 }, - { time: '2019-02-11', value: 37.0 }, - { time: '2019-02-12', value: 37.24 }, - { time: '2019-02-13', value: 37.03 }, - { time: '2019-02-14', value: 37.26 }, - { time: '2019-02-15', value: 37.77 }, - { time: '2019-02-19', value: 37.55 }, - { time: '2019-02-20', value: 37.79 }, - { time: '2019-02-21', value: 38.47 }, - { time: '2019-02-22', value: 38.61 }, - { time: '2019-02-25', value: 38.57 }, - { time: '2019-02-26', value: 38.8 }, - { time: '2019-02-27', value: 38.53 }, - { time: '2019-02-28', value: 38.67 }, - { time: '2019-03-01', value: 39.1 }, - { time: '2019-03-04', value: 38.73 }, - { time: '2019-03-05', value: 38.72 }, - { time: '2019-03-06', value: 38.61 }, - { time: '2019-03-07', value: 38.38 }, - { time: '2019-03-08', value: 38.19 }, - { time: '2019-03-11', value: 39.17 }, - { time: '2019-03-12', value: 39.49 }, - { time: '2019-03-13', value: 39.56 }, - { time: '2019-03-14', value: 39.87 }, - { time: '2019-03-15', value: 40.47 }, - { time: '2019-03-18', value: 39.92 }, - { time: '2019-03-19', value: 39.78 }, - { time: '2019-03-20', value: 39.47 }, - { time: '2019-03-21', value: 40.05 }, - { time: '2019-03-22', value: 39.46 }, - { time: '2019-03-25', value: 39.18 }, - { time: '2019-03-26', value: 39.63 }, - { time: '2019-03-27', value: 40.21 }, - { time: '2019-03-28', value: 40.42 }, - { time: '2019-03-29', value: 39.98 }, - { time: '2019-04-01', value: 40.31 }, - { time: '2019-04-02', value: 40.02 }, - { time: '2019-04-03', value: 40.27 }, - { time: '2019-04-04', value: 40.41 }, - { time: '2019-04-05', value: 40.42 }, - { time: '2019-04-08', value: 40.71 }, - { time: '2019-04-09', value: 41.04 }, - { time: '2019-04-10', value: 41.08 }, - { time: '2019-04-11', value: 41.04 }, - { time: '2019-04-12', value: 41.3 }, - { time: '2019-04-15', value: 41.78 }, - { time: '2019-04-16', value: 41.97 }, - { time: '2019-04-17', value: 42.57 }, - { time: '2019-04-18', value: 42.43 }, - { time: '2019-04-22', value: 42.0 }, - { time: '2019-04-23', value: 41.99 }, - { time: '2019-04-24', value: 41.85 }, - { time: '2019-04-25', value: 42.93 }, - { time: '2019-04-26', value: 43.08 }, - { time: '2019-04-29', value: 43.45 }, - { time: '2019-04-30', value: 43.53 }, - { time: '2019-05-01', value: 43.42 }, - { time: '2019-05-02', value: 42.65 }, - { time: '2019-05-03', value: 43.29 }, - { time: '2019-05-06', value: 43.3 }, - { time: '2019-05-07', value: 42.76 }, - { time: '2019-05-08', value: 42.55 }, - { time: '2019-05-09', value: 42.92 }, - { time: '2019-05-10', value: 43.15 }, - { time: '2019-05-13', value: 42.28 }, - { time: '2019-05-14', value: 42.91 }, - { time: '2019-05-15', value: 42.49 }, - { time: '2019-05-16', value: 43.19 }, - { time: '2019-05-17', value: 43.54 }, - { time: '2019-05-20', value: 42.78 }, - { time: '2019-05-21', value: 43.29 }, - { time: '2019-05-22', value: 43.3 }, - { time: '2019-05-23', value: 42.73 }, - { time: '2019-05-24', value: 42.67 }, - { time: '2019-05-28', value: 42.75 }, -] diff --git a/src/components/LineChart/index.tsx b/src/components/LineChart/index.tsx index b32c0971c..e4a22c930 100644 --- a/src/components/LineChart/index.tsx +++ b/src/components/LineChart/index.tsx @@ -10,7 +10,7 @@ const Wrapper = styled(Card)` width: 100%; padding: 1rem; display: flex; - background-color: ${({ theme }) => theme.bg0} + background-color: ${({ theme }) => theme.bg0}; flex-direction: column; > * { font-size: 1rem; @@ -19,7 +19,7 @@ const Wrapper = styled(Card)` const DEFAULT_HEIGHT = 300 -export type LineChartProps = { +type LineChartProps = { data: any[] color?: string | undefined height?: number | undefined diff --git a/src/components/Logo/index.tsx b/src/components/Logo/index.tsx index bfb7fc3c9..6ce81e88f 100644 --- a/src/components/Logo/index.tsx +++ b/src/components/Logo/index.tsx @@ -5,7 +5,7 @@ import useTheme from '../../hooks/useTheme' const BAD_SRCS: { [tokenAddress: string]: true } = {} -export interface LogoProps extends Pick { +interface LogoProps extends Pick { srcs: string[] } diff --git a/src/components/Popups/PopupItem.tsx b/src/components/Popups/PopupItem.tsx index 0a811d040..522c307e9 100644 --- a/src/components/Popups/PopupItem.tsx +++ b/src/components/Popups/PopupItem.tsx @@ -7,7 +7,7 @@ import { PopupContent } from '../../state/application/actions' import { useRemovePopup } from '../../state/application/hooks' import TransactionPopup from './TransactionPopup' -export const StyledClose = styled(X)` +const StyledClose = styled(X)` position: absolute; right: 10px; top: 10px; @@ -16,7 +16,7 @@ export const StyledClose = styled(X)` cursor: pointer; } ` -export const Popup = styled.div` +const Popup = styled.div` display: inline-block; width: 100%; padding: 1em; diff --git a/src/components/PositionCard/index.tsx b/src/components/PositionCard/index.tsx index c429f04b8..0fa9c7761 100644 --- a/src/components/PositionCard/index.tsx +++ b/src/components/PositionCard/index.tsx @@ -1,7 +1,6 @@ import JSBI from 'jsbi' import { Percent, CurrencyAmount, Token } from '@uniswap/sdk-core' import { Pair } from '@uniswap/v2-sdk' -import { darken } from 'polished' import { useState } from 'react' import { ChevronDown, ChevronUp } from 'react-feather' import { Link } from 'react-router-dom' @@ -21,7 +20,7 @@ import { CardNoise } from '../earn/styled' import { useColor } from '../../hooks/useColor' -import Card, { GreyCard, LightCard } from '../Card' +import { GreyCard, LightCard } from '../Card' import { AutoColumn } from '../Column' import CurrencyLogo from '../CurrencyLogo' import DoubleCurrencyLogo from '../DoubleLogo' @@ -33,12 +32,6 @@ export const FixedHeightRow = styled(RowBetween)` height: 24px; ` -export const HoverCard = styled(Card)` - border: 1px solid transparent; - :hover { - border: 1px solid ${({ theme }) => darken(0.06, theme.bg2)}; - } -` const StyledPositionCard = styled(LightCard)<{ bgColor: any }>` border: none; background: ${({ theme, bgColor }) => diff --git a/src/components/PositionList/index.tsx b/src/components/PositionList/index.tsx index a62a3fac3..9108f136f 100644 --- a/src/components/PositionList/index.tsx +++ b/src/components/PositionList/index.tsx @@ -34,7 +34,7 @@ const MobileHeader = styled.div` } ` -export type PositionListProps = React.PropsWithChildren<{ +type PositionListProps = React.PropsWithChildren<{ positions: PositionDetails[] }> diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index f4c032663..370acd35b 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -117,7 +117,7 @@ const DataText = styled.div` `}; ` -export interface PositionListItemProps { +interface PositionListItemProps { positionDetails: PositionDetails } diff --git a/src/components/SearchModal/SortButton.tsx b/src/components/SearchModal/SortButton.tsx deleted file mode 100644 index 4a669bd7c..000000000 --- a/src/components/SearchModal/SortButton.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Text } from 'rebass' -import styled from 'styled-components/macro' -import { RowFixed } from '../Row' - -export const FilterWrapper = styled(RowFixed)` - padding: 8px; - background-color: ${({ theme }) => theme.bg2}; - color: ${({ theme }) => theme.text1}; - border-radius: 8px; - user-select: none; - & > * { - user-select: none; - } - :hover { - cursor: pointer; - } -` - -export default function SortButton({ - toggleSortOrder, - ascending, -}: { - toggleSortOrder: () => void - ascending: boolean -}) { - return ( - - - {ascending ? '↑' : '↓'} - - - ) -} diff --git a/src/components/SearchModal/styleds.tsx b/src/components/SearchModal/styleds.tsx index 539fc6b99..ddb500abf 100644 --- a/src/components/SearchModal/styleds.tsx +++ b/src/components/SearchModal/styleds.tsx @@ -1,43 +1,6 @@ import styled from 'styled-components/macro' import { AutoColumn } from '../Column' -import { RowBetween, RowFixed } from '../Row' - -export const ModalInfo = styled.div` - ${({ theme }) => theme.flexRowNoWrap} - align-items: center; - padding: 1rem 1rem; - margin: 0.25rem 0.5rem; - justify-content: center; - flex: 1; - user-select: none; -` -export const StyledMenu = styled.div` - display: flex; - justify-content: center; - align-items: center; - position: relative; - border: none; -` - -export const PopoverContainer = styled.div<{ show: boolean }>` - z-index: 100; - visibility: ${(props) => (props.show ? 'visible' : 'hidden')}; - opacity: ${(props) => (props.show ? 1 : 0)}; - transition: visibility 150ms linear, opacity 150ms linear; - background: ${({ theme }) => theme.bg2}; - border: 1px solid ${({ theme }) => theme.bg3}; - box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), - 0px 24px 32px rgba(0, 0, 0, 0.01); - color: ${({ theme }) => theme.text2}; - border-radius: 0.5rem; - padding: 1rem; - display: grid; - grid-template-rows: 1fr; - grid-gap: 8px; - font-size: 1rem; - text-align: left; - top: 80px; -` +import { RowBetween } from '../Row' export const TextDot = styled.div` height: 3px; @@ -46,10 +9,6 @@ export const TextDot = styled.div` border-radius: 50%; ` -export const FadedSpan = styled(RowFixed)` - color: ${({ theme }) => theme.primary1}; - font-size: 14px; -` export const Checkbox = styled.input` border: 1px solid ${({ theme }) => theme.red3}; height: 20px; diff --git a/src/components/ThemeColorPalette/index.tsx b/src/components/ThemeColorPalette/index.tsx deleted file mode 100644 index 25aece76a..000000000 --- a/src/components/ThemeColorPalette/index.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { readableColor } from 'polished' -import styled from 'styled-components/macro' -import { colors } from 'theme' - -const Swatch = styled.div` - align-items: center; - display: flex; - flex-direction: column; - height: 100px; - justify-content: center; - min-width: 200px; -` - -const Wrapper = styled.div` - display: flex; - flex-wrap: wrap; - flex-direction: row; -` - -interface ThemePaletteProps { - isDarkMode: boolean -} - -export default function ThemePalette({ isDarkMode }: ThemePaletteProps) { - const data = colors(isDarkMode) - return ( - - {Object.entries(data).map(([key, value]) => ( - -
{key}
-
{value}
-
- ))} -
- ) -} diff --git a/src/components/Toggle/ListToggle.tsx b/src/components/Toggle/ListToggle.tsx index 01208d929..c373d2cd6 100644 --- a/src/components/Toggle/ListToggle.tsx +++ b/src/components/Toggle/ListToggle.tsx @@ -30,7 +30,7 @@ const StatusText = styled(TYPE.main)<{ isActive?: boolean }>` color: ${({ theme, isActive }) => (isActive ? theme.text1 : theme.text3)}; ` -export interface ToggleProps { +interface ToggleProps { id?: string isActive: boolean bgColor: string diff --git a/src/components/Toggle/index.tsx b/src/components/Toggle/index.tsx index 276e28216..61557586c 100644 --- a/src/components/Toggle/index.tsx +++ b/src/components/Toggle/index.tsx @@ -30,7 +30,7 @@ const StyledToggle = styled.button<{ isActive?: boolean; activeElement?: boolean padding: 2px; ` -export interface ToggleProps { +interface ToggleProps { id?: string isActive: boolean toggle: () => void diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx index 9fbf16b46..9ebe9414b 100644 --- a/src/components/Tooltip/index.tsx +++ b/src/components/Tooltip/index.tsx @@ -21,7 +21,7 @@ export default function Tooltip({ text, ...rest }: TooltipProps) { return {text}} {...rest} /> } -export function TooltipContent({ content, ...rest }: TooltipContentProps) { +function TooltipContent({ content, ...rest }: TooltipContentProps) { return {content}} {...rest} /> } diff --git a/src/components/TransactionConfirmationModal/index.tsx b/src/components/TransactionConfirmationModal/index.tsx index 2c9ca73f2..9f518e253 100644 --- a/src/components/TransactionConfirmationModal/index.tsx +++ b/src/components/TransactionConfirmationModal/index.tsx @@ -39,7 +39,7 @@ const StyledLogo = styled.img` margin-left: 6px; ` -export function ConfirmationPendingContent({ +function ConfirmationPendingContent({ onDismiss, pendingText, inline, @@ -78,7 +78,7 @@ export function ConfirmationPendingContent({ ) } -export function TransactionSubmittedContent({ +function TransactionSubmittedContent({ onDismiss, chainId, hash, diff --git a/src/components/TransactionSettings/index.tsx b/src/components/TransactionSettings/index.tsx index df28fcaf6..d93ff24be 100644 --- a/src/components/TransactionSettings/index.tsx +++ b/src/components/TransactionSettings/index.tsx @@ -87,7 +87,7 @@ const SlippageEmojiContainer = styled.span` `} ` -export interface TransactionSettingsProps { +interface TransactionSettingsProps { placeholderSlippage: Percent // varies according to the context in which the settings dialog is placed } diff --git a/src/components/earn/styled.ts b/src/components/earn/styled.ts index 9f558394e..948e7817e 100644 --- a/src/components/earn/styled.ts +++ b/src/components/earn/styled.ts @@ -5,17 +5,6 @@ import uImage from '../../assets/images/big_unicorn.png' import xlUnicorn from '../../assets/images/xl_uni.png' import noise from '../../assets/images/noise.png' -export const TextBox = styled.div` - display: flex; - align-items: center; - justify-content: center; - padding: 4px 12px; - border: 1px solid rgba(255, 255, 255, 0.4); - border-radius: 20px; - width: fit-content; - justify-self: flex-end; -` - export const DataCard = styled(AutoColumn)<{ disabled?: boolean }>` background: radial-gradient(76.02% 75.41% at 1.84% 0%, #ff007a 0%, #2172e5 100%); border-radius: 12px; diff --git a/src/components/swap/AdvancedSwapDetails.tsx b/src/components/swap/AdvancedSwapDetails.tsx index 1b24e2296..4d2815309 100644 --- a/src/components/swap/AdvancedSwapDetails.tsx +++ b/src/components/swap/AdvancedSwapDetails.tsx @@ -11,7 +11,7 @@ import { RowBetween, RowFixed } from '../Row' import FormattedPriceImpact from './FormattedPriceImpact' import SwapRoute from './SwapRoute' -export interface AdvancedSwapDetailsProps { +interface AdvancedSwapDetailsProps { trade?: V2Trade | V3Trade allowedSlippage: Percent } diff --git a/src/components/swap/AdvancedSwapDetailsDropdown.tsx b/src/components/swap/AdvancedSwapDetailsDropdown.tsx deleted file mode 100644 index ed0af8e1f..000000000 --- a/src/components/swap/AdvancedSwapDetailsDropdown.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import styled from 'styled-components/macro' -import { useLastTruthy } from '../../hooks/useLast' -import { AdvancedSwapDetails, AdvancedSwapDetailsProps } from './AdvancedSwapDetails' - -const AdvancedDetailsFooter = styled.div<{ show: boolean }>` - width: 100%; - border-bottom-left-radius: 20px; - border-bottom-right-radius: 20px; - color: ${({ theme }) => theme.text2}; -` - -export default function AdvancedSwapDetailsDropdown({ trade, ...rest }: AdvancedSwapDetailsProps) { - const lastTrade = useLastTruthy(trade) - - return ( - - - - ) -} diff --git a/src/components/swap/FormattedPriceImpact.tsx b/src/components/swap/FormattedPriceImpact.tsx index 45d67c674..56896e4ae 100644 --- a/src/components/swap/FormattedPriceImpact.tsx +++ b/src/components/swap/FormattedPriceImpact.tsx @@ -1,6 +1,6 @@ import { Percent } from '@uniswap/sdk-core' import { warningSeverity } from '../../utils/prices' -import { ErrorText, ErrorPill } from './styleds' +import { ErrorText } from './styleds' /** * Formatted version of price impact text with warning colors @@ -12,11 +12,3 @@ export default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Pe ) } - -export function SmallFormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) { - return ( - - {priceImpact ? `(${priceImpact.multiply(-1).toFixed(2)}%)` : '-'} - - ) -} diff --git a/src/components/swap/SwapModalHeader.tsx b/src/components/swap/SwapModalHeader.tsx index 2101f89e7..08eca2867 100644 --- a/src/components/swap/SwapModalHeader.tsx +++ b/src/components/swap/SwapModalHeader.tsx @@ -22,7 +22,7 @@ import { LightCard } from '../Card' import TradePrice from '../swap/TradePrice' -export const ArrowWrapper = styled.div` +const ArrowWrapper = styled.div` padding: 4px; border-radius: 12px; height: 32px; diff --git a/src/components/swap/styleds.tsx b/src/components/swap/styleds.tsx index 768211fb3..0a593a8b5 100644 --- a/src/components/swap/styleds.tsx +++ b/src/components/swap/styleds.tsx @@ -1,6 +1,5 @@ import { transparentize } from 'polished' import { ReactNode } from 'react' -import { Link } from 'react-router-dom' import { AlertTriangle } from 'react-feather' import styled, { css } from 'styled-components' @@ -42,11 +41,6 @@ export const SectionBreak = styled.div` background-color: ${({ theme }) => theme.bg3}; ` -export const BottomGrouping = styled.div` - margin-top: ; - /* background-color: ${({ theme }) => theme.bg1}; */ -` - export const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>` color: ${({ theme, severity }) => severity === 3 || severity === 4 @@ -58,55 +52,6 @@ export const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>` : theme.text2}; ` -export const ErrorPill = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>` - border-radius: 8px; - - color: ${({ theme, severity }) => - severity === 3 || severity === 4 - ? theme.red1 - : severity === 2 - ? theme.yellow2 - : severity === 1 - ? theme.text1 - : theme.text3}; - - /* background-color: ${({ theme, severity }) => - severity === 3 || severity === 4 - ? transparentize(0.9, theme.red1) - : severity === 2 - ? transparentize(0.9, theme.yellow2) - : severity === 1 - ? transparentize(0.9, theme.text1) - : transparentize(0.9, theme.green1)}; */ -` - -export const StyledBalanceMaxMini = styled.button` - /* height: 22px; */ - width: fit-content; - background-color: ${({ theme }) => theme.bg1}; - border: none; - border-radius: 8px; - padding: 0; - font-size: 0.875rem; - font-weight: 400; - opacity: 0.6; - margin-right: 0.5rem; - cursor: pointer; - color: ${({ theme }) => theme.text1}; - display: flex; - justify-content: center; - align-items: center; - float: right; - - :hover { - background-color: ${({ theme }) => theme.bg2}; - } - :focus { - background-color: ${({ theme }) => theme.bg2}; - outline: none; - } -` - export const TruncatedText = styled(Text)` text-overflow: ellipsis; max-width: 220px; @@ -183,19 +128,3 @@ export const SwapShowAcceptChanges = styled(AutoColumn)` border-radius: 12px; margin-top: 8px; ` -export const Separator = styled.div` - width: 100%; - height: 1px; - background-color: ${({ theme }) => theme.bg2}; -` - -export const V2TradeAlertWrapper = styled(Link)` - background-color: ${({ theme }) => theme.bg2}; - display: flex; - align-items: center; - border-radius: 12px; - height: 22px; - margin-right: 0.5rem; - padding: 0 0.25rem 0 0.5rem; - text-decoration: none !important; -` diff --git a/src/connectors/NetworkConnector.ts b/src/connectors/NetworkConnector.ts index 16992ab54..24c001970 100644 --- a/src/connectors/NetworkConnector.ts +++ b/src/connectors/NetworkConnector.ts @@ -28,7 +28,7 @@ interface BatchItem { reject: (error: Error) => void } -export class MiniRpcProvider implements AsyncSendable { +class MiniRpcProvider implements AsyncSendable { public readonly isMetaMask: false = false public readonly chainId: number public readonly url: string diff --git a/src/constants/misc.ts b/src/constants/misc.ts index 28b45f5d9..f5936ab48 100644 --- a/src/constants/misc.ts +++ b/src/constants/misc.ts @@ -14,8 +14,9 @@ export const BIG_INT_SECONDS_IN_WEEK = JSBI.BigInt(60 * 60 * 24 * 7) export const BIG_INT_ZERO = JSBI.BigInt(0) // one basis JSBI.BigInt -export const ONE_BIPS = new Percent(JSBI.BigInt(1), JSBI.BigInt(10000)) -export const BIPS_BASE = JSBI.BigInt(10000) +const BIPS_BASE = JSBI.BigInt(10000) +export const ONE_BIPS = new Percent(JSBI.BigInt(1), BIPS_BASE) + // used for warning states export const ALLOWED_PRICE_IMPACT_LOW: Percent = new Percent(JSBI.BigInt(100), BIPS_BASE) // 1% export const ALLOWED_PRICE_IMPACT_MEDIUM: Percent = new Percent(JSBI.BigInt(300), BIPS_BASE) // 3% @@ -25,8 +26,7 @@ export const PRICE_IMPACT_WITHOUT_FEE_CONFIRM_MIN: Percent = new Percent(JSBI.Bi // for non expert mode disable swaps above this export const BLOCKED_PRICE_IMPACT_NON_EXPERT: Percent = new Percent(JSBI.BigInt(1500), BIPS_BASE) // 15% -// used to ensure the user doesn't send so much ETH so they end up with <.01 -export const BETTER_TRADE_LESS_HOPS_THRESHOLD = new Percent(JSBI.BigInt(50), JSBI.BigInt(10000)) +export const BETTER_TRADE_LESS_HOPS_THRESHOLD = new Percent(JSBI.BigInt(50), BIPS_BASE) export const ZERO_PERCENT = new Percent('0') export const ONE_HUNDRED_PERCENT = new Percent('1') diff --git a/src/constants/wallet.ts b/src/constants/wallet.ts index 4a5bdfc02..a6821bb14 100644 --- a/src/constants/wallet.ts +++ b/src/constants/wallet.ts @@ -7,7 +7,7 @@ import PORTIS_ICON_URL from '../assets/images/portisIcon.png' import WALLETCONNECT_ICON_URL from '../assets/images/walletConnectIcon.svg' import { fortmatic, injected, portis, walletconnect, walletlink } from '../connectors' -export interface WalletInfo { +interface WalletInfo { connector?: AbstractConnector name: string iconURL: string diff --git a/src/hooks/useContract.ts b/src/hooks/useContract.ts index dd0fb1aaf..ff7dd60e1 100644 --- a/src/hooks/useContract.ts +++ b/src/hooks/useContract.ts @@ -4,7 +4,6 @@ import { abi as UNI_ABI } from '@uniswap/governance/build/Uni.json' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' import { abi as MERKLE_DISTRIBUTOR_ABI } from '@uniswap/merkle-distributor/build/MerkleDistributor.json' import { abi as IUniswapV2PairABI } from '@uniswap/v2-core/build/IUniswapV2Pair.json' -import { abi as V3FactoryABI } from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json' import { abi as QuoterABI } from '@uniswap/v3-periphery/artifacts/contracts/lens/Quoter.sol/Quoter.json' import { abi as V2MigratorABI } from '@uniswap/v3-periphery/artifacts/contracts/V3Migrator.sol/V3Migrator.json' import { abi as IUniswapV2Router02ABI } from '@uniswap/v2-periphery/build/IUniswapV2Router02.json' @@ -15,28 +14,24 @@ import ENS_PUBLIC_RESOLVER_ABI from 'abis/ens-public-resolver.json' import ENS_ABI from 'abis/ens-registrar.json' import ERC20_ABI from 'abis/erc20.json' import ERC20_BYTES32_ABI from 'abis/erc20_bytes32.json' -import { Unisocks } from 'abis/types/Unisocks' -import UNISOCKS_ABI from 'abis/unisocks.json' import WETH_ABI from 'abis/weth.json' import EIP_2612 from 'abis/eip_2612.json' import { NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, QUOTER_ADDRESSES, - V3_CORE_FACTORY_ADDRESSES, V3_MIGRATOR_ADDRESSES, ARGENT_WALLET_DETECTOR_ADDRESS, MERKLE_DISTRIBUTOR_ADDRESS, MULTICALL_ADDRESS, V2_ROUTER_ADDRESS, ENS_REGISTRAR_ADDRESSES, - SOCKS_CONTROLLER_ADDRESSES, GOVERNANCE_ALPHA_V0_ADDRESSES, GOVERNANCE_ALPHA_V1_ADDRESSES, } from 'constants/addresses' import { abi as NFTPositionManagerABI } from '@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json' import { useMemo } from 'react' -import { Quoter, UniswapV3Factory, NonfungiblePositionManager, UniswapInterfaceMulticall } from 'types/v3' +import { Quoter, NonfungiblePositionManager, UniswapInterfaceMulticall } from 'types/v3' import { V3Migrator } from 'types/v3/V3Migrator' import { getContract } from 'utils' import { Erc20, ArgentWalletDetector, EnsPublicResolver, EnsRegistrar, Weth } from '../abis/types' @@ -134,10 +129,6 @@ export function useStakingContract(stakingAddress?: string, withSignerIfPossible return useContract(stakingAddress, STAKING_REWARDS_ABI, withSignerIfPossible) } -export function useSocksController(): Unisocks | null { - return useContract(SOCKS_CONTROLLER_ADDRESSES, UNISOCKS_ABI, false) -} - export function useV3NFTPositionManagerContract(withSignerIfPossible?: boolean): NonfungiblePositionManager | null { return useContract( NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, @@ -146,10 +137,6 @@ export function useV3NFTPositionManagerContract(withSignerIfPossible?: boolean): ) } -export function useV3Factory() { - return useContract(V3_CORE_FACTORY_ADDRESSES, V3FactoryABI) as UniswapV3Factory | null -} - export function useV3Quoter() { return useContract(QUOTER_ADDRESSES, QuoterABI) } diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index c0677ea2f..bccdf9b08 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -75,11 +75,11 @@ interface BaseSignatureData { permitType: PermitType } -export interface StandardSignatureData extends BaseSignatureData { +interface StandardSignatureData extends BaseSignatureData { amount: string } -export interface AllowedSignatureData extends BaseSignatureData { +interface AllowedSignatureData extends BaseSignatureData { allowed: true } @@ -114,7 +114,7 @@ const PERMIT_ALLOWED_TYPE = [ { name: 'allowed', type: 'bool' }, ] -export function useERC20Permit( +function useERC20Permit( currencyAmount: CurrencyAmount | null | undefined, spender: string | null | undefined, overridePermitInfo: PermitInfo | undefined | null diff --git a/src/hooks/useFeeTierDistribution.ts b/src/hooks/useFeeTierDistribution.ts index 24aec7c60..e324e5352 100644 --- a/src/hooks/useFeeTierDistribution.ts +++ b/src/hooks/useFeeTierDistribution.ts @@ -12,7 +12,7 @@ import ms from 'ms.macro' // maximum number of blocks past which we consider the data stale const MAX_DATA_BLOCK_AGE = 10 -export interface FeeTierDistribution { +interface FeeTierDistribution { isLoading: boolean isError: boolean largestUsageFeeTier?: FeeAmount | undefined diff --git a/src/hooks/useLast.ts b/src/hooks/useLast.ts index 6f8311621..33f169bd2 100644 --- a/src/hooks/useLast.ts +++ b/src/hooks/useLast.ts @@ -19,15 +19,3 @@ export default function useLast( }, [filterFn, value]) return last } - -function isDefined(x: T | null | undefined): x is T { - return x !== null && x !== undefined -} - -/** - * Returns the last truthy value of type T - * @param value changing value - */ -export function useLastTruthy(value: T | undefined | null): T | null | undefined { - return useLast(value, isDefined) -} diff --git a/src/hooks/useSocksBalance.ts b/src/hooks/useSocksBalance.ts index 48d03b4ad..ad8f39c93 100644 --- a/src/hooks/useSocksBalance.ts +++ b/src/hooks/useSocksBalance.ts @@ -1,20 +1,17 @@ -import JSBI from 'jsbi' import { useMemo } from 'react' -import { NEVER_RELOAD, useSingleCallResult } from '../state/multicall/hooks' import { useActiveWeb3React } from './web3' -import { useSocksController } from './useContract' +import { useTokenBalance } from 'state/wallet/hooks' +import { SOCKS_CONTROLLER_ADDRESSES } from 'constants/addresses' +import { Token } from '@uniswap/sdk-core' +import { SupportedChainId } from 'constants/chains' -export default function useSocksBalance(): JSBI | undefined { - const { account } = useActiveWeb3React() - const socksContract = useSocksController() - - const inputs = useMemo(() => [account ?? undefined], [account]) - const { result } = useSingleCallResult(socksContract, 'balanceOf', inputs, NEVER_RELOAD) - const data = result?.[0] - return data ? JSBI.BigInt(data.toString()) : undefined -} +// technically a 721, not an ERC20, but suffices for our purposes +const SOCKS = new Token(SupportedChainId.MAINNET, SOCKS_CONTROLLER_ADDRESSES[SupportedChainId.MAINNET], 0) export function useHasSocks(): boolean | undefined { - const balance = useSocksBalance() - return useMemo(() => balance && JSBI.greaterThan(balance, JSBI.BigInt(0)), [balance]) + const { account, chainId } = useActiveWeb3React() + + const balance = useTokenBalance(account ?? undefined, chainId === SupportedChainId.MAINNET ? SOCKS : undefined) + + return useMemo(() => Boolean(balance?.greaterThan(0)), [balance]) } diff --git a/src/hooks/useSwapCallback.ts b/src/hooks/useSwapCallback.ts index dfab17d97..cbc928231 100644 --- a/src/hooks/useSwapCallback.ts +++ b/src/hooks/useSwapCallback.ts @@ -19,7 +19,7 @@ import useTransactionDeadline from './useTransactionDeadline' import useENS from './useENS' import { Version } from './useToggledVersion' -export enum SwapCallbackState { +enum SwapCallbackState { INVALID, LOADING, VALID, @@ -191,7 +191,7 @@ function useSwapCallArguments( * This object seems to be undocumented by ethers. * @param error an error from the ethers provider */ -export function swapErrorToUserReadableMessage(error: any): string { +function swapErrorToUserReadableMessage(error: any): string { let reason: string | undefined while (Boolean(error)) { reason = error.reason ?? error.message ?? reason diff --git a/src/hooks/useTickToPrice.ts b/src/hooks/useTickToPrice.ts deleted file mode 100644 index e6e5ffdb0..000000000 --- a/src/hooks/useTickToPrice.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Token, Price } from '@uniswap/sdk-core' -import { tickToPrice } from '@uniswap/v3-sdk' - -export function getTickToPrice( - baseToken: Token | undefined, - quoteToken: Token | undefined, - tick: number | undefined -): Price | undefined { - if (!baseToken || !quoteToken || !tick) { - return undefined - } - return tickToPrice(baseToken, quoteToken, tick) -} diff --git a/src/i18n.tsx b/src/i18n.tsx index 36c0b0dc2..73890bdb7 100644 --- a/src/i18n.tsx +++ b/src/i18n.tsx @@ -75,7 +75,7 @@ const plurals: LocalePlural = { 'zh-TW': zh, } -export async function dynamicActivate(locale: SupportedLocale) { +async function dynamicActivate(locale: SupportedLocale) { const { messages } = await import(`@lingui/loader!./locales/${locale}.po`) i18n.loadLocaleData(locale, { plurals: () => plurals[locale] }) i18n.load(locale, messages) diff --git a/src/pages/AddLiquidity/PoolPriceBar.tsx b/src/pages/AddLiquidity/PoolPriceBar.tsx deleted file mode 100644 index 5ae450ad9..000000000 --- a/src/pages/AddLiquidity/PoolPriceBar.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Currency, Percent, Price } from '@uniswap/sdk-core' -import { useContext } from 'react' -import { Text } from 'rebass' -import { ThemeContext } from 'styled-components' -import { AutoColumn } from '../../components/Column' -import { AutoRow } from '../../components/Row' -import { ONE_BIPS } from '../../constants/misc' -import { Field } from '../../state/mint/v3/actions' -import { TYPE } from '../../theme' - -export function PoolPriceBar({ - currencies, - noLiquidity, - poolTokenPercentage, - price, -}: { - currencies: { [field in Field]?: Currency } - noLiquidity?: boolean - poolTokenPercentage?: Percent - price?: Price -}) { - const theme = useContext(ThemeContext) - return ( - - - - {price?.toSignificant(6) ?? '-'} - - {currencies[Field.CURRENCY_B]?.symbol} per {currencies[Field.CURRENCY_A]?.symbol} - - - - {price?.invert()?.toSignificant(6) ?? '-'} - - {currencies[Field.CURRENCY_A]?.symbol} per {currencies[Field.CURRENCY_B]?.symbol} - - - - - {noLiquidity && price - ? '100' - : (poolTokenPercentage?.lessThan(ONE_BIPS) ? '<0.01' : poolTokenPercentage?.toFixed(2)) ?? '0'} - % - - - Share of Pool - - - - - ) -} diff --git a/src/pages/AddLiquidity/Review.tsx b/src/pages/AddLiquidity/Review.tsx index eb385f6c7..e812edaa5 100644 --- a/src/pages/AddLiquidity/Review.tsx +++ b/src/pages/AddLiquidity/Review.tsx @@ -1,6 +1,5 @@ import { Field } from '../../state/mint/v3/actions' import { AutoColumn } from 'components/Column' -import Card from 'components/Card' import styled from 'styled-components/macro' import { Currency, CurrencyAmount, Price } from '@uniswap/sdk-core' import { Position } from '@uniswap/v3-sdk' @@ -10,15 +9,6 @@ const Wrapper = styled.div` padding-top: 12px; ` -export const Badge = styled(Card)<{ inRange?: boolean }>` - width: fit-content; - font-size: 14px; - font-weight: 500; - border-radius: 8px; - padding: 4px 6px; - background-color: ${({ inRange, theme }) => (inRange ? theme.green1 : theme.yellow2)}; -` - export function Review({ position, outOfRange, @@ -38,5 +28,3 @@ export function Review({ ) } - -export default Review diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx index c69c8b4bb..7e3903189 100644 --- a/src/pages/AddLiquidity/index.tsx +++ b/src/pages/AddLiquidity/index.tsx @@ -21,7 +21,7 @@ import { useIsSwapUnsupported } from '../../hooks/useIsSwapUnsupported' import { useUSDCValue } from '../../hooks/useUSDCPrice' import approveAmountCalldata from '../../utils/approveAmountCalldata' import { calculateGasMargin } from '../../utils/calculateGasMargin' -import Review from './Review' +import { Review } from './Review' import { useActiveWeb3React } from '../../hooks/web3' import { useCurrency } from '../../hooks/Tokens' import { ApprovalState, useApproveCallback } from '../../hooks/useApproveCallback' diff --git a/src/pages/AddLiquidity/styled.tsx b/src/pages/AddLiquidity/styled.tsx index c499b35a3..1c8a96980 100644 --- a/src/pages/AddLiquidity/styled.tsx +++ b/src/pages/AddLiquidity/styled.tsx @@ -1,7 +1,6 @@ import styled from 'styled-components/macro' import { AutoColumn } from 'components/Column' import CurrencyInputPanel from 'components/CurrencyInputPanel' -import { DarkGreyCard } from 'components/Card' import Input from 'components/NumericalInput' export const Wrapper = styled.div` @@ -24,20 +23,6 @@ export const ScrollablePage = styled.div` flex-direction: row; ` -export const FixedPreview = styled.div` - position: relative; - padding: 16px; - width: 260px; - height: fit-content; - margin-top: 42px; - background: ${({ theme }) => theme.bg0}; - box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), - 0px 24px 32px rgba(0, 0, 0, 0.01); - border-radius: 12px; - position: sticky; - top: 64px; -` - export const DynamicSection = styled(AutoColumn)<{ disabled?: boolean }>` opacity: ${({ disabled }) => (disabled ? '0.3' : '1')}; pointer-events: ${({ disabled }) => (disabled ? 'none' : 'initial')}; @@ -47,16 +32,6 @@ export const CurrencyDropdown = styled(CurrencyInputPanel)` width: 48.5%; ` -export const PreviewCard = styled(DarkGreyCard)<{ disabled?: boolean }>` - padding: 8px; - border-radius: 12px; - min-height: 40px; - opacity: ${({ disabled }) => (disabled ? '0.2' : '1')}; - display: flex; - align-items: center; - justify-content: center; -` - export const StyledInput = styled(Input)` background-color: ${({ theme }) => theme.bg0}; text-align: left; diff --git a/src/pages/Pool/PositionPage.tsx b/src/pages/Pool/PositionPage.tsx index bf47d8990..53f13fcf8 100644 --- a/src/pages/Pool/PositionPage.tsx +++ b/src/pages/Pool/PositionPage.tsx @@ -82,13 +82,6 @@ const Label = styled(({ end, ...props }) => )<{ end?: b align-items: center; ` -export const DarkBadge = styled.div` - width: fit-content; - border-radius: 8px; - background-color: ${({ theme }) => theme.bg0}; - padding: 4px 6px; -` - const ExtentsText = styled.span` color: ${({ theme }) => theme.text2}; font-size: 14px; diff --git a/src/pages/RemoveLiquidity/V3.tsx b/src/pages/RemoveLiquidity/V3.tsx index 068f3da52..cdec02a68 100644 --- a/src/pages/RemoveLiquidity/V3.tsx +++ b/src/pages/RemoveLiquidity/V3.tsx @@ -36,8 +36,6 @@ import RangeBadge from 'components/Badge/RangeBadge' import Toggle from 'components/Toggle' import { t, Trans } from '@lingui/macro' -export const UINT128MAX = BigNumber.from(2).pow(128).sub(1) - const DEFAULT_REMOVE_V3_LIQUIDITY_SLIPPAGE_TOLERANCE = new Percent(5, 100) // redirect invalid tokenIds diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 92a47263c..57843d59d 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -24,7 +24,7 @@ import Row, { AutoRow, RowFixed } from '../../components/Row' import BetterTradeLink from '../../components/swap/BetterTradeLink' import confirmPriceImpactWithoutFee from '../../components/swap/confirmPriceImpactWithoutFee' import ConfirmSwapModal from '../../components/swap/ConfirmSwapModal' -import { ArrowWrapper, BottomGrouping, Dots, SwapCallbackError, Wrapper } from '../../components/swap/styleds' +import { ArrowWrapper, Dots, SwapCallbackError, Wrapper } from '../../components/swap/styleds' import SwapHeader from '../../components/swap/SwapHeader' import TradePrice from '../../components/swap/TradePrice' import { SwitchLocaleLink } from '../../components/SwitchLocaleLink' @@ -504,7 +504,7 @@ export default function Swap({ history }: RouteComponentProps) { )} - +
{swapIsUnsupported ? ( @@ -655,7 +655,7 @@ export default function Swap({ history }: RouteComponentProps) { )} {isExpertMode && swapErrorMessage ? : null} - +
diff --git a/src/pages/styled.tsx b/src/pages/styled.tsx deleted file mode 100644 index e496398ef..000000000 --- a/src/pages/styled.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import styled from 'styled-components/macro' - -export const StandardPageWrapper = styled.div` - padding-top: 160px; - width: 100%; -` diff --git a/src/state/application/hooks.ts b/src/state/application/hooks.ts index d969d51db..2c0717385 100644 --- a/src/state/application/hooks.ts +++ b/src/state/application/hooks.ts @@ -21,16 +21,6 @@ export function useToggleModal(modal: ApplicationModal): () => void { return useCallback(() => dispatch(setOpenModal(open ? null : modal)), [dispatch, modal, open]) } -export function useOpenModal(modal: ApplicationModal): () => void { - const dispatch = useAppDispatch() - return useCallback(() => dispatch(setOpenModal(modal)), [dispatch, modal]) -} - -export function useCloseModals(): () => void { - const dispatch = useAppDispatch() - return useCallback(() => dispatch(setOpenModal(null)), [dispatch]) -} - export function useWalletModalToggle(): () => void { return useToggleModal(ApplicationModal.WALLET) } diff --git a/src/state/burn/reducer.ts b/src/state/burn/reducer.ts index b7c1e3464..816f920cb 100644 --- a/src/state/burn/reducer.ts +++ b/src/state/burn/reducer.ts @@ -1,7 +1,7 @@ import { createReducer } from '@reduxjs/toolkit' import { Field, typeInput } from './actions' -export interface BurnState { +interface BurnState { readonly independentField: Field readonly typedValue: string } diff --git a/src/state/burn/v3/reducer.ts b/src/state/burn/v3/reducer.ts index 4b7555755..78d1da43f 100644 --- a/src/state/burn/v3/reducer.ts +++ b/src/state/burn/v3/reducer.ts @@ -1,7 +1,7 @@ import { createReducer } from '@reduxjs/toolkit' import { selectPercent } from './actions' -export interface BurnV3State { +interface BurnV3State { readonly percent: number } diff --git a/src/state/lists/actions.ts b/src/state/lists/actions.ts index a64724c3a..0c055b963 100644 --- a/src/state/lists/actions.ts +++ b/src/state/lists/actions.ts @@ -1,5 +1,5 @@ import { ActionCreatorWithPayload, createAction } from '@reduxjs/toolkit' -import { TokenList, Version } from '@uniswap/token-lists' +import { TokenList } from '@uniswap/token-lists' export const fetchTokenList: Readonly<{ pending: ActionCreatorWithPayload<{ url: string; requestId: string }> @@ -20,4 +20,3 @@ export const disableList = createAction('lists/disableList') // versioning export const acceptListUpdate = createAction('lists/acceptListUpdate') -export const rejectVersionUpdate = createAction('lists/rejectVersionUpdate') diff --git a/src/state/lists/hooks.ts b/src/state/lists/hooks.ts index 1aa75d15d..919e681ab 100644 --- a/src/state/lists/hooks.ts +++ b/src/state/lists/hooks.ts @@ -15,7 +15,7 @@ export type TokenAddressMap = Readonly<{ const listCache: WeakMap | null = typeof WeakMap !== 'undefined' ? new WeakMap() : null -export function listToTokenMap(list: TokenList): TokenAddressMap { +function listToTokenMap(list: TokenList): TokenAddressMap { const result = listCache?.get(list) if (result) return result diff --git a/src/state/lists/wrappedTokenInfo.ts b/src/state/lists/wrappedTokenInfo.ts index d272112a1..096983718 100644 --- a/src/state/lists/wrappedTokenInfo.ts +++ b/src/state/lists/wrappedTokenInfo.ts @@ -4,7 +4,7 @@ import { TokenList } from '@uniswap/token-lists/dist/types' import { isAddress } from '../../utils' type TagDetails = Tags[keyof Tags] -export interface TagInfo extends TagDetails { +interface TagInfo extends TagDetails { id: string } /** diff --git a/src/state/mint/v3/reducer.ts b/src/state/mint/v3/reducer.ts index 286a14a04..1bbb49615 100644 --- a/src/state/mint/v3/reducer.ts +++ b/src/state/mint/v3/reducer.ts @@ -8,7 +8,7 @@ import { typeRightRangeInput, } from './actions' -export interface MintState { +interface MintState { readonly independentField: Field readonly typedValue: string readonly startPriceTypedValue: string // for the case when there's no liquidity @@ -16,7 +16,7 @@ export interface MintState { readonly rightRangeTypedValue: string } -export const initialState: MintState = { +const initialState: MintState = { independentField: Field.CURRENCY_A, typedValue: '', startPriceTypedValue: '', diff --git a/src/state/multicall/hooks.ts b/src/state/multicall/hooks.ts index 058b091e1..17668e6a1 100644 --- a/src/state/multicall/hooks.ts +++ b/src/state/multicall/hooks.ts @@ -15,7 +15,7 @@ export interface Result extends ReadonlyArray { type MethodArg = string | number | BigNumber type MethodArgs = Array -export type OptionalMethodInputs = Array | undefined +type OptionalMethodInputs = Array | undefined function isMethodArg(x: unknown): x is MethodArg { return BigNumber.isBigNumber(x) || ['string', 'number'].indexOf(typeof x) !== -1 @@ -102,7 +102,7 @@ function useCallsData( ) } -export interface CallState { +interface CallState { readonly valid: boolean // the result, or undefined if loading or errored/no data readonly result: Result | undefined diff --git a/src/state/stake/hooks.ts b/src/state/stake/hooks.ts index de438a10c..fbc6e3c42 100644 --- a/src/state/stake/hooks.ts +++ b/src/state/stake/hooks.ts @@ -11,7 +11,7 @@ import useCurrentBlockTimestamp from 'hooks/useCurrentBlockTimestamp' import { Interface } from '@ethersproject/abi' import { abi as STAKING_REWARDS_ABI } from '@uniswap/liquidity-staker/build/StakingRewards.json' -export const STAKING_REWARDS_INTERFACE = new Interface(STAKING_REWARDS_ABI) +const STAKING_REWARDS_INTERFACE = new Interface(STAKING_REWARDS_ABI) export const STAKING_GENESIS = 1600387200 @@ -273,32 +273,3 @@ export function useDerivedStakeInfo( error, } } - -// based on typed value -export function useDerivedUnstakeInfo( - typedValue: string, - stakingAmount: CurrencyAmount -): { - parsedAmount?: CurrencyAmount - error?: string -} { - const { account } = useActiveWeb3React() - - const parsedInput: CurrencyAmount | undefined = tryParseAmount(typedValue, stakingAmount.currency) - - const parsedAmount = - parsedInput && JSBI.lessThanOrEqual(parsedInput.quotient, stakingAmount.quotient) ? parsedInput : undefined - - let error: string | undefined - if (!account) { - error = t`Connect Wallet` - } - if (!parsedAmount) { - error = error ?? t`Enter an amount` - } - - return { - parsedAmount, - error, - } -} diff --git a/src/state/user/actions.ts b/src/state/user/actions.ts index 0211b1999..38a30272e 100644 --- a/src/state/user/actions.ts +++ b/src/state/user/actions.ts @@ -32,4 +32,3 @@ export const removeSerializedToken = createAction<{ chainId: number; address: st export const addSerializedPair = createAction<{ serializedPair: SerializedPair }>('user/addSerializedPair') export const removeSerializedPair = createAction<{ chainId: number; tokenAAddress: string; tokenBAddress: string }>('user/removeSerializedPair') -export const toggleURLWarning = createAction('app/toggleURLWarning') diff --git a/src/state/user/hooks.tsx b/src/state/user/hooks.tsx index 9c42bc168..449a8e05f 100644 --- a/src/state/user/hooks.tsx +++ b/src/state/user/hooks.tsx @@ -17,7 +17,6 @@ import { removeSerializedToken, SerializedPair, SerializedToken, - toggleURLWarning, updateArbitrumAlphaAcknowledged, updateHideClosedPositions, updateUserDarkMode, @@ -250,11 +249,6 @@ export function useURLWarningVisible(): boolean { return useAppSelector((state: AppState) => state.user.URLWarningVisible) } -export function useURLWarningToggle(): () => void { - const dispatch = useAppDispatch() - return useCallback(() => dispatch(toggleURLWarning()), [dispatch]) -} - /** * Given two tokens return the liquidity token that represents its liquidity shares * @param tokenA one of the two tokens diff --git a/src/state/user/reducer.ts b/src/state/user/reducer.ts index 1053a58eb..3326d7ea4 100644 --- a/src/state/user/reducer.ts +++ b/src/state/user/reducer.ts @@ -13,7 +13,6 @@ import { updateUserExpertMode, updateUserSlippageTolerance, updateUserDeadline, - toggleURLWarning, updateUserSingleHopOnly, updateHideClosedPositions, updateUserLocale, @@ -189,7 +188,4 @@ export default createReducer(initialState, (builder) => } state.timestamp = currentTimestamp() }) - .addCase(toggleURLWarning, (state) => { - state.URLWarningVisible = !state.URLWarningVisible - }) ) diff --git a/src/theme/components.tsx b/src/theme/components.tsx index 0f49ccf7b..f0ddb6481 100644 --- a/src/theme/components.tsx +++ b/src/theme/components.tsx @@ -1,4 +1,3 @@ -import { darken } from 'polished' import React, { HTMLProps } from 'react' import { ArrowLeft, ExternalLink as LinkIconFeather, Trash, X } from 'react-feather' import ReactGA from 'react-ga' @@ -24,36 +23,6 @@ export const ButtonText = styled.button` } ` -export const Button = styled.button.attrs<{ warning: boolean }, { backgroundColor: string }>(({ warning, theme }) => ({ - backgroundColor: warning ? theme.red1 : theme.primary1, -}))` - padding: 1rem 2rem 1rem 2rem; - border-radius: 3rem; - cursor: pointer; - user-select: none; - font-size: 1rem; - border: none; - outline: none; - background-color: ${({ backgroundColor }) => backgroundColor}; - color: ${({ theme }) => theme.white}; - width: 100%; - - :hover, - :focus { - background-color: ${({ backgroundColor }) => darken(0.05, backgroundColor)}; - } - - :active { - background-color: ${({ backgroundColor }) => darken(0.1, backgroundColor)}; - } - - :disabled { - background-color: ${({ theme }) => theme.bg1}; - color: ${({ theme }) => theme.text4}; - cursor: auto; - } -` - export const CloseIcon = styled(X)<{ onClick: () => void }>` cursor: pointer; ` @@ -159,7 +128,7 @@ const LinkIconWrapper = styled.a` } ` -export const LinkIcon = styled(LinkIconFeather)` +const LinkIcon = styled(LinkIconFeather)` height: 16px; width: 18px; margin-left: 10px; @@ -251,7 +220,7 @@ const rotate = keyframes` } ` -export const Spinner = styled.img` +const Spinner = styled.img` animation: 2s ${rotate} linear infinite; width: 16px; height: 16px; @@ -291,10 +260,3 @@ export const SmallOnly = styled.span` display: block; `}; ` - -export const ExtraSmallOnly = styled.span` - display: none; - ${({ theme }) => theme.mediaWidth.upToExtraSmall` - display: block; - `}; -` diff --git a/src/theme/index.tsx b/src/theme/index.tsx index 1c47dae4a..a0d00c742 100644 --- a/src/theme/index.tsx +++ b/src/theme/index.tsx @@ -35,7 +35,7 @@ const mediaWidthTemplates: { [width in keyof typeof MEDIA_WIDTHS]: typeof css } const white = '#FFFFFF' const black = '#000000' -export function colors(darkMode: boolean): Colors { +function colors(darkMode: boolean): Colors { return { // base white, @@ -96,7 +96,7 @@ export function colors(darkMode: boolean): Colors { } } -export function theme(darkMode: boolean): DefaultTheme { +function theme(darkMode: boolean): DefaultTheme { return { ...colors(darkMode), diff --git a/src/theme/styled.d.ts b/src/theme/styled.d.ts index 0a748bb7e..1439363c3 100644 --- a/src/theme/styled.d.ts +++ b/src/theme/styled.d.ts @@ -57,12 +57,6 @@ export interface Colors { warning: Color } -export interface Grids { - sm: number - md: number - lg: number -} - declare module 'styled-components' { export interface DefaultTheme extends Colors { grids: Grids diff --git a/src/utils/index.ts b/src/utils/index.ts index 0b279b429..8e8666a7e 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -25,12 +25,12 @@ export function shortenAddress(address: string, chars = 4): string { } // account is not optional -export function getSigner(library: Web3Provider, account: string): JsonRpcSigner { +function getSigner(library: Web3Provider, account: string): JsonRpcSigner { return library.getSigner(account).connectUnchecked() } // account is optional -export function getProviderOrSigner(library: Web3Provider, account?: string): Web3Provider | JsonRpcSigner { +function getProviderOrSigner(library: Web3Provider, account?: string): Web3Provider | JsonRpcSigner { return account ? getSigner(library, account) : library } diff --git a/src/utils/retry.ts b/src/utils/retry.ts index 39f7f0923..2916c0f50 100644 --- a/src/utils/retry.ts +++ b/src/utils/retry.ts @@ -9,7 +9,7 @@ function waitRandom(min: number, max: number): Promise { /** * This error is thrown if the function is cancelled before completing */ -export class CancelledError extends Error { +class CancelledError extends Error { public isCancelledError: true = true constructor() { super('Cancelled')