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
802d5623
Unverified
Commit
802d5623
authored
Oct 31, 2023
by
Jack Short
Committed by
GitHub
Oct 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: updating currency search panel for number formatting (#7407)
parent
9536df2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
index.test.tsx
src/components/SearchModal/CurrencyList/index.test.tsx
+1
-1
index.tsx
src/components/SearchModal/CurrencyList/index.tsx
+11
-1
No files found.
src/components/SearchModal/CurrencyList/index.test.tsx
View file @
802d5623
...
@@ -96,5 +96,5 @@ it('renders currency rows correctly with balances', () => {
...
@@ -96,5 +96,5 @@ it('renders currency rows correctly with balances', () => {
expect
(
screen
.
getByText
(
'
Wrapped BTC
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
Wrapped BTC
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
DAI
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
DAI
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
USDC
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
USDC
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
2
'
)).
toBeInTheDocument
()
expect
(
screen
.
getByText
(
'
2
.00
'
)).
toBeInTheDocument
()
})
})
src/components/SearchModal/CurrencyList/index.tsx
View file @
802d5623
...
@@ -14,6 +14,7 @@ import { FixedSizeList } from 'react-window'
...
@@ -14,6 +14,7 @@ import { FixedSizeList } from 'react-window'
import
{
Text
}
from
'
rebass
'
import
{
Text
}
from
'
rebass
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
{
ThemedText
}
from
'
theme/components
'
import
{
ThemedText
}
from
'
theme/components
'
import
{
NumberType
,
useFormatter
}
from
'
utils/formatNumbers
'
import
{
useIsUserAddedToken
}
from
'
../../../hooks/Tokens
'
import
{
useIsUserAddedToken
}
from
'
../../../hooks/Tokens
'
import
{
WrappedTokenInfo
}
from
'
../../../state/lists/wrappedTokenInfo
'
import
{
WrappedTokenInfo
}
from
'
../../../state/lists/wrappedTokenInfo
'
...
@@ -67,7 +68,16 @@ const WarningContainer = styled.div`
...
@@ -67,7 +68,16 @@ const WarningContainer = styled.div`
`
`
function
Balance
({
balance
}:
{
balance
:
CurrencyAmount
<
Currency
>
})
{
function
Balance
({
balance
}:
{
balance
:
CurrencyAmount
<
Currency
>
})
{
return
<
StyledBalanceText
title=
{
balance
.
toExact
()
}
>
{
balance
.
toSignificant
(
4
)
}
</
StyledBalanceText
>
const
{
formatNumberOrString
}
=
useFormatter
()
return
(
<
StyledBalanceText
title=
{
balance
.
toExact
()
}
>
{
formatNumberOrString
({
input
:
balance
.
toExact
(),
type
:
NumberType
.
TokenNonTx
,
})
}
</
StyledBalanceText
>
)
}
}
const
TagContainer
=
styled
.
div
`
const
TagContainer
=
styled
.
div
`
...
...
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