Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
55c3c527
Unverified
Commit
55c3c527
authored
Nov 16, 2022
by
vignesh mohankumar
Committed by
GitHub
Nov 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: rm remaining unused nft code (#5243)
parent
8b985975
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
83 deletions
+1
-83
icons.tsx
src/nft/components/icons.tsx
+0
-7
common.css.ts
src/nft/css/common.css.ts
+1
-28
useTimeout.ts
src/nft/hooks/useTimeout.ts
+0
-31
toSignificant.ts
src/nft/utils/toSignificant.ts
+0
-14
hooks.ts
src/state/lists/hooks.ts
+0
-3
No files found.
src/nft/components/icons.tsx
View file @
55c3c527
...
@@ -71,13 +71,6 @@ export const VerifiedIcon = (props: SVGProps) => (
...
@@ -71,13 +71,6 @@ export const VerifiedIcon = (props: SVGProps) => (
</
svg
>
</
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
)
=>
(
export
const
PoolIcon
=
(
props
:
SVGProps
)
=>
(
<
svg
{
...
props
}
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
svg
{
...
props
}
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
>
<
path
<
path
...
...
src/nft/css/common.css.ts
View file @
55c3c527
import
{
style
}
from
'
@vanilla-extract/css
'
import
{
style
}
from
'
@vanilla-extract/css
'
import
{
sprinkles
,
themeVars
,
vars
}
from
'
./sprinkles.css
'
import
{
sprinkles
,
vars
}
from
'
./sprinkles.css
'
export
const
center
=
sprinkles
({
export
const
center
=
sprinkles
({
display
:
'
flex
'
,
display
:
'
flex
'
,
...
@@ -33,7 +33,6 @@ export const bodySmall = sprinkles({ fontWeight: 'normal', fontSize: '14', lineH
...
@@ -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
caption
=
sprinkles
({
fontWeight
:
'
normal
'
,
fontSize
:
'
12
'
,
lineHeight
:
'
16
'
})
export
const
badge
=
sprinkles
({
fontWeight
:
'
semibold
'
,
fontSize
:
'
10
'
,
lineHeight
:
'
12
'
})
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
buttonTextMedium
=
sprinkles
({
fontWeight
:
'
semibold
'
,
fontSize
:
'
16
'
,
lineHeight
:
'
20
'
})
export
const
buttonTextSmall
=
sprinkles
({
fontWeight
:
'
semibold
'
,
fontSize
:
'
14
'
,
lineHeight
:
'
16
'
})
export
const
buttonTextSmall
=
sprinkles
({
fontWeight
:
'
semibold
'
,
fontSize
:
'
14
'
,
lineHeight
:
'
16
'
})
...
@@ -68,28 +67,6 @@ export const buttonMedium = style([
...
@@ -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
([
export
const
disabled
=
style
([
{
{
padding
:
'
19px 17px
'
,
padding
:
'
19px 17px
'
,
...
@@ -107,10 +84,6 @@ export const disabled = style([
...
@@ -107,10 +84,6 @@ export const disabled = style([
}),
}),
])
])
export
const
imageHover
=
style
({
transform
:
'
scale(1.25)
'
,
})
export
const
magicalGradient
=
style
({
export
const
magicalGradient
=
style
({
selectors
:
{
selectors
:
{
'
&::before
'
:
{
'
&::before
'
:
{
...
...
src/nft/hooks/useTimeout.ts
deleted
100644 → 0
View file @
8b985975
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
)
}
src/nft/utils/toSignificant.ts
View file @
55c3c527
...
@@ -26,20 +26,6 @@ export function nFormat(num: number, digits = 0): string {
...
@@ -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
'
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
* Formats percent change values
* @param v number
* @param v number
...
...
src/state/lists/hooks.ts
View file @
55c3c527
...
@@ -83,6 +83,3 @@ export function useUnsupportedTokenList(): TokenAddressMap {
...
@@ -83,6 +83,3 @@ export function useUnsupportedTokenList(): TokenAddressMap {
// format into one token address map
// format into one token address map
return
useMemo
(()
=>
combineMaps
(
brokenListMap
,
loadedUnsupportedListMap
),
[
brokenListMap
,
loadedUnsupportedListMap
])
return
useMemo
(()
=>
combineMaps
(
brokenListMap
,
loadedUnsupportedListMap
),
[
brokenListMap
,
loadedUnsupportedListMap
])
}
}
export
function
useIsListActive
(
url
:
string
):
boolean
{
return
Boolean
(
DEFAULT_ACTIVE_LIST_URLS
?.
includes
(
url
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment