1
0
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:
Enzo Vezzaro 2022-04-15 06:59:48 -04:00
parent ba094beefb
commit 9cb65c8d51

View File

@ -32,15 +32,23 @@ export default function Actions({
await connect()
}
function handleAction(action: string) {
router.push(
`${router.pathname}/?step=${
parseInt(router.query.step) + (action === 'next' ? +1 : -1)
}`
)
}
function handleNext(e: FormEvent) {
e.preventDefault()
router.push(`${router.pathname}/?step=${parseInt(router.query.step) + 1}`)
handleAction('next')
scrollToRef.current.scrollIntoView()
}
function handlePrevious(e: FormEvent) {
e.preventDefault()
router.push(`${router.pathname}/?step=${parseInt(router.query.step) - 1}`)
handleAction('prev')
scrollToRef.current.scrollIntoView()
}