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
f3c2a6ea
Unverified
Commit
f3c2a6ea
authored
May 30, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more translations in the swap page
parent
54dc5b1f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
21 deletions
+27
-21
index.tsx
src/components/TransactionConfirmationModal/index.tsx
+4
-4
AdvancedSwapDetails.tsx
src/components/swap/AdvancedSwapDetails.tsx
+6
-5
ConfirmSwapModal.tsx
src/components/swap/ConfirmSwapModal.tsx
+10
-6
SwapModalFooter.tsx
src/components/swap/SwapModalFooter.tsx
+4
-3
SwapModalHeader.tsx
src/components/swap/SwapModalHeader.tsx
+1
-1
styleds.tsx
src/components/swap/styleds.tsx
+2
-2
No files found.
src/components/TransactionConfirmationModal/index.tsx
View file @
f3c2a6ea
...
@@ -174,14 +174,14 @@ export function ConfirmationModalContent({
...
@@ -174,14 +174,14 @@ export function ConfirmationModalContent({
)
)
}
}
export
function
TransactionErrorContent
({
message
,
onDismiss
}:
{
message
:
string
;
onDismiss
:
()
=>
void
})
{
export
function
TransactionErrorContent
({
message
,
onDismiss
}:
{
message
:
ReactNode
;
onDismiss
:
()
=>
void
})
{
const
theme
=
useContext
(
ThemeContext
)
const
theme
=
useContext
(
ThemeContext
)
return
(
return
(
<
Wrapper
>
<
Wrapper
>
<
Section
>
<
Section
>
<
RowBetween
>
<
RowBetween
>
<
Text
fontWeight=
{
500
}
fontSize=
{
20
}
>
<
Text
fontWeight=
{
500
}
fontSize=
{
20
}
>
Error
<
Trans
>
Error
</
Trans
>
</
Text
>
</
Text
>
<
CloseIcon
onClick=
{
onDismiss
}
/>
<
CloseIcon
onClick=
{
onDismiss
}
/>
</
RowBetween
>
</
RowBetween
>
...
@@ -210,9 +210,9 @@ interface ConfirmationModalProps {
...
@@ -210,9 +210,9 @@ interface ConfirmationModalProps {
isOpen
:
boolean
isOpen
:
boolean
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
hash
:
string
|
undefined
hash
:
string
|
undefined
content
:
()
=>
React
.
React
Node
content
:
()
=>
ReactNode
attemptingTxn
:
boolean
attemptingTxn
:
boolean
pendingText
:
React
.
React
Node
pendingText
:
ReactNode
currencyToAdd
?:
Currency
|
undefined
currencyToAdd
?:
Currency
|
undefined
}
}
...
...
src/components/swap/AdvancedSwapDetails.tsx
View file @
f3c2a6ea
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Percent
,
Currency
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Percent
,
Currency
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
...
@@ -32,7 +33,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
...
@@ -32,7 +33,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Liquidity Provider Fee
<
Trans
>
Liquidity Provider Fee
</
Trans
>
</
TYPE
.
black
>
</
TYPE
.
black
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
@@ -43,7 +44,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
...
@@ -43,7 +44,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Route
<
Trans
>
Route
</
Trans
>
</
TYPE
.
black
>
</
TYPE
.
black
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
@@ -54,7 +55,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
...
@@ -54,7 +55,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Price Impact
<
Trans
>
Price Impact
</
Trans
>
</
TYPE
.
black
>
</
TYPE
.
black
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
@@ -65,7 +66,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
...
@@ -65,7 +66,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
{
trade
.
tradeType
===
TradeType
.
EXACT_INPUT
?
'
Minimum received
'
:
'
Maximum sent
'
}
{
trade
.
tradeType
===
TradeType
.
EXACT_INPUT
?
<
Trans
>
Minimum received
</
Trans
>
:
<
Trans
>
Maximum sent
</
Trans
>
}
</
TYPE
.
black
>
</
TYPE
.
black
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
@@ -78,7 +79,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
...
@@ -78,7 +79,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowBetween
>
<
RowFixed
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Slippage tolerance
<
Trans
>
Slippage tolerance
</
Trans
>
</
TYPE
.
black
>
</
TYPE
.
black
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
...
src/components/swap/ConfirmSwapModal.tsx
View file @
f3c2a6ea
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Currency
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Currency
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
React
,
{
useCallback
,
useMemo
}
from
'
react
'
import
React
,
{
ReactNode
,
useCallback
,
useMemo
}
from
'
react
'
import
TransactionConfirmationModal
,
{
import
TransactionConfirmationModal
,
{
ConfirmationModalContent
,
ConfirmationModalContent
,
TransactionErrorContent
,
TransactionErrorContent
,
...
@@ -50,7 +51,7 @@ export default function ConfirmSwapModal({
...
@@ -50,7 +51,7 @@ export default function ConfirmSwapModal({
allowedSlippage
:
Percent
allowedSlippage
:
Percent
onAcceptChanges
:
()
=>
void
onAcceptChanges
:
()
=>
void
onConfirm
:
()
=>
void
onConfirm
:
()
=>
void
swapErrorMessage
:
string
|
undefined
swapErrorMessage
:
ReactNode
|
undefined
onDismiss
:
()
=>
void
onDismiss
:
()
=>
void
})
{
})
{
const
showAcceptChanges
=
useMemo
(
const
showAcceptChanges
=
useMemo
(
...
@@ -90,9 +91,12 @@ export default function ConfirmSwapModal({
...
@@ -90,9 +91,12 @@ export default function ConfirmSwapModal({
},
[
onConfirm
,
showAcceptChanges
,
swapErrorMessage
,
trade
])
},
[
onConfirm
,
showAcceptChanges
,
swapErrorMessage
,
trade
])
// text to show while loading
// text to show while loading
const
pendingText
=
`Swapping
${
trade
?.
inputAmount
?.
toSignificant
(
6
)}
$
{
const
pendingText
=
(
trade
?.
inputAmount
?.
currency
?.
symbol
<
Trans
>
}
for
$
{
trade
?.
outputAmount
?.
toSignificant
(
6
)}
$
{
trade
?.
outputAmount
?.
currency
?.
symbol
}
`
Swapping
{
trade
?.
inputAmount
?.
toSignificant
(
6
)
}
{
trade
?.
inputAmount
?.
currency
?.
symbol
}
for
{
'
'
}
{
trade
?.
outputAmount
?.
toSignificant
(
6
)
}
{
trade
?.
outputAmount
?.
currency
?.
symbol
}
</
Trans
>
)
const
confirmationContent
=
useCallback
(
const
confirmationContent
=
useCallback
(
()
=>
()
=>
...
@@ -100,7 +104,7 @@ export default function ConfirmSwapModal({
...
@@ -100,7 +104,7 @@ export default function ConfirmSwapModal({
<
TransactionErrorContent
onDismiss=
{
onDismiss
}
message=
{
swapErrorMessage
}
/>
<
TransactionErrorContent
onDismiss=
{
onDismiss
}
message=
{
swapErrorMessage
}
/>
)
:
(
)
:
(
<
ConfirmationModalContent
<
ConfirmationModalContent
title=
"Confirm Swap"
title=
{
<
Trans
>
Confirm Swap
</
Trans
>
}
onDismiss=
{
onDismiss
}
onDismiss=
{
onDismiss
}
topContent=
{
modalHeader
}
topContent=
{
modalHeader
}
bottomContent=
{
modalBottom
}
bottomContent=
{
modalBottom
}
...
...
src/components/swap/SwapModalFooter.tsx
View file @
f3c2a6ea
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Currency
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Currency
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
React
from
'
react
'
import
React
,
{
ReactNode
}
from
'
react
'
import
{
Text
}
from
'
rebass
'
import
{
Text
}
from
'
rebass
'
import
{
ButtonError
}
from
'
../Button
'
import
{
ButtonError
}
from
'
../Button
'
import
{
AutoRow
}
from
'
../Row
'
import
{
AutoRow
}
from
'
../Row
'
...
@@ -15,7 +16,7 @@ export default function SwapModalFooter({
...
@@ -15,7 +16,7 @@ export default function SwapModalFooter({
}:
{
}:
{
trade
:
V2Trade
<
Currency
,
Currency
,
TradeType
>
|
V3Trade
<
Currency
,
Currency
,
TradeType
>
trade
:
V2Trade
<
Currency
,
Currency
,
TradeType
>
|
V3Trade
<
Currency
,
Currency
,
TradeType
>
onConfirm
:
()
=>
void
onConfirm
:
()
=>
void
swapErrorMessage
:
string
|
undefined
swapErrorMessage
:
ReactNode
|
undefined
disabledConfirm
:
boolean
disabledConfirm
:
boolean
})
{
})
{
return
(
return
(
...
@@ -28,7 +29,7 @@ export default function SwapModalFooter({
...
@@ -28,7 +29,7 @@ export default function SwapModalFooter({
id=
"confirm-swap-or-send"
id=
"confirm-swap-or-send"
>
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
>
Confirm Swap
<
Trans
>
Confirm Swap
</
Trans
>
</
Text
>
</
Text
>
</
ButtonError
>
</
ButtonError
>
...
...
src/components/swap/SwapModalHeader.tsx
View file @
f3c2a6ea
...
@@ -121,7 +121,7 @@ export default function SwapModalHeader({
...
@@ -121,7 +121,7 @@ export default function SwapModalHeader({
</
DarkGreyCard
>
</
DarkGreyCard
>
<
RowBetween
style=
{
{
marginTop
:
'
0.25rem
'
,
padding
:
'
0 1rem
'
}
}
>
<
RowBetween
style=
{
{
marginTop
:
'
0.25rem
'
,
padding
:
'
0 1rem
'
}
}
>
<
TYPE
.
body
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
<
TYPE
.
body
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
{
'
Price:
'
}
<
Trans
>
Price
</
Trans
>
</
TYPE
.
body
>
</
TYPE
.
body
>
<
TradePrice
price=
{
trade
.
executionPrice
}
showInverted=
{
showInverted
}
setShowInverted=
{
setShowInverted
}
/>
<
TradePrice
price=
{
trade
.
executionPrice
}
showInverted=
{
showInverted
}
setShowInverted=
{
setShowInverted
}
/>
</
RowBetween
>
</
RowBetween
>
...
...
src/components/swap/styleds.tsx
View file @
f3c2a6ea
import
{
transparentize
}
from
'
polished
'
import
{
transparentize
}
from
'
polished
'
import
React
from
'
react
'
import
React
,
{
ReactNode
}
from
'
react
'
import
{
Link
}
from
'
react-router-dom
'
import
{
Link
}
from
'
react-router-dom
'
import
{
AlertTriangle
}
from
'
react-feather
'
import
{
AlertTriangle
}
from
'
react-feather
'
...
@@ -165,7 +165,7 @@ const SwapCallbackErrorInnerAlertTriangle = styled.div`
...
@@ -165,7 +165,7 @@ const SwapCallbackErrorInnerAlertTriangle = styled.div`
height: 48px;
height: 48px;
`
`
export
function
SwapCallbackError
({
error
}:
{
error
:
string
})
{
export
function
SwapCallbackError
({
error
}:
{
error
:
ReactNode
})
{
return
(
return
(
<
SwapCallbackErrorInner
>
<
SwapCallbackErrorInner
>
<
SwapCallbackErrorInnerAlertTriangle
>
<
SwapCallbackErrorInnerAlertTriangle
>
...
...
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