forked from crowetic/commerce
Remove no longer needed open checkout hook
This commit is contained in:
parent
ddf3a2a8b4
commit
f498a708d3
@ -7,7 +7,6 @@ import { useUI } from '@components/ui/context'
|
|||||||
import useCart from '@lib/bigcommerce/cart/use-cart'
|
import useCart from '@lib/bigcommerce/cart/use-cart'
|
||||||
import usePrice from '@lib/bigcommerce/use-price'
|
import usePrice from '@lib/bigcommerce/use-price'
|
||||||
import CartItem from '../CartItem'
|
import CartItem from '../CartItem'
|
||||||
import useOpenCheckout from '@lib/bigcommerce/cart/use-open-checkout'
|
|
||||||
|
|
||||||
const CartSidebarView: FC = () => {
|
const CartSidebarView: FC = () => {
|
||||||
const { data, isEmpty } = useCart()
|
const { data, isEmpty } = useCart()
|
||||||
@ -23,7 +22,6 @@ const CartSidebarView: FC = () => {
|
|||||||
currencyCode: data.currency.code,
|
currencyCode: data.currency.code,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const openCheckout = useOpenCheckout()
|
|
||||||
const { closeSidebar } = useUI()
|
const { closeSidebar } = useUI()
|
||||||
const handleClose = () => closeSidebar()
|
const handleClose = () => closeSidebar()
|
||||||
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
import useCart from './use-cart'
|
|
||||||
|
|
||||||
export default function useOpenCheckout() {
|
|
||||||
const { data, mutate } = useCart()
|
|
||||||
|
|
||||||
return async function openCheckout() {
|
|
||||||
window.open(data?.redirect_urls.checkout_url)
|
|
||||||
// Get new redirect urls
|
|
||||||
await mutate()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user