chore: remove all remaining unused exports (#5510)

chore: remove unused tokens/core variables
This commit is contained in:
Vignesh Mohankumar 2022-12-01 17:13:07 -05:00 committed by GitHub
parent a446dc7f10
commit a06bb79039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 0 additions and 105 deletions

@ -14,10 +14,6 @@ export const LightCard = styled(Card)`
background-color: ${({ theme }) => theme.deprecated_bg1};
`
export const LightGrayCard = styled(Card)`
background-color: ${({ theme }) => theme.deprecated_bg2};
`
export const GrayCard = styled(Card)`
background-color: ${({ theme }) => theme.deprecated_bg3};
`

@ -5,13 +5,6 @@ import styled from 'styled-components/macro'
import { AutoColumn } from '../Column'
import { RowBetween } from '../Row'
export const TextDot = styled.div`
height: 3px;
width: 3px;
background-color: ${({ theme }) => theme.deprecated_text2};
border-radius: 50%;
`
export const Checkbox = styled.input`
border: 1px solid ${({ theme }) => theme.deprecated_red3};
height: 20px;
@ -77,12 +70,6 @@ export const Separator = styled.div`
background-color: ${({ theme }) => theme.backgroundOutline};
`
export const SeparatorDark = styled.div`
width: 100%;
height: 1px;
background-color: ${({ theme }) => theme.deprecated_bg3};
`
export const LoadingRows = styled(BaseLoadingRows)`
grid-column-gap: 0.5em;
grid-template-columns: repeat(12, 1fr);

@ -5,4 +5,3 @@ export const MEDIUM_MEDIA_BREAKPOINT = '720px'
export const SMALL_MEDIA_BREAKPOINT = '540px'
export const MOBILE_MEDIA_BREAKPOINT = '420px'
export const SMALL_MOBILE_MEDIA_BREAKPOINT = '390px'
export const SMALLEST_MOBILE_MEDIA_BREAKPOINT = '320px'

@ -57,12 +57,6 @@ export const ArrowWrapper = styled.div<{ clickable: boolean }>`
: null}
`
export const SectionBreak = styled.div`
height: 1px;
width: 100%;
background-color: ${({ theme }) => theme.deprecated_bg3};
`
export const ErrorText = styled(Text)<{ severity?: 0 | 1 | 2 | 3 | 4 }>`
color: ${({ theme, severity }) =>
severity === 3 || severity === 4

@ -133,16 +133,6 @@ export function useSearchInactiveTokenLists(search: string | undefined, minResul
}, [activeTokens, chainId, inactiveUrls, lists, minResults, search])
}
export function useIsTokenActive(token: Token | undefined | null): boolean {
const activeTokens = useAllTokens()
if (!activeTokens || !token) {
return false
}
return !!activeTokens[token.address]
}
// Check if currency is included in custom list from user storage
export function useIsUserAddedToken(currency: Currency | undefined | null): boolean {
const userAddedTokens = useUserAddedTokens()

@ -89,26 +89,3 @@ export function useColor(token?: Token) {
return color
}
export function useListColor(listImageUri?: string) {
const [color, setColor] = useState('#2172E5')
useEffect(() => {
let stale = false
if (listImageUri) {
getColorFromUriPath(listImageUri).then((color) => {
if (!stale && color !== null) {
setColor(color)
}
})
}
return () => {
stale = true
setColor('#2172E5')
}
}, [listImageUri])
return color
}

@ -3,14 +3,6 @@ import { formatEther } from '@ethersproject/units'
import { TxResponse, UpdatedGenieAsset } from 'nft/types'
import { getTotalNftValue } from 'nft/utils'
// Shortens a given txHash. With standard charsToShorten var of 4, a hash will become 0x1234...1234
export const shortenTxHash = (txHash: string, charsToShorten = 4, addCharsToBack = 0): string => {
return `${txHash.substring(0, charsToShorten + 2)}...${txHash.substring(
txHash.length - charsToShorten,
txHash.length - (charsToShorten + addCharsToBack)
)}`
}
export const parseTransactionResponse = (transactionResponse: TxResponse | undefined, ethPrice: number) => {
let nftsPurchased: UpdatedGenieAsset[] = []
let nftsNotPurchased: UpdatedGenieAsset[] = []

@ -16,11 +16,6 @@ export function useToggleModal(modal: ApplicationModal): () => void {
return useCallback(() => dispatch(setOpenModal(isOpen ? null : modal)), [dispatch, modal, isOpen])
}
export function useOpenModal(modal: ApplicationModal): () => void {
const dispatch = useAppDispatch()
return useCallback(() => dispatch(setOpenModal(modal)), [dispatch, modal])
}
export function useCloseModal(_modal: ApplicationModal): () => void {
const dispatch = useAppDispatch()
return useCallback(() => dispatch(setOpenModal(null)), [dispatch])

@ -17,7 +17,6 @@ import { AppState } from '../index'
import {
addSerializedPair,
addSerializedToken,
removeSerializedToken,
updateHideClosedPositions,
updateHideNFTWelcomeModal,
updateShowNftPromoBanner,
@ -234,16 +233,6 @@ export function useAddUserToken(): (token: Token) => void {
)
}
export function useRemoveUserAddedToken(): (chainId: number, address: string) => void {
const dispatch = useAppDispatch()
return useCallback(
(chainId: number, address: string) => {
dispatch(removeSerializedToken({ chainId, address }))
},
[dispatch]
)
}
export function useUserAddedTokensOnChain(chainId: number | undefined | null): Token[] {
const serializedTokensMap = useAppSelector(({ user: { tokens } }) => tokens)

@ -9,7 +9,6 @@ import {
Copy,
ExternalLink as ExternalLinkIconFeather,
Link as LinkIconFeather,
Trash,
X,
} from 'react-feather'
import { Link } from 'react-router-dom'
@ -136,17 +135,6 @@ const CopyIcon = styled(Copy)`
stroke: ${({ theme }) => theme.accentAction};
`
export const TrashIcon = styled(Trash)`
${ClickableStyle}
${IconStyle}
stroke: ${({ theme }) => theme.deprecated_text3};
cursor: pointer;
align-items: center;
justify-content: center;
display: flex;
`
const rotateImg = keyframes`
0% {
transform: perspective(1000px) rotateY(0deg);

@ -28,12 +28,6 @@ export const monthDayFormatter = (locale: string) => (timestamp: NumberValue) =>
day: 'numeric',
})
export const monthYearFormatter = (locale: string) => (timestamp: NumberValue) =>
createDateFormatter(timestamp, locale, {
month: 'long',
year: 'numeric',
})
export const monthYearDayFormatter = (locale: string) => (timestamp: NumberValue) =>
createDateFormatter(timestamp, locale, {
month: 'short',

@ -2,8 +2,6 @@ import { getAddress } from '@ethersproject/address'
import { AddressZero } from '@ethersproject/constants'
import { Contract } from '@ethersproject/contracts'
import type { JsonRpcProvider, JsonRpcSigner } from '@ethersproject/providers'
import { Token } from '@uniswap/sdk-core'
import { ChainTokenMap } from 'lib/hooks/useTokenList/utils'
// returns the checksummed address if the address is valid, otherwise returns false
export function isAddress(value: any): string | false {
@ -47,7 +45,3 @@ export function getContract(address: string, ABI: any, provider: JsonRpcProvider
export function escapeRegExp(string: string): string {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // $& means the whole matched string
}
export function isTokenOnList(chainTokenMap: ChainTokenMap, token?: Token): boolean {
return Boolean(token?.isToken && chainTokenMap[token.chainId]?.[token.address])
}