@graphcommerce/magento-store 4.2.2 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/Money.tsx +5 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`a9df81310`](https://github.com/graphcommerce-org/graphcommerce/commit/a9df81310c051876dd82fb2819105dece47cc213), [`f167f9963`](https://github.com/graphcommerce-org/graphcommerce/commit/f167f99630966a7de43717937d43669e66132494)]:
|
|
8
|
+
- @graphcommerce/next-ui@4.8.1
|
|
9
|
+
- @graphcommerce/image@3.1.6
|
|
10
|
+
|
|
11
|
+
## 4.2.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`0363b9671`](https://github.com/graphcommerce-org/graphcommerce/commit/0363b9671db7c2932321d97faf6f1eb385238397), [`3ac90b57c`](https://github.com/graphcommerce-org/graphcommerce/commit/3ac90b57c68b96f9d81771d6664ed9435a28fc1d)]:
|
|
16
|
+
- @graphcommerce/next-ui@4.8.0
|
|
17
|
+
|
|
18
|
+
## 4.2.3
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#1448](https://github.com/graphcommerce-org/graphcommerce/pull/1448) [`c30893857`](https://github.com/graphcommerce-org/graphcommerce/commit/c3089385791291e812a48c2691a39a2325ee0439) Thanks [@timhofman](https://github.com/timhofman)! - correct price formatting when opting for decimal formatting
|
|
23
|
+
|
|
3
24
|
## 4.2.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/Money.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export function Money(props: MoneyProps) {
|
|
|
30
30
|
const { data: config } = useQuery(StoreConfigDocument)
|
|
31
31
|
const locale = config?.storeConfig?.locale
|
|
32
32
|
|
|
33
|
-
const digits =
|
|
33
|
+
const digits = (value ?? 0) % 1 !== 0
|
|
34
34
|
|
|
35
35
|
const numberFormatter = useMemo(() => {
|
|
36
36
|
if (!locale) return undefined
|
|
@@ -38,10 +38,12 @@ export function Money(props: MoneyProps) {
|
|
|
38
38
|
return new Intl.NumberFormat(locale.replace('_', '-'), {
|
|
39
39
|
style: 'currency',
|
|
40
40
|
currency: currency ?? config?.storeConfig?.base_currency_code ?? '',
|
|
41
|
-
...(digits && { minimumFractionDigits: 0 }),
|
|
41
|
+
...(round && !digits && { minimumFractionDigits: 0 }),
|
|
42
|
+
...(round && digits && { minimumFractionDigits: 2 }),
|
|
43
|
+
...(!round && { minimumFractionDigits: 2 }),
|
|
42
44
|
...formatOptions,
|
|
43
45
|
})
|
|
44
|
-
}, [config?.storeConfig?.base_currency_code, currency, digits, formatOptions, locale])
|
|
46
|
+
}, [config?.storeConfig?.base_currency_code, currency, digits, formatOptions, locale, round])
|
|
45
47
|
|
|
46
48
|
if (!numberFormatter || !value) return null
|
|
47
49
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-store",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.2.
|
|
5
|
+
"version": "4.2.5",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@graphcommerce/graphql": "3.1.3",
|
|
23
23
|
"@graphcommerce/graphql-mesh": "4.1.3",
|
|
24
|
-
"@graphcommerce/image": "3.1.
|
|
25
|
-
"@graphcommerce/next-ui": "4.
|
|
24
|
+
"@graphcommerce/image": "3.1.6",
|
|
25
|
+
"@graphcommerce/next-ui": "4.8.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@lingui/react": "^3.13.2",
|