Skip to content

Commit ddddaef

Browse files
committed
feat: add optional billing info
1 parent 6b64ece commit ddddaef

7 files changed

Lines changed: 372 additions & 3539 deletions

File tree

components/composite/StepCustomer/BillingAddressFormNew/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const BillingAddressFormNew: React.FC<Props> = ({
2929
const countries = settings?.config?.checkout?.billing_countries
3030
const states = settings?.config?.checkout?.billing_states
3131
const defaultCountry = settings?.config?.checkout?.default_country
32+
const optionalBillingInfo = settings?.config?.checkout?.optional_billing_info
3233

3334
return (
3435
<Wrapper>
@@ -97,10 +98,11 @@ export const BillingAddressFormNew: React.FC<Props> = ({
9798
type="tel"
9899
value={billingAddress?.phone || ""}
99100
/>
100-
{requiresBillingInfo && (
101+
{(requiresBillingInfo || optionalBillingInfo) && (
101102
<AddressInputGroup
102103
fieldName="billing_address_billing_info"
103104
resource="billing_address"
105+
required={!!requiresBillingInfo}
104106
type="text"
105107
value={billingAddress?.billing_info || ""}
106108
/>

package.json

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
"dev": "NODE_OPTIONS='--inspect' next dev",
1111
"build": "next build",
1212
"start": "next start -p $PORT",
13-
"lint": "pnpm biome check @typings components pages",
14-
"lint:fix": "pnpm biome check @typings components pages --write",
13+
"lint": "pnpm biome check components pages",
14+
"lint:fix": "pnpm biome check components pages --write",
1515
"test": "playwright test",
1616
"test:debug": "PWDEBUG=1 playwright test",
1717
"test:ui": "NEXT_PUBLIC_BASE_PATH=http://localhost:3000 playwright test --ui",
1818
"serve": "serve -l tcp://localhost:$PORT/ -n -s out/dist",
1919
"dep:upgrade:major": "pnpm exec npm-check-updates -u",
20-
"dep:upgrade:minor": "pnpm dep:upgrade:major -t minor"
20+
"dep:upgrade:minor": "pnpm dep:upgrade:major -t minor",
21+
"browserslist:update": "pnpm dlx update-browserslist-db@latest"
2122
},
2223
"repository": {
2324
"type": "git",
@@ -73,9 +74,9 @@
7374
],
7475
"dependencies": {
7576
"@commercelayer/js-auth": "^6.7.1",
76-
"@commercelayer/organization-config": "^2.1.0",
77-
"@commercelayer/react-components": "4.19.0",
78-
"@commercelayer/sdk": "^6.32.0",
77+
"@commercelayer/organization-config": "^2.2.0",
78+
"@commercelayer/react-components": "^4.19.0",
79+
"@commercelayer/sdk": "^6.33.0",
7980
"@faker-js/faker": "^9.5.0",
8081
"@headlessui/react": "^2.2.0",
8182
"@next/bundle-analyzer": "^15.1.7",
@@ -99,11 +100,11 @@
99100
"next": "^15.1.7",
100101
"next-build-id": "^3.0.0",
101102
"next-i18next": "^15.4.2",
102-
"postcss": "^8.5.1",
103+
"postcss": "^8.5.3",
103104
"react": "^18.3.1",
104105
"react-dom": "^18.3.1",
105106
"react-gtm-module": "^2.0.11",
106-
"react-i18next": "^15.4.0",
107+
"react-i18next": "^15.4.1",
107108
"react-router-dom": "^6.28.0",
108109
"styled-components": "^6.1.15",
109110
"tailwindcss": "^3.4.14",
@@ -118,22 +119,8 @@
118119
"@semantic-release/github": "^11.0.1",
119120
"@semantic-release/npm": "^12.0.1",
120121
"@semantic-release/release-notes-generator": "^14.0.3",
121-
"@typescript-eslint/eslint-plugin": "^7.18.0",
122-
"@typescript-eslint/parser": "^7.18.0",
123-
"eslint": "^8.57.0",
124-
"eslint-config-next": "^15.1.7",
125-
"eslint-config-prettier": "^9.1.0",
126-
"eslint-config-standard": "^17.1.0",
127-
"eslint-plugin-import": "^2.31.0",
128-
"eslint-plugin-n": "^17.15.1",
129-
"eslint-plugin-node": "^11.1.0",
130-
"eslint-plugin-prettier": "^5.2.3",
131-
"eslint-plugin-promise": "^6.4.0",
132-
"eslint-plugin-react": "^7.37.4",
133-
"eslint-plugin-tailwind": "^0.2.1",
134122
"npm-check-updates": "^17.1.14",
135-
"prettier": "^3.4.2",
136-
"semantic-release": "^24.2.1",
123+
"semantic-release": "^24.2.3",
137124
"serve": "^14.2.4",
138125
"stylelint": "^16.14.1",
139126
"stylelint-config-standard": "^36.0.1"
@@ -162,4 +149,4 @@
162149
"path-to-regexp@>=2.0.0 <3.3.0": "=3.3.0"
163150
}
164151
}
165-
}
152+
}

0 commit comments

Comments
 (0)