mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix warning code climate (similar blocks)
This commit is contained in:
parent
ba094beefb
commit
9cb65c8d51
@ -32,15 +32,23 @@ export default function Actions({
|
|||||||
await connect()
|
await connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleAction(action: string) {
|
||||||
|
router.push(
|
||||||
|
`${router.pathname}/?step=${
|
||||||
|
parseInt(router.query.step) + (action === 'next' ? +1 : -1)
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function handleNext(e: FormEvent) {
|
function handleNext(e: FormEvent) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
router.push(`${router.pathname}/?step=${parseInt(router.query.step) + 1}`)
|
handleAction('next')
|
||||||
scrollToRef.current.scrollIntoView()
|
scrollToRef.current.scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlePrevious(e: FormEvent) {
|
function handlePrevious(e: FormEvent) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
router.push(`${router.pathname}/?step=${parseInt(router.query.step) - 1}`)
|
handleAction('prev')
|
||||||
scrollToRef.current.scrollIntoView()
|
scrollToRef.current.scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user