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
2ee9b16c
Unverified
Commit
2ee9b16c
authored
Jul 06, 2021
by
Noah Zinsmeister
Committed by
GitHub
Jul 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove a lot of dead code (#1970)
parent
c52cd2c3
Changes
65
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
67 additions
and
1286 deletions
+67
-1286
unisocks.json
src/abis/unisocks.json
+0
-471
RangeBadge.tsx
src/components/Badge/RangeBadge.tsx
+0
-7
index.tsx
src/components/Badge/index.tsx
+1
-1
index.tsx
src/components/Button/index.tsx
+0
-63
index.tsx
src/components/Card/index.tsx
+0
-6
index.tsx
src/components/DoubleLogo/index.tsx
+1
-1
URLWarning.tsx
src/components/Header/URLWarning.tsx
+0
-53
index.tsx
src/components/Header/index.tsx
+1
-1
data.ts
src/components/LineChart/data.ts
+0
-152
index.tsx
src/components/LineChart/index.tsx
+2
-2
index.tsx
src/components/Logo/index.tsx
+1
-1
PopupItem.tsx
src/components/Popups/PopupItem.tsx
+2
-2
index.tsx
src/components/PositionCard/index.tsx
+1
-8
index.tsx
src/components/PositionList/index.tsx
+1
-1
index.tsx
src/components/PositionListItem/index.tsx
+1
-1
SortButton.tsx
src/components/SearchModal/SortButton.tsx
+0
-33
styleds.tsx
src/components/SearchModal/styleds.tsx
+1
-42
index.tsx
src/components/ThemeColorPalette/index.tsx
+0
-36
ListToggle.tsx
src/components/Toggle/ListToggle.tsx
+1
-1
index.tsx
src/components/Toggle/index.tsx
+1
-1
index.tsx
src/components/Tooltip/index.tsx
+1
-1
index.tsx
src/components/TransactionConfirmationModal/index.tsx
+2
-2
index.tsx
src/components/TransactionSettings/index.tsx
+1
-1
styled.ts
src/components/earn/styled.ts
+0
-11
AdvancedSwapDetails.tsx
src/components/swap/AdvancedSwapDetails.tsx
+1
-1
AdvancedSwapDetailsDropdown.tsx
src/components/swap/AdvancedSwapDetailsDropdown.tsx
+0
-20
FormattedPriceImpact.tsx
src/components/swap/FormattedPriceImpact.tsx
+1
-9
SwapModalHeader.tsx
src/components/swap/SwapModalHeader.tsx
+1
-1
styleds.tsx
src/components/swap/styleds.tsx
+0
-71
NetworkConnector.ts
src/connectors/NetworkConnector.ts
+1
-1
misc.ts
src/constants/misc.ts
+4
-4
wallet.ts
src/constants/wallet.ts
+1
-1
useContract.ts
src/hooks/useContract.ts
+1
-14
useERC20Permit.ts
src/hooks/useERC20Permit.ts
+3
-3
useFeeTierDistribution.ts
src/hooks/useFeeTierDistribution.ts
+1
-1
useLast.ts
src/hooks/useLast.ts
+0
-12
useSocksBalance.ts
src/hooks/useSocksBalance.ts
+11
-14
useSwapCallback.ts
src/hooks/useSwapCallback.ts
+2
-2
useTickToPrice.ts
src/hooks/useTickToPrice.ts
+0
-13
i18n.tsx
src/i18n.tsx
+1
-1
PoolPriceBar.tsx
src/pages/AddLiquidity/PoolPriceBar.tsx
+0
-52
Review.tsx
src/pages/AddLiquidity/Review.tsx
+0
-12
index.tsx
src/pages/AddLiquidity/index.tsx
+1
-1
styled.tsx
src/pages/AddLiquidity/styled.tsx
+0
-25
PositionPage.tsx
src/pages/Pool/PositionPage.tsx
+0
-7
V3.tsx
src/pages/RemoveLiquidity/V3.tsx
+0
-2
index.tsx
src/pages/Swap/index.tsx
+3
-3
styled.tsx
src/pages/styled.tsx
+0
-6
hooks.ts
src/state/application/hooks.ts
+0
-10
reducer.ts
src/state/burn/reducer.ts
+1
-1
reducer.ts
src/state/burn/v3/reducer.ts
+1
-1
actions.ts
src/state/lists/actions.ts
+1
-2
hooks.ts
src/state/lists/hooks.ts
+1
-1
wrappedTokenInfo.ts
src/state/lists/wrappedTokenInfo.ts
+1
-1
reducer.ts
src/state/mint/v3/reducer.ts
+2
-2
hooks.ts
src/state/multicall/hooks.ts
+2
-2
hooks.ts
src/state/stake/hooks.ts
+1
-30
actions.ts
src/state/user/actions.ts
+0
-1
hooks.tsx
src/state/user/hooks.tsx
+0
-6
reducer.ts
src/state/user/reducer.ts
+0
-4
components.tsx
src/theme/components.tsx
+2
-40
index.tsx
src/theme/index.tsx
+2
-2
styled.d.ts
src/theme/styled.d.ts
+0
-6
index.ts
src/utils/index.ts
+2
-2
retry.ts
src/utils/retry.ts
+1
-1
No files found.
src/abis/unisocks.json
deleted
100644 → 0
View file @
c52cd2c3
[
{
"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"
}
]
src/components/Badge/RangeBadge.tsx
View file @
2ee9b16c
...
...
@@ -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
,
...
...
src/components/Badge/index.tsx
View file @
2ee9b16c
...
...
@@ -13,7 +13,7 @@ export enum BadgeVariant {
WARNING_OUTLINE
=
'
WARNING_OUTLINE
'
,
}
export
interface
BadgeProps
{
interface
BadgeProps
{
variant
?:
BadgeVariant
}
...
...
src/components/Button/index.tsx
View file @
2ee9b16c
...
...
@@ -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
1
pt
$
{({
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
1
pt
$
{({
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
:
4
px
8
px
;
height
:
36
px
;
font
-
weight
:
500
;
background
-
color
:
$
{({
theme
})
=>
theme
.
bg3
};
background
:
radial
-
gradient
(
174.47
%
188.91
%
at
1.84
%
0
%
,
#
ff007a
0
%
,
#
2172
e5
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
:
1
px
solid
$
{({
theme
})
=>
theme
.
bg2
};
background
-
color
:
transparent
;
...
...
@@ -255,27 +213,6 @@ export const ButtonText = styled(Base)`
}
`
export const ButtonWhite = styled(Base)`
border
:
1
px
solid
#
edeef2
;
background
-
color
:
$
{({
theme
})
=>
theme
.
bg1
};
color
:
black
;
&
:
focus
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
box
-
shadow
:
0
0
0
1
pt
$
{
darken
(
0.05
,
'
#edeef2
'
)};
}
&
:
hover
{
box
-
shadow
:
0
0
0
1
pt
$
{
darken
(
0.1
,
'
#edeef2
'
)};
}
&
:
active
{
box
-
shadow
:
0
0
0
1
pt
$
{
darken
(
0.1
,
'
#edeef2
'
)};
}
&
:
disabled
{
opacity
:
50
%
;
cursor
:
auto
;
}
`
const ButtonConfirmedStyle = styled(Base)`
background
-
color
:
$
{({
theme
})
=>
theme
.
bg3
};
color
:
$
{({
theme
})
=>
theme
.
text1
};
...
...
src/components/Card/index.tsx
View file @
2ee9b16c
...
...
@@ -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
}
;
...
...
src/components/DoubleLogo/index.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/components/Header/URLWarning.tsx
deleted
100644 → 0
View file @
c52cd2c3
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
?
(
<
PhishAlert
isActive=
{
showURLWarning
}
>
<
div
style=
{
{
display
:
'
flex
'
}
}
>
<
AlertTriangle
style=
{
{
marginRight
:
6
}
}
size=
{
12
}
/>
<
Trans
>
Make sure the URL is
<
code
style=
{
{
padding
:
'
0 4px
'
,
display
:
'
inline
'
,
fontWeight
:
'
bold
'
}
}
>
app.uniswap.org
</
code
>
</
Trans
>
</
div
>
<
StyledClose
size=
{
12
}
onClick=
{
toggleURLWarning
}
/>
</
PhishAlert
>
)
:
window
.
location
.
hostname
===
'
app.uniswap.org
'
?
(
<
PhishAlert
isActive=
{
showURLWarning
}
>
<
div
style=
{
{
display
:
'
flex
'
}
}
>
<
AlertTriangle
style=
{
{
marginRight
:
6
}
}
size=
{
12
}
/>
<
Trans
>
Always make sure the URL is
<
code
style=
{
{
padding
:
'
0 4px
'
,
display
:
'
inline
'
,
fontWeight
:
'
bold
'
}
}
>
app.uniswap.org
</
code
>
- bookmark it
to be safe.
</
Trans
>
</
div
>
<
StyledClose
size=
{
12
}
onClick=
{
toggleURLWarning
}
/>
</
PhishAlert
>
)
:
null
}
src/components/Header/index.tsx
View file @
2ee9b16c
...
...
@@ -255,7 +255,7 @@ const StyledExternalLink = styled(ExternalLink).attrs({
`
}
`
export
const
StyledMenuButton
=
styled
.
button
`
const
StyledMenuButton
=
styled
.
button
`
position: relative;
width: 100%;
height: 100%;
...
...
src/components/LineChart/data.ts
deleted
100644 → 0
View file @
c52cd2c3
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
},
]
src/components/LineChart/index.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/components/Logo/index.tsx
View file @
2ee9b16c
...
...
@@ -5,7 +5,7 @@ import useTheme from '../../hooks/useTheme'
const
BAD_SRCS
:
{
[
tokenAddress
:
string
]:
true
}
=
{}
export
interface
LogoProps
extends
Pick
<
ImageProps
,
'
style
'
|
'
alt
'
|
'
className
'
>
{
interface
LogoProps
extends
Pick
<
ImageProps
,
'
style
'
|
'
alt
'
|
'
className
'
>
{
srcs
:
string
[]
}
...
...
src/components/Popups/PopupItem.tsx
View file @
2ee9b16c
...
...
@@ -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;
...
...
src/components/PositionCard/index.tsx
View file @
2ee9b16c
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
})
=>
...
...
src/components/PositionList/index.tsx
View file @
2ee9b16c
...
...
@@ -34,7 +34,7 @@ const MobileHeader = styled.div`
}
`
export
type
PositionListProps
=
React
.
PropsWithChildren
<
{
type
PositionListProps
=
React
.
PropsWithChildren
<
{
positions
:
PositionDetails
[]
}
>
...
...
src/components/PositionListItem/index.tsx
View file @
2ee9b16c
...
...
@@ -117,7 +117,7 @@ const DataText = styled.div`
`
}
;
`
export
interface
PositionListItemProps
{
interface
PositionListItemProps
{
positionDetails
:
PositionDetails
}
...
...
src/components/SearchModal/SortButton.tsx
deleted
100644 → 0
View file @
c52cd2c3
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
(
<
FilterWrapper
onClick=
{
toggleSortOrder
}
>
<
Text
fontSize=
{
14
}
fontWeight=
{
500
}
>
{
ascending
?
'
↑
'
:
'
↓
'
}
</
Text
>
</
FilterWrapper
>
)
}
src/components/SearchModal/styleds.tsx
View file @
2ee9b16c
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;
...
...
src/components/ThemeColorPalette/index.tsx
deleted
100644 → 0
View file @
c52cd2c3
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
(
<
Wrapper
>
{
Object
.
entries
(
data
).
map
(([
key
,
value
])
=>
(
<
Swatch
key=
{
key
}
style=
{
{
color
:
readableColor
(
value
),
backgroundColor
:
value
}
}
>
<
div
>
{
key
}
</
div
>
<
div
>
{
value
}
</
div
>
</
Swatch
>
))
}
</
Wrapper
>
)
}
src/components/Toggle/ListToggle.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/components/Toggle/index.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/components/Tooltip/index.tsx
View file @
2ee9b16c
...
...
@@ -21,7 +21,7 @@ export default function Tooltip({ text, ...rest }: TooltipProps) {
return
<
Popover
content=
{
<
TooltipContainer
>
{
text
}
</
TooltipContainer
>
}
{
...
rest
}
/>
}
export
function
TooltipContent
({
content
,
...
rest
}:
TooltipContentProps
)
{
function
TooltipContent
({
content
,
...
rest
}:
TooltipContentProps
)
{
return
<
Popover
content=
{
<
TooltipContainer
>
{
content
}
</
TooltipContainer
>
}
{
...
rest
}
/>
}
...
...
src/components/TransactionConfirmationModal/index.tsx
View file @
2ee9b16c
...
...
@@ -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
,
...
...
src/components/TransactionSettings/index.tsx
View file @
2ee9b16c
...
...
@@ -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
}
...
...
src/components/earn/styled.ts
View file @
2ee9b16c
...
...
@@ -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;
...
...
src/components/swap/AdvancedSwapDetails.tsx
View file @
2ee9b16c
...
...
@@ -11,7 +11,7 @@ import { RowBetween, RowFixed } from '../Row'
import
FormattedPriceImpact
from
'
./FormattedPriceImpact
'
import
SwapRoute
from
'
./SwapRoute
'
export
interface
AdvancedSwapDetailsProps
{
interface
AdvancedSwapDetailsProps
{
trade
?:
V2Trade
<
Currency
,
Currency
,
TradeType
>
|
V3Trade
<
Currency
,
Currency
,
TradeType
>
allowedSlippage
:
Percent
}
...
...
src/components/swap/AdvancedSwapDetailsDropdown.tsx
deleted
100644 → 0
View file @
c52cd2c3
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
(
<
AdvancedDetailsFooter
show=
{
Boolean
(
trade
)
}
>
<
AdvancedSwapDetails
{
...
rest
}
trade=
{
trade
??
lastTrade
??
undefined
}
/>
</
AdvancedDetailsFooter
>
)
}
src/components/swap/FormattedPriceImpact.tsx
View file @
2ee9b16c
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
</
ErrorText
>
)
}
export
function
SmallFormattedPriceImpact
({
priceImpact
}:
{
priceImpact
?:
Percent
})
{
return
(
<
ErrorPill
fontWeight=
{
500
}
fontSize=
{
12
}
severity=
{
warningSeverity
(
priceImpact
)
}
>
{
priceImpact
?
`(${priceImpact.multiply(-1).toFixed(2)}%)`
:
'
-
'
}
</
ErrorPill
>
)
}
src/components/swap/SwapModalHeader.tsx
View file @
2ee9b16c
...
...
@@ -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;
...
...
src/components/swap/styleds.tsx
View file @
2ee9b16c
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;
`
src/connectors/NetworkConnector.ts
View file @
2ee9b16c
...
...
@@ -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
...
...
src/constants/misc.ts
View file @
2ee9b16c
...
...
@@ -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
'
)
src/constants/wallet.ts
View file @
2ee9b16c
...
...
@@ -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
...
...
src/hooks/useContract.ts
View file @
2ee9b16c
...
...
@@ -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
<
Unisocks
>
(
SOCKS_CONTROLLER_ADDRESSES
,
UNISOCKS_ABI
,
false
)
}
export
function
useV3NFTPositionManagerContract
(
withSignerIfPossible
?:
boolean
):
NonfungiblePositionManager
|
null
{
return
useContract
<
NonfungiblePositionManager
>
(
NONFUNGIBLE_POSITION_MANAGER_ADDRESSES
,
...
...
@@ -146,10 +137,6 @@ export function useV3NFTPositionManagerContract(withSignerIfPossible?: boolean):
)
}
export
function
useV3Factory
()
{
return
useContract
<
UniswapV3Factory
>
(
V3_CORE_FACTORY_ADDRESSES
,
V3FactoryABI
)
as
UniswapV3Factory
|
null
}
export
function
useV3Quoter
()
{
return
useContract
<
Quoter
>
(
QUOTER_ADDRESSES
,
QuoterABI
)
}
src/hooks/useERC20Permit.ts
View file @
2ee9b16c
...
...
@@ -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
<
Currency
>
|
null
|
undefined
,
spender
:
string
|
null
|
undefined
,
overridePermitInfo
:
PermitInfo
|
undefined
|
null
...
...
src/hooks/useFeeTierDistribution.ts
View file @
2ee9b16c
...
...
@@ -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
...
...
src/hooks/useLast.ts
View file @
2ee9b16c
...
...
@@ -19,15 +19,3 @@ export default function useLast<T>(
},
[
filterFn
,
value
])
return
last
}
function
isDefined
<
T
>
(
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
<
T
>
(
value
:
T
|
undefined
|
null
):
T
|
null
|
undefined
{
return
useLast
(
value
,
isDefined
)
}
src/hooks/useSocksBalance.ts
View file @
2ee9b16c
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
])
}
src/hooks/useSwapCallback.ts
View file @
2ee9b16c
...
...
@@ -19,7 +19,7 @@ import useTransactionDeadline from './useTransactionDeadline'
import
useENS
from
'
./useENS
'
import
{
Version
}
from
'
./useToggledVersion
'
e
xport
e
num
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
...
...
src/hooks/useTickToPrice.ts
deleted
100644 → 0
View file @
c52cd2c3
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
<
Token
,
Token
>
|
undefined
{
if
(
!
baseToken
||
!
quoteToken
||
!
tick
)
{
return
undefined
}
return
tickToPrice
(
baseToken
,
quoteToken
,
tick
)
}
src/i18n.tsx
View file @
2ee9b16c
...
...
@@ -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
)
...
...
src/pages/AddLiquidity/PoolPriceBar.tsx
deleted
100644 → 0
View file @
c52cd2c3
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
<
Currency
,
Currency
>
})
{
const
theme
=
useContext
(
ThemeContext
)
return
(
<
AutoColumn
gap=
"md"
>
<
AutoRow
justify=
"space-around"
gap=
"4px"
>
<
AutoColumn
justify=
"center"
>
<
TYPE
.
black
>
{
price
?.
toSignificant
(
6
)
??
'
-
'
}
</
TYPE
.
black
>
<
Text
fontWeight=
{
500
}
fontSize=
{
14
}
color=
{
theme
.
text2
}
pt=
{
1
}
>
{
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
per
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
}
</
Text
>
</
AutoColumn
>
<
AutoColumn
justify=
"center"
>
<
TYPE
.
black
>
{
price
?.
invert
()?.
toSignificant
(
6
)
??
'
-
'
}
</
TYPE
.
black
>
<
Text
fontWeight=
{
500
}
fontSize=
{
14
}
color=
{
theme
.
text2
}
pt=
{
1
}
>
{
currencies
[
Field
.
CURRENCY_A
]?.
symbol
}
per
{
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
</
Text
>
</
AutoColumn
>
<
AutoColumn
justify=
"center"
>
<
TYPE
.
black
>
{
noLiquidity
&&
price
?
'
100
'
:
(
poolTokenPercentage
?.
lessThan
(
ONE_BIPS
)
?
'
<0.01
'
:
poolTokenPercentage
?.
toFixed
(
2
))
??
'
0
'
}
%
</
TYPE
.
black
>
<
Text
fontWeight=
{
500
}
fontSize=
{
14
}
color=
{
theme
.
text2
}
pt=
{
1
}
>
Share of Pool
</
Text
>
</
AutoColumn
>
</
AutoRow
>
</
AutoColumn
>
)
}
src/pages/AddLiquidity/Review.tsx
View file @
2ee9b16c
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({
</
Wrapper
>
)
}
export
default
Review
src/pages/AddLiquidity/index.tsx
View file @
2ee9b16c
...
...
@@ -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
'
...
...
src/pages/AddLiquidity/styled.tsx
View file @
2ee9b16c
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;
...
...
src/pages/Pool/PositionPage.tsx
View file @
2ee9b16c
...
...
@@ -82,13 +82,6 @@ const Label = styled(({ end, ...props }) => <TYPE.label {...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;
...
...
src/pages/RemoveLiquidity/V3.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/pages/Swap/index.tsx
View file @
2ee9b16c
...
...
@@ -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) {
</
Row
>
)
}
<
BottomGrouping
>
<
div
>
{
swapIsUnsupported
?
(
<
ButtonPrimary
disabled=
{
true
}
>
<
TYPE
.
main
mb=
"4px"
>
...
...
@@ -655,7 +655,7 @@ export default function Swap({ history }: RouteComponentProps) {
</
ButtonError
>
)
}
{
isExpertMode
&&
swapErrorMessage
?
<
SwapCallbackError
error=
{
swapErrorMessage
}
/>
:
null
}
</
BottomGrouping
>
</
div
>
</
AutoColumn
>
</
Wrapper
>
</
AppBody
>
...
...
src/pages/styled.tsx
deleted
100644 → 0
View file @
c52cd2c3
import
styled
from
'
styled-components/macro
'
export
const
StandardPageWrapper
=
styled
.
div
`
padding-top: 160px;
width: 100%;
`
src/state/application/hooks.ts
View file @
2ee9b16c
...
...
@@ -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
)
}
...
...
src/state/burn/reducer.ts
View file @
2ee9b16c
import
{
createReducer
}
from
'
@reduxjs/toolkit
'
import
{
Field
,
typeInput
}
from
'
./actions
'
export
interface
BurnState
{
interface
BurnState
{
readonly
independentField
:
Field
readonly
typedValue
:
string
}
...
...
src/state/burn/v3/reducer.ts
View file @
2ee9b16c
import
{
createReducer
}
from
'
@reduxjs/toolkit
'
import
{
selectPercent
}
from
'
./actions
'
export
interface
BurnV3State
{
interface
BurnV3State
{
readonly
percent
:
number
}
...
...
src/state/lists/actions.ts
View file @
2ee9b16c
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<string>('lists/disableList')
// versioning
export
const
acceptListUpdate
=
createAction
<
string
>
(
'
lists/acceptListUpdate
'
)
export
const
rejectVersionUpdate
=
createAction
<
Version
>
(
'
lists/rejectVersionUpdate
'
)
src/state/lists/hooks.ts
View file @
2ee9b16c
...
...
@@ -15,7 +15,7 @@ export type TokenAddressMap = Readonly<{
const
listCache
:
WeakMap
<
TokenList
,
TokenAddressMap
>
|
null
=
typeof
WeakMap
!==
'
undefined
'
?
new
WeakMap
<
TokenList
,
TokenAddressMap
>
()
:
null
export
function
listToTokenMap
(
list
:
TokenList
):
TokenAddressMap
{
function
listToTokenMap
(
list
:
TokenList
):
TokenAddressMap
{
const
result
=
listCache
?.
get
(
list
)
if
(
result
)
return
result
...
...
src/state/lists/wrappedTokenInfo.ts
View file @
2ee9b16c
...
...
@@ -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
}
/**
...
...
src/state/mint/v3/reducer.ts
View file @
2ee9b16c
...
...
@@ -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
:
''
,
...
...
src/state/multicall/hooks.ts
View file @
2ee9b16c
...
...
@@ -15,7 +15,7 @@ export interface Result extends ReadonlyArray<any> {
type
MethodArg
=
string
|
number
|
BigNumber
type
MethodArgs
=
Array
<
MethodArg
|
MethodArg
[]
>
export
type
OptionalMethodInputs
=
Array
<
MethodArg
|
MethodArg
[]
|
undefined
>
|
undefined
type
OptionalMethodInputs
=
Array
<
MethodArg
|
MethodArg
[]
|
undefined
>
|
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
...
...
src/state/stake/hooks.ts
View file @
2ee9b16c
...
...
@@ -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
<
Token
>
):
{
parsedAmount
?:
CurrencyAmount
<
Token
>
error
?:
string
}
{
const
{
account
}
=
useActiveWeb3React
()
const
parsedInput
:
CurrencyAmount
<
Token
>
|
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
,
}
}
src/state/user/actions.ts
View file @
2ee9b16c
...
...
@@ -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
<
void
>
(
'
app/toggleURLWarning
'
)
src/state/user/hooks.tsx
View file @
2ee9b16c
...
...
@@ -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
...
...
src/state/user/reducer.ts
View file @
2ee9b16c
...
...
@@ -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
})
)
src/theme/components.tsx
View file @
2ee9b16c
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
:
16
px
;
width
:
18
px
;
margin
-
left
:
10
px
;
...
...
@@ -251,7 +220,7 @@ const rotate = keyframes`
}
`
export
const Spinner = styled.img`
const Spinner = styled.img`
animation
:
2
s
$
{
rotate
}
linear
infinite
;
width
:
16
px
;
height
:
16
px
;
...
...
@@ -291,10 +260,3 @@ export const SmallOnly = styled.span`
display: block;
`
};
`
export const ExtraSmallOnly = styled.span`
display
:
none
;
$
{({
theme
})
=>
theme
.
mediaWidth
.
upToExtraSmall
`
display: block;
`
};
`
src/theme/index.tsx
View file @
2ee9b16c
...
...
@@ -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
),
...
...
src/theme/styled.d.ts
View file @
2ee9b16c
...
...
@@ -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
...
...
src/utils/index.ts
View file @
2ee9b16c
...
...
@@ -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
}
...
...
src/utils/retry.ts
View file @
2ee9b16c
...
...
@@ -9,7 +9,7 @@ function waitRandom(min: number, max: number): Promise<void> {
/**
* 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
'
)
...
...
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