inline window.location.href instead of hook
This commit is contained in:
parent
a4139104b5
commit
ec32ab4bb7
|
@ -13,8 +13,6 @@ export function AddFundsModal(props: {
|
||||||
const { open, setOpen } = props
|
const { open, setOpen } = props
|
||||||
|
|
||||||
const user = useUser()
|
const user = useUser()
|
||||||
// in hook so not run in nextjs
|
|
||||||
const [location] = useState(window.location.href)
|
|
||||||
|
|
||||||
const [amountSelected, setAmountSelected] = useState<1000 | 2500 | 10000>(
|
const [amountSelected, setAmountSelected] = useState<1000 | 2500 | 10000>(
|
||||||
2500
|
2500
|
||||||
|
@ -43,7 +41,11 @@ export function AddFundsModal(props: {
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<form
|
<form
|
||||||
action={checkoutURL(user?.id || '', amountSelected, location)}
|
action={checkoutURL(
|
||||||
|
user?.id || '',
|
||||||
|
amountSelected,
|
||||||
|
window.location.href
|
||||||
|
)}
|
||||||
method="POST"
|
method="POST"
|
||||||
>
|
>
|
||||||
<Button type="submit" color="gradient">
|
<Button type="submit" color="gradient">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user