refactor: rm remaining unused nft code (#5243)

This commit is contained in:
vignesh mohankumar 2022-11-16 01:47:58 -05:00 committed by GitHub
parent 8b98597566
commit 55c3c527f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 83 deletions

@ -71,13 +71,6 @@ export const VerifiedIcon = (props: SVGProps) => (
</svg>
)
export const EthIcon = (props: SVGProps) => (
<svg {...props} role="img" xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 16 16" fill="none">
<path fill="currentColor" d="M4.85742 7.95904L8.00028 2.57129L11.1431 7.95904L8.00028 9.75496L4.85742 7.95904Z" />
<path fill="currentColor" d="M4.85742 8.85742L8.00028 10.6533L11.1431 8.85742L8.00028 13.3472L4.85742 8.85742Z" />
</svg>
)
export const PoolIcon = (props: SVGProps) => (
<svg {...props} fill="none" xmlns="http://www.w3.org/2000/svg">
<path

@ -1,6 +1,6 @@
import { style } from '@vanilla-extract/css'
import { sprinkles, themeVars, vars } from './sprinkles.css'
import { sprinkles, vars } from './sprinkles.css'
export const center = sprinkles({
display: 'flex',
@ -33,7 +33,6 @@ export const bodySmall = sprinkles({ fontWeight: 'normal', fontSize: '14', lineH
export const caption = sprinkles({ fontWeight: 'normal', fontSize: '12', lineHeight: '16' })
export const badge = sprinkles({ fontWeight: 'semibold', fontSize: '10', lineHeight: '12' })
export const buttonTextLarge = sprinkles({ fontWeight: 'semibold', fontSize: '20', lineHeight: '24' })
export const buttonTextMedium = sprinkles({ fontWeight: 'semibold', fontSize: '16', lineHeight: '20' })
export const buttonTextSmall = sprinkles({ fontWeight: 'semibold', fontSize: '14', lineHeight: '16' })
@ -68,28 +67,6 @@ export const buttonMedium = style([
},
])
export const buttonSmall = style([
buttonTextSmall,
commonButtonStyles,
sprinkles({
background: 'backgroundSurface',
color: 'genieBlue',
}),
{
padding: '2px 8px',
':disabled': {
color: themeVars.colors.backgroundSurface,
backgroundColor: themeVars.colors.backgroundOutline,
},
},
])
export const buttonReset = sprinkles({
border: 'none',
background: 'none',
cursor: 'pointer',
})
export const disabled = style([
{
padding: '19px 17px',
@ -107,10 +84,6 @@ export const disabled = style([
}),
])
export const imageHover = style({
transform: 'scale(1.25)',
})
export const magicalGradient = style({
selectors: {
'&::before': {

@ -1,31 +0,0 @@
import { useEffect, useState } from 'react'
const MINUTE = 1000 * 60
const HOUR = MINUTE * 60
const DAY = 24 * HOUR
const getReturnValues = (countDown: number): [number, number, number, number] => {
// calculate time left
const days = Math.floor(countDown / DAY)
const hours = Math.floor((countDown % DAY) / HOUR)
const minutes = Math.floor((countDown % HOUR) / MINUTE)
const seconds = Math.floor((countDown % MINUTE) / 1000)
return [days, hours, minutes, seconds]
}
export const useTimeout = (targetDate: Date) => {
const countDownDate = new Date(targetDate).getTime()
const [countDown, setCountDown] = useState<number>(countDownDate - new Date().getTime())
useEffect(() => {
const interval = setInterval(() => {
setCountDown(countDownDate - new Date().getTime())
}, 1000)
return () => clearInterval(interval)
}, [countDownDate])
return getReturnValues(countDown)
}

@ -26,20 +26,6 @@ export function nFormat(num: number, digits = 0): string {
return item ? (num / item.value).toFixed(digits).replace(rx, '$1') + item.symbol : '0'
}
/**
* Rounds a number to significant 4-digit number
* @param n number
* @param precision
* @returns formatted number
*/
export const toSignificant = (n: string, precision = 4): string => {
const floatBal = parseFloat(n)
if (floatBal > 9999) return nFormat(floatBal, 0)
return floatBal.toPrecision(precision)
}
/**
* Formats percent change values
* @param v number

@ -83,6 +83,3 @@ export function useUnsupportedTokenList(): TokenAddressMap {
// format into one token address map
return useMemo(() => combineMaps(brokenListMap, loadedUnsupportedListMap), [brokenListMap, loadedUnsupportedListMap])
}
export function useIsListActive(url: string): boolean {
return Boolean(DEFAULT_ACTIVE_LIST_URLS?.includes(url))
}