Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
base
/
context
/
providers
/
add-to-cart-form
/
form
:
index.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * Internal dependencies */ import { AddToCartFormStateContextProvider } from '../form-state'; import { ValidationContextProvider } from '../../validation'; import FormSubmit from './submit'; /** * Add to cart form provider. * * This wraps the add to cart form and provides an api interface for children via various hooks. * * @param {Object} props Incoming props for the provider. * @param {Object} props.children The children being wrapped. * @param {Object} [props.product] The product for which the form belongs to. * @param {boolean} [props.showFormElements] Should form elements be shown. */ export const AddToCartFormContextProvider = ( { children, product, showFormElements, } ) => { return ( <ValidationContextProvider> <AddToCartFormStateContextProvider product={ product } showFormElements={ showFormElements } > { children } <FormSubmit /> </AddToCartFormStateContextProvider> </ValidationContextProvider> ); };