2020-03-26 13:31:09 +00:00
|
|
|
/**
|
|
|
|
* @typedef {import('@woocommerce/type-defs/billing').BillingData} BillingData
|
|
|
|
* @typedef {import('@woocommerce/type-defs/contexts').BillingDataContext} BillingDataContext
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { getSetting } from '@woocommerce/settings';
|
|
|
|
|
2020-03-30 14:32:23 +00:00
|
|
|
const checkoutData = getSetting( 'checkoutData', {} );
|
2020-03-26 13:31:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {BillingData}
|
|
|
|
*/
|
|
|
|
export const DEFAULT_BILLING_DATA = {
|
|
|
|
first_name: '',
|
|
|
|
last_name: '',
|
|
|
|
company: '',
|
|
|
|
address_1: '',
|
|
|
|
address_2: '',
|
|
|
|
city: '',
|
|
|
|
state: '',
|
|
|
|
postcode: '',
|
|
|
|
country: '',
|
|
|
|
email: '',
|
|
|
|
phone: '',
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {BillingData}
|
|
|
|
*/
|
|
|
|
export const DEFAULT_STATE = {
|
|
|
|
...DEFAULT_BILLING_DATA,
|
2020-03-30 14:32:23 +00:00
|
|
|
...checkoutData.billing_address,
|
2020-03-26 13:31:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {BillingDataContext}
|
|
|
|
*/
|
|
|
|
export const DEFAULT_BILLING_CONTEXT_DATA = {
|
|
|
|
billingData: DEFAULT_BILLING_DATA,
|
|
|
|
setBillingData: () => null,
|
|
|
|
};
|