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
7125562c
Unverified
Commit
7125562c
authored
Oct 04, 2022
by
aballerr
Committed by
GitHub
Oct 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fixing issue with decimal in price range (#4784)
* fixing issue with decimal in price range
parent
1361f996
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
PriceRange.tsx
src/nft/components/collection/PriceRange.tsx
+2
-3
Input.tsx
src/nft/components/layout/Input.tsx
+4
-0
useCollectionFilters.ts
src/nft/hooks/useCollectionFilters.ts
+4
-4
No files found.
src/nft/components/collection/PriceRange.tsx
View file @
7125562c
...
@@ -2,7 +2,6 @@ import { Row } from 'nft/components/Flex'
...
@@ -2,7 +2,6 @@ import { Row } from 'nft/components/Flex'
import
{
NumericInput
}
from
'
nft/components/layout/Input
'
import
{
NumericInput
}
from
'
nft/components/layout/Input
'
import
{
useIsMobile
}
from
'
nft/hooks
'
import
{
useIsMobile
}
from
'
nft/hooks
'
import
{
useCollectionFilters
}
from
'
nft/hooks/useCollectionFilters
'
import
{
useCollectionFilters
}
from
'
nft/hooks/useCollectionFilters
'
import
{
isNumber
}
from
'
nft/utils/numbers
'
import
{
scrollToTop
}
from
'
nft/utils/scrollToTop
'
import
{
scrollToTop
}
from
'
nft/utils/scrollToTop
'
import
{
useEffect
,
useState
}
from
'
react
'
import
{
useEffect
,
useState
}
from
'
react
'
import
{
FocusEventHandler
,
FormEvent
}
from
'
react
'
import
{
FocusEventHandler
,
FormEvent
}
from
'
react
'
...
@@ -50,7 +49,7 @@ export const PriceRange = () => {
...
@@ -50,7 +49,7 @@ export const PriceRange = () => {
defaultValue=
{
minPrice
}
defaultValue=
{
minPrice
}
onChange=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
onChange=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
scrollToTop
()
scrollToTop
()
setMinPrice
(
isNumber
(
v
.
currentTarget
.
value
)
?
parseFloat
(
v
.
currentTarget
.
value
)
:
''
)
setMinPrice
(
v
.
currentTarget
.
value
)
}
}
}
}
onFocus=
{
handleFocus
}
onFocus=
{
handleFocus
}
value=
{
minPrice
}
value=
{
minPrice
}
...
@@ -74,7 +73,7 @@ export const PriceRange = () => {
...
@@ -74,7 +73,7 @@ export const PriceRange = () => {
value=
{
maxPrice
}
value=
{
maxPrice
}
onChange=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
onChange=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
scrollToTop
()
scrollToTop
()
setMaxPrice
(
isNumber
(
v
.
currentTarget
.
value
)
?
parseFloat
(
v
.
currentTarget
.
value
)
:
''
)
setMaxPrice
(
v
.
currentTarget
.
value
)
}
}
}
}
onFocus=
{
handleFocus
}
onFocus=
{
handleFocus
}
onBlur=
{
handleBlur
}
onBlur=
{
handleBlur
}
...
...
src/nft/components/layout/Input.tsx
View file @
7125562c
...
@@ -29,6 +29,10 @@ export const NumericInput = forwardRef<HTMLInputElement, BoxProps>((props, ref)
...
@@ -29,6 +29,10 @@ export const NumericInput = forwardRef<HTMLInputElement, BoxProps>((props, ref)
autoComplete=
"off"
autoComplete=
"off"
type=
"text"
type=
"text"
onInput=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
onInput=
{
(
v
:
FormEvent
<
HTMLInputElement
>
)
=>
{
if
(
v
.
currentTarget
.
value
===
'
.
'
)
{
v
.
currentTarget
.
value
=
'
0.
'
}
v
.
currentTarget
.
value
=
v
.
currentTarget
.
value
=
!!
v
.
currentTarget
.
value
&&
isNumber
(
v
.
currentTarget
.
value
)
&&
parseFloat
(
v
.
currentTarget
.
value
)
>=
0
!!
v
.
currentTarget
.
value
&&
isNumber
(
v
.
currentTarget
.
value
)
&&
parseFloat
(
v
.
currentTarget
.
value
)
>=
0
?
v
.
currentTarget
.
value
?
v
.
currentTarget
.
value
...
...
src/nft/hooks/useCollectionFilters.ts
View file @
7125562c
...
@@ -25,8 +25,8 @@ export type Trait = {
...
@@ -25,8 +25,8 @@ export type Trait = {
interface
State
{
interface
State
{
traits
:
Trait
[]
traits
:
Trait
[]
markets
:
string
[]
markets
:
string
[]
minPrice
:
number
|
''
minPrice
:
string
maxPrice
:
number
|
''
maxPrice
:
string
minRarity
:
number
|
''
minRarity
:
number
|
''
maxRarity
:
number
|
''
maxRarity
:
number
|
''
marketCount
:
Record
<
string
,
number
>
marketCount
:
Record
<
string
,
number
>
...
@@ -43,8 +43,8 @@ type Actions = {
...
@@ -43,8 +43,8 @@ type Actions = {
addTrait
:
(
trait
:
Trait
)
=>
void
addTrait
:
(
trait
:
Trait
)
=>
void
removeTrait
:
(
trait
:
Trait
)
=>
void
removeTrait
:
(
trait
:
Trait
)
=>
void
reset
:
()
=>
void
reset
:
()
=>
void
setMinPrice
:
(
price
:
number
|
''
)
=>
void
setMinPrice
:
(
price
:
string
)
=>
void
setMaxPrice
:
(
price
:
number
|
''
)
=>
void
setMaxPrice
:
(
price
:
string
)
=>
void
setMinRarity
:
(
range
:
number
|
''
)
=>
void
setMinRarity
:
(
range
:
number
|
''
)
=>
void
setMaxRarity
:
(
range
:
number
|
''
)
=>
void
setMaxRarity
:
(
range
:
number
|
''
)
=>
void
setBuyNow
:
(
bool
:
boolean
)
=>
void
setBuyNow
:
(
bool
:
boolean
)
=>
void
...
...
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