2022-08-03 17:42:22 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { recordEvent } from '@woocommerce/tracks';
|
|
|
|
import { useEffect } from '@wordpress/element';
|
2022-08-11 14:04:14 +00:00
|
|
|
import { Form } from '@woocommerce/components';
|
|
|
|
import { Product } from '@woocommerce/data';
|
2022-08-03 17:42:22 +00:00
|
|
|
|
2022-08-04 13:15:30 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { ProductFormLayout } from './layout/product-form-layout';
|
2022-08-11 14:04:14 +00:00
|
|
|
import { ProductFormActions } from './product-form-actions';
|
2022-08-04 13:15:30 +00:00
|
|
|
import { ProductDetailsSection } from './sections/product-details-section';
|
2022-08-30 13:26:24 +00:00
|
|
|
import { PricingSection } from './sections/pricing-section';
|
2022-09-23 12:54:52 +00:00
|
|
|
import { ProductShippingSection } from './sections/product-shipping-section';
|
2022-08-11 14:04:14 +00:00
|
|
|
import './product-page.scss';
|
2022-08-30 13:26:24 +00:00
|
|
|
import { validate } from './product-validation';
|
2022-09-26 17:44:06 +00:00
|
|
|
import { AttributesSection } from './sections/attributes-section';
|
2022-08-04 13:15:30 +00:00
|
|
|
|
|
|
|
const AddProductPage: React.FC = () => {
|
2022-08-03 17:42:22 +00:00
|
|
|
useEffect( () => {
|
|
|
|
recordEvent( 'view_new_product_management_experience' );
|
|
|
|
}, [] );
|
2022-08-11 14:04:14 +00:00
|
|
|
|
2022-08-03 17:42:22 +00:00
|
|
|
return (
|
|
|
|
<div className="woocommerce-add-product">
|
2022-08-30 13:26:24 +00:00
|
|
|
<Form< Partial< Product > >
|
|
|
|
initialValues={ {} }
|
|
|
|
errors={ {} }
|
|
|
|
validate={ validate }
|
|
|
|
>
|
2022-08-11 14:04:14 +00:00
|
|
|
<ProductFormLayout>
|
|
|
|
<ProductDetailsSection />
|
2022-08-30 13:26:24 +00:00
|
|
|
<PricingSection />
|
2022-09-23 12:54:52 +00:00
|
|
|
<ProductShippingSection />
|
2022-09-26 17:44:06 +00:00
|
|
|
<AttributesSection />
|
2022-08-11 14:04:14 +00:00
|
|
|
<ProductFormActions />
|
|
|
|
</ProductFormLayout>
|
|
|
|
</Form>
|
2022-08-03 17:42:22 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2022-08-04 13:15:30 +00:00
|
|
|
|
|
|
|
export default AddProductPage;
|