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
241043b6
Unverified
Commit
241043b6
authored
Sep 23, 2022
by
lynn
Committed by
GitHub
Sep 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove number from name in balances (#4711)
remove number
parent
e97e1172
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
BalanceSummary.tsx
src/components/Tokens/TokenDetails/BalanceSummary.tsx
+7
-7
FooterBalanceSummary.tsx
src/components/Tokens/TokenDetails/FooterBalanceSummary.tsx
+8
-8
index.tsx
src/pages/TokenDetails/index.tsx
+7
-7
No files found.
src/components/Tokens/TokenDetails/BalanceSummary.tsx
View file @
241043b6
...
@@ -47,17 +47,17 @@ const TotalBalanceItem = styled.div`
...
@@ -47,17 +47,17 @@ const TotalBalanceItem = styled.div`
export
default
function
BalanceSummary
({
export
default
function
BalanceSummary
({
address
,
address
,
balance
Number
,
balance
,
balanceUsd
Number
,
balanceUsd
,
}:
{
}:
{
address
:
string
address
:
string
balance
Number
?:
number
balance
?:
number
balanceUsd
Number
?:
number
balanceUsd
?:
number
})
{
})
{
const
token
=
useToken
(
address
)
const
token
=
useToken
(
address
)
const
{
loading
,
error
}
=
useNetworkTokenBalances
({
address
})
const
{
loading
,
error
}
=
useNetworkTokenBalances
({
address
})
if
(
loading
||
(
!
error
&&
!
balance
Number
&&
!
balanceUsdNumber
))
return
null
if
(
loading
||
(
!
error
&&
!
balance
&&
!
balanceUsd
))
return
null
return
(
return
(
<
BalancesCard
>
<
BalancesCard
>
{
error
?
(
{
error
?
(
...
@@ -72,8 +72,8 @@ export default function BalanceSummary({
...
@@ -72,8 +72,8 @@ export default function BalanceSummary({
<
TotalBalanceSection
>
<
TotalBalanceSection
>
Your balance
Your balance
<
TotalBalance
>
<
TotalBalance
>
<
TotalBalanceItem
>
{
`${balance
Number
} ${token?.symbol}`
}
</
TotalBalanceItem
>
<
TotalBalanceItem
>
{
`${balance} ${token?.symbol}`
}
</
TotalBalanceItem
>
<
TotalBalanceItem
>
{
`$${balanceUsd
Number
}`
}
</
TotalBalanceItem
>
<
TotalBalanceItem
>
{
`$${balanceUsd}`
}
</
TotalBalanceItem
>
</
TotalBalance
>
</
TotalBalance
>
</
TotalBalanceSection
>
</
TotalBalanceSection
>
</>
</>
...
...
src/components/Tokens/TokenDetails/FooterBalanceSummary.tsx
View file @
241043b6
...
@@ -132,13 +132,13 @@ const ErrorText = styled.span`
...
@@ -132,13 +132,13 @@ const ErrorText = styled.span`
export
default
function
FooterBalanceSummary
({
export
default
function
FooterBalanceSummary
({
address
,
address
,
networkBalances
,
networkBalances
,
balance
Number
,
balance
,
balanceUsd
Number
,
balanceUsd
,
}:
{
}:
{
address
:
string
address
:
string
networkBalances
:
(
JSX
.
Element
|
null
)[]
|
null
networkBalances
:
(
JSX
.
Element
|
null
)[]
|
null
balance
Number
?:
number
balance
?:
number
balanceUsd
Number
?:
number
balanceUsd
?:
number
})
{
})
{
const
tokenSymbol
=
useToken
(
address
)?.
symbol
const
tokenSymbol
=
useToken
(
address
)?.
symbol
const
[
showMultipleBalances
,
setShowMultipleBalances
]
=
useState
(
false
)
const
[
showMultipleBalances
,
setShowMultipleBalances
]
=
useState
(
false
)
...
@@ -161,15 +161,15 @@ export default function FooterBalanceSummary({
...
@@ -161,15 +161,15 @@ export default function FooterBalanceSummary({
</
ErrorText
>
</
ErrorText
>
</
ErrorState
>
</
ErrorState
>
)
:
(
)
:
(
!!
balance
Number
&&
!!
balance
&&
!!
balanceUsd
Number
&&
(
!!
balanceUsd
&&
(
<
BalanceInfo
>
<
BalanceInfo
>
{
multipleBalances
?
'
Balance on all networks
'
:
`Your balance on ${networkNameIfOneBalance}`
}
{
multipleBalances
?
'
Balance on all networks
'
:
`Your balance on ${networkNameIfOneBalance}`
}
<
BalanceTotal
>
<
BalanceTotal
>
<
BalanceValue
>
<
BalanceValue
>
{
balance
Number
}
{
tokenSymbol
}
{
balance
}
{
tokenSymbol
}
</
BalanceValue
>
</
BalanceValue
>
<
FiatValue
>
{
`$${balanceUsd
Number
}`
}
</
FiatValue
>
<
FiatValue
>
{
`$${balanceUsd}`
}
</
FiatValue
>
</
BalanceTotal
>
</
BalanceTotal
>
{
multipleBalances
&&
(
{
multipleBalances
&&
(
<
ViewAll
onClick=
{
()
=>
setShowMultipleBalances
(
!
showMultipleBalances
)
}
>
<
ViewAll
onClick=
{
()
=>
setShowMultipleBalances
(
!
showMultipleBalances
)
}
>
...
...
src/pages/TokenDetails/index.tsx
View file @
241043b6
...
@@ -117,10 +117,10 @@ export default function TokenDetails() {
...
@@ -117,10 +117,10 @@ export default function TokenDetails() {
const
{
data
:
networkData
}
=
NetworkBalances
(
token
?.
address
)
const
{
data
:
networkData
}
=
NetworkBalances
(
token
?.
address
)
const
{
chainId
:
connectedChainId
,
account
}
=
useWeb3React
()
const
{
chainId
:
connectedChainId
,
account
}
=
useWeb3React
()
const
balance
=
useTokenBalance
(
account
,
token
??
undefined
)
const
balance
Value
=
useTokenBalance
(
account
,
token
??
undefined
)
const
balance
Number
=
balance
?
formatToDecimal
(
balance
,
Math
.
min
(
balanc
e
.
currency
.
decimals
,
6
))
:
undefined
const
balance
=
balanceValue
?
formatToDecimal
(
balanceValue
,
Math
.
min
(
balanceValu
e
.
currency
.
decimals
,
6
))
:
undefined
const
balanceUsd
=
useStablecoinValue
(
balanc
e
)?.
toFixed
(
2
)
const
balanceUsd
Value
=
useStablecoinValue
(
balanceValu
e
)?.
toFixed
(
2
)
const
balanceUsd
Number
=
balanceUsd
?
parseFloat
(
balanceUsd
)
:
undefined
const
balanceUsd
=
balanceUsdValue
?
parseFloat
(
balanceUsdValue
)
:
undefined
const
chainsToList
=
useMemo
(()
=>
{
const
chainsToList
=
useMemo
(()
=>
{
let
chainIds
=
[...
L1_CHAIN_IDS
,
...
L2_CHAIN_IDS
]
let
chainIds
=
[...
L1_CHAIN_IDS
,
...
L2_CHAIN_IDS
]
...
@@ -192,14 +192,14 @@ export default function TokenDetails() {
...
@@ -192,14 +192,14 @@ export default function TokenDetails() {
<
RightPanel
>
<
RightPanel
>
<
Widget
defaultToken=
{
token
??
undefined
}
onReviewSwapClick=
{
onReviewSwap
}
/>
<
Widget
defaultToken=
{
token
??
undefined
}
onReviewSwapClick=
{
onReviewSwap
}
/>
{
tokenWarning
&&
<
TokenSafetyMessage
tokenAddress=
{
token
.
address
}
warning=
{
tokenWarning
}
/>
}
{
tokenWarning
&&
<
TokenSafetyMessage
tokenAddress=
{
token
.
address
}
warning=
{
tokenWarning
}
/>
}
<
BalanceSummary
address=
{
token
.
address
}
balance
Number=
{
balanceNumber
}
balanceUsdNumber=
{
balanceUsdNumber
}
/>
<
BalanceSummary
address=
{
token
.
address
}
balance
=
{
balance
}
balanceUsd=
{
balanceUsd
}
/>
</
RightPanel
>
</
RightPanel
>
<
Footer
>
<
Footer
>
<
FooterBalanceSummary
<
FooterBalanceSummary
address=
{
token
.
address
}
address=
{
token
.
address
}
networkBalances=
{
balancesByNetwork
}
networkBalances=
{
balancesByNetwork
}
balance
Number=
{
balanceNumber
}
balance
=
{
balance
}
balanceUsd
Number=
{
balanceUsdNumber
}
balanceUsd
=
{
balanceUsd
}
/>
/>
</
Footer
>
</
Footer
>
<
TokenSafetyModal
<
TokenSafetyModal
...
...
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