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({
)
}
export
function
TransactionErrorContent
({
message
,
onDismiss
}:
{
message
:
string
;
onDismiss
:
()
=>
void
})
{
export
function
TransactionErrorContent
({
message
,
onDismiss
}:
{
message
:
ReactNode
;
onDismiss
:
()
=>
void
})
{
const
theme
=
useContext
(
ThemeContext
)
return
(
<
Wrapper
>
<
Section
>
<
RowBetween
>
<
Text
fontWeight=
{
500
}
fontSize=
{
20
}
>
Error
<
Trans
>
Error
</
Trans
>
</
Text
>
<
CloseIcon
onClick=
{
onDismiss
}
/>
</
RowBetween
>
...
...
@@ -210,9 +210,9 @@ interface ConfirmationModalProps {
isOpen
:
boolean
onDismiss
:
()
=>
void
hash
:
string
|
undefined
content
:
()
=>
React
.
React
Node
content
:
()
=>
ReactNode
attemptingTxn
:
boolean
pendingText
:
React
.
React
Node
pendingText
:
ReactNode
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
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
...
...
@@ -32,7 +33,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Liquidity Provider Fee
<
Trans
>
Liquidity Provider Fee
</
Trans
>
</
TYPE
.
black
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
...
@@ -43,7 +44,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Route
<
Trans
>
Route
</
Trans
>
</
TYPE
.
black
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
...
@@ -54,7 +55,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Price Impact
<
Trans
>
Price Impact
</
Trans
>
</
TYPE
.
black
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
...
@@ -65,7 +66,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowFixed
>
<
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
>
</
RowFixed
>
<
TYPE
.
black
textAlign=
"right"
fontSize=
{
12
}
color=
{
theme
.
text1
}
>
...
...
@@ -78,7 +79,7 @@ export function AdvancedSwapDetails({ trade, allowedSlippage }: AdvancedSwapDeta
<
RowBetween
>
<
RowFixed
>
<
TYPE
.
black
fontSize=
{
12
}
fontWeight=
{
400
}
color=
{
theme
.
text2
}
>
Slippage tolerance
<
Trans
>
Slippage tolerance
</
Trans
>
</
TYPE
.
black
>
</
RowFixed
>
<
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
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
React
,
{
useCallback
,
useMemo
}
from
'
react
'
import
React
,
{
ReactNode
,
useCallback
,
useMemo
}
from
'
react
'
import
TransactionConfirmationModal
,
{
ConfirmationModalContent
,
TransactionErrorContent
,
...
...
@@ -50,7 +51,7 @@ export default function ConfirmSwapModal({
allowedSlippage
:
Percent
onAcceptChanges
:
()
=>
void
onConfirm
:
()
=>
void
swapErrorMessage
:
string
|
undefined
swapErrorMessage
:
ReactNode
|
undefined
onDismiss
:
()
=>
void
})
{
const
showAcceptChanges
=
useMemo
(
...
...
@@ -90,9 +91,12 @@ export default function ConfirmSwapModal({
},
[
onConfirm
,
showAcceptChanges
,
swapErrorMessage
,
trade
])
// text to show while loading
const
pendingText
=
`Swapping
${
trade
?.
inputAmount
?.
toSignificant
(
6
)}
$
{
trade
?.
inputAmount
?.
currency
?.
symbol
}
for
$
{
trade
?.
outputAmount
?.
toSignificant
(
6
)}
$
{
trade
?.
outputAmount
?.
currency
?.
symbol
}
`
const
pendingText
=
(
<
Trans
>
Swapping
{
trade
?.
inputAmount
?.
toSignificant
(
6
)
}
{
trade
?.
inputAmount
?.
currency
?.
symbol
}
for
{
'
'
}
{
trade
?.
outputAmount
?.
toSignificant
(
6
)
}
{
trade
?.
outputAmount
?.
currency
?.
symbol
}
</
Trans
>
)
const
confirmationContent
=
useCallback
(
()
=>
...
...
@@ -100,7 +104,7 @@ export default function ConfirmSwapModal({
<
TransactionErrorContent
onDismiss=
{
onDismiss
}
message=
{
swapErrorMessage
}
/>
)
:
(
<
ConfirmationModalContent
title=
"Confirm Swap"
title=
{
<
Trans
>
Confirm Swap
</
Trans
>
}
onDismiss=
{
onDismiss
}
topContent=
{
modalHeader
}
bottomContent=
{
modalBottom
}
...
...
src/components/swap/SwapModalFooter.tsx
View file @
f3c2a6ea
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Currency
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Trade
as
V2Trade
}
from
'
@uniswap/v2-sdk
'
import
{
Trade
as
V3Trade
}
from
'
@uniswap/v3-sdk
'
import
React
from
'
react
'
import
React
,
{
ReactNode
}
from
'
react
'
import
{
Text
}
from
'
rebass
'
import
{
ButtonError
}
from
'
../Button
'
import
{
AutoRow
}
from
'
../Row
'
...
...
@@ -15,7 +16,7 @@ export default function SwapModalFooter({
}:
{
trade
:
V2Trade
<
Currency
,
Currency
,
TradeType
>
|
V3Trade
<
Currency
,
Currency
,
TradeType
>
onConfirm
:
()
=>
void
swapErrorMessage
:
string
|
undefined
swapErrorMessage
:
ReactNode
|
undefined
disabledConfirm
:
boolean
})
{
return
(
...
...
@@ -28,7 +29,7 @@ export default function SwapModalFooter({
id=
"confirm-swap-or-send"
>
<
Text
fontSize=
{
20
}
fontWeight=
{
500
}
>
Confirm Swap
<
Trans
>
Confirm Swap
</
Trans
>
</
Text
>
</
ButtonError
>
...
...
src/components/swap/SwapModalHeader.tsx
View file @
f3c2a6ea
...
...
@@ -121,7 +121,7 @@ export default function SwapModalHeader({
</
DarkGreyCard
>
<
RowBetween
style=
{
{
marginTop
:
'
0.25rem
'
,
padding
:
'
0 1rem
'
}
}
>
<
TYPE
.
body
color=
{
theme
.
text2
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
{
'
Price:
'
}
<
Trans
>
Price
</
Trans
>
</
TYPE
.
body
>
<
TradePrice
price=
{
trade
.
executionPrice
}
showInverted=
{
showInverted
}
setShowInverted=
{
setShowInverted
}
/>
</
RowBetween
>
...
...
src/components/swap/styleds.tsx
View file @
f3c2a6ea
import
{
transparentize
}
from
'
polished
'
import
React
from
'
react
'
import
React
,
{
ReactNode
}
from
'
react
'
import
{
Link
}
from
'
react-router-dom
'
import
{
AlertTriangle
}
from
'
react-feather
'
...
...
@@ -165,7 +165,7 @@ const SwapCallbackErrorInnerAlertTriangle = styled.div`
height: 48px;
`
export
function
SwapCallbackError
({
error
}:
{
error
:
string
})
{
export
function
SwapCallbackError
({
error
}:
{
error
:
ReactNode
})
{
return
(
<
SwapCallbackErrorInner
>
<
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