inline window.location.href instead of hook

This commit is contained in:
Sinclair Chen 2022-10-03 09:51:43 -07:00
parent a4139104b5
commit ec32ab4bb7

View File

@ -13,8 +13,6 @@ export function AddFundsModal(props: {
const { open, setOpen } = props
const user = useUser()
// in hook so not run in nextjs
const [location] = useState(window.location.href)
const [amountSelected, setAmountSelected] = useState<1000 | 2500 | 10000>(
2500
@ -43,7 +41,11 @@ export function AddFundsModal(props: {
</Button>
<form
action={checkoutURL(user?.id || '', amountSelected, location)}
action={checkoutURL(
user?.id || '',
amountSelected,
window.location.href
)}
method="POST"
>
<Button type="submit" color="gradient">