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
9831cda2
Unverified
Commit
9831cda2
authored
May 29, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more i18n for errors
parent
62d4bb8b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
hooks.ts
src/state/burn/hooks.ts
+3
-2
hooks.ts
src/state/mint/hooks.ts
+6
-5
hooks.ts
src/state/mint/v3/hooks.ts
+7
-6
hooks.ts
src/state/stake/hooks.ts
+5
-4
No files found.
src/state/burn/hooks.ts
View file @
9831cda2
import
{
t
}
from
'
@lingui/macro
'
import
JSBI
from
'
jsbi
'
import
{
Token
,
Currency
,
Percent
,
CurrencyAmount
}
from
'
@uniswap/sdk-core
'
import
{
Pair
}
from
'
@uniswap/v2-sdk
'
...
...
@@ -123,11 +124,11 @@ export function useDerivedBurnInfo(
let
error
:
string
|
undefined
if
(
!
account
)
{
error
=
'
Connect Wallet
'
error
=
t
`Connect Wallet`
}
if
(
!
parsedAmounts
[
Field
.
LIQUIDITY
]
||
!
parsedAmounts
[
Field
.
CURRENCY_A
]
||
!
parsedAmounts
[
Field
.
CURRENCY_B
])
{
error
=
error
??
'
Enter an amount
'
error
=
error
??
t
`Enter an amount`
}
return
{
pair
,
parsedAmounts
,
error
}
...
...
src/state/mint/hooks.ts
View file @
9831cda2
import
{
t
}
from
'
@lingui/macro
'
import
{
useCallback
,
useMemo
}
from
'
react
'
import
{
useDispatch
,
useSelector
}
from
'
react-redux
'
import
{
AppDispatch
,
AppState
}
from
'
../index
'
...
...
@@ -177,25 +178,25 @@ export function useDerivedMintInfo(
let
error
:
string
|
undefined
if
(
!
account
)
{
error
=
'
Connect Wallet
'
error
=
t
`Connect Wallet`
}
if
(
pairState
===
PairState
.
INVALID
)
{
error
=
error
??
'
Invalid pair
'
error
=
error
??
t
`Invalid pair`
}
if
(
!
parsedAmounts
[
Field
.
CURRENCY_A
]
||
!
parsedAmounts
[
Field
.
CURRENCY_B
])
{
error
=
error
??
'
Enter an amount
'
error
=
error
??
t
`Enter an amount`
}
const
{
[
Field
.
CURRENCY_A
]:
currencyAAmount
,
[
Field
.
CURRENCY_B
]:
currencyBAmount
}
=
parsedAmounts
if
(
currencyAAmount
&&
currencyBalances
?.[
Field
.
CURRENCY_A
]?.
lessThan
(
currencyAAmount
))
{
error
=
'
Insufficient
'
+
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
balance
'
error
=
t
`Insufficient
${
currencies
[
Field
.
CURRENCY_A
]?.
symbol
}
balance
`
}
if (currencyBAmount && currencyBalances?.[Field.CURRENCY_B]?.lessThan(currencyBAmount)) {
error
=
'
Insufficient
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
+
'
balance
'
error =
t`
Insufficient
$
{
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
balance
`
}
return {
...
...
src/state/mint/v3/hooks.ts
View file @
9831cda2
import
{
t
}
from
'
@lingui/macro
'
import
{
BIG_INT_ZERO
}
from
'
../../../constants/misc
'
import
{
getTickToPrice
}
from
'
utils/getTickToPrice
'
import
JSBI
from
'
jsbi
'
...
...
@@ -378,32 +379,32 @@ export function useV3DerivedMintInfo(
let
errorMessage
:
string
|
undefined
if
(
!
account
)
{
errorMessage
=
'
Connect Wallet
'
errorMessage
=
t
`Connect Wallet`
}
if
(
poolState
===
PoolState
.
INVALID
)
{
errorMessage
=
errorMessage
??
'
Invalid pair
'
errorMessage
=
errorMessage
??
t
`Invalid pair`
}
if
(
invalidPrice
)
{
errorMessage
=
errorMessage
??
'
Invalid price input
'
errorMessage
=
errorMessage
??
t
`Invalid price input`
}
if
(
(
!
parsedAmounts
[
Field
.
CURRENCY_A
]
&&
!
depositADisabled
)
||
(
!
parsedAmounts
[
Field
.
CURRENCY_B
]
&&
!
depositBDisabled
)
)
{
errorMessage
=
errorMessage
??
'
Enter an amount
'
errorMessage
=
errorMessage
??
t
`Enter an amount`
}
const
{
[
Field
.
CURRENCY_A
]:
currencyAAmount
,
[
Field
.
CURRENCY_B
]:
currencyBAmount
}
=
parsedAmounts
if
(
currencyAAmount
&&
currencyBalances
?.[
Field
.
CURRENCY_A
]?.
lessThan
(
currencyAAmount
))
{
errorMessage
=
'
Insufficient
'
+
currencies
[
Field
.
CURRENCY_A
]?.
symbol
+
'
balance
'
errorMessage
=
t
`Insufficient
${
currencies
[
Field
.
CURRENCY_A
]?.
symbol
}
balance
`
}
if (currencyBAmount && currencyBalances?.[Field.CURRENCY_B]?.lessThan(currencyBAmount)) {
errorMessage
=
'
Insufficient
'
+
currencies
[
Field
.
CURRENCY_B
]?.
symbol
+
'
balance
'
errorMessage =
t`
Insufficient
$
{
currencies
[
Field
.
CURRENCY_B
]?.
symbol
}
balance
`
}
const invalidPool = poolState === PoolState.INVALID
...
...
src/state/stake/hooks.ts
View file @
9831cda2
import
{
t
}
from
'
@lingui/macro
'
import
{
Token
,
CurrencyAmount
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
Pair
}
from
'
@uniswap/v2-sdk
'
import
JSBI
from
'
jsbi
'
...
...
@@ -261,10 +262,10 @@ export function useDerivedStakeInfo(
let
error
:
string
|
undefined
if
(
!
account
)
{
error
=
'
Connect Wallet
'
error
=
t
`Connect Wallet`
}
if
(
!
parsedAmount
)
{
error
=
error
??
'
Enter an amount
'
error
=
error
??
t
`Enter an amount`
}
return
{
...
...
@@ -290,10 +291,10 @@ export function useDerivedUnstakeInfo(
let
error
:
string
|
undefined
if
(
!
account
)
{
error
=
'
Connect Wallet
'
error
=
t
`Connect Wallet`
}
if
(
!
parsedAmount
)
{
error
=
error
??
'
Enter an amount
'
error
=
error
??
t
`Enter an amount`
}
return
{
...
...
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