@graphcommerce/magento-store 9.0.4-canary.8 → 9.1.0-canary.15
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 +18 -0
- package/Money.tsx +4 -1
- package/components/CurrencySymbol/CurrencySymbol.tsx +12 -0
- package/index.ts +1 -0
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 9.1.0-canary.15
|
|
4
|
+
|
|
5
|
+
## 9.0.4-canary.14
|
|
6
|
+
|
|
7
|
+
## 9.0.4-canary.13
|
|
8
|
+
|
|
9
|
+
## 9.0.4-canary.12
|
|
10
|
+
|
|
11
|
+
## 9.0.4-canary.11
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#2485](https://github.com/graphcommerce-org/graphcommerce/pull/2485) [`b0ec078`](https://github.com/graphcommerce-org/graphcommerce/commit/b0ec0784a0b3ca977598ded3777d23bc929072b0) - Added a CurrencySymbol component that renders the current currency symbol ([@paales](https://github.com/paales))
|
|
16
|
+
|
|
17
|
+
## 9.0.4-canary.10
|
|
18
|
+
|
|
19
|
+
## 9.0.4-canary.9
|
|
20
|
+
|
|
3
21
|
## 9.0.4-canary.8
|
|
4
22
|
|
|
5
23
|
## 9.0.4-canary.7
|
package/Money.tsx
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { useQuery } from '@graphcommerce/graphql'
|
|
2
2
|
import type { CurrencyFormatProps } from '@graphcommerce/next-ui'
|
|
3
3
|
import { CurrencyFormat } from '@graphcommerce/next-ui'
|
|
4
|
+
import type { SxProps, Theme } from '@mui/material'
|
|
4
5
|
import type { MoneyFragment } from './Money.gql'
|
|
5
6
|
import { StoreConfigDocument } from './StoreConfig.gql'
|
|
6
7
|
|
|
7
8
|
type OverridableProps = {
|
|
8
9
|
round?: boolean
|
|
9
10
|
formatOptions?: Omit<CurrencyFormatProps, 'currency'>
|
|
11
|
+
sx?: SxProps<Theme>
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export type MoneyProps = MoneyFragment & OverridableProps
|
|
13
15
|
|
|
14
16
|
export function Money(props: MoneyProps) {
|
|
15
|
-
const { currency, value, round = false, formatOptions } = props
|
|
17
|
+
const { currency, value, round = false, formatOptions, sx } = props
|
|
16
18
|
const baseCurrencyCode = useQuery(StoreConfigDocument).data?.storeConfig?.base_currency_code
|
|
17
19
|
const digits = (value ?? 0) % 1 !== 0
|
|
18
20
|
const maximumFractionDigits = round && !digits ? 0 : 2
|
|
@@ -26,6 +28,7 @@ export function Money(props: MoneyProps) {
|
|
|
26
28
|
maximumFractionDigits={maximumFractionDigits}
|
|
27
29
|
{...formatOptions}
|
|
28
30
|
value={value}
|
|
31
|
+
sx={sx}
|
|
29
32
|
/>
|
|
30
33
|
)
|
|
31
34
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@graphcommerce/graphql'
|
|
2
|
+
import {
|
|
3
|
+
CurrencySymbol as CurrencySymbolBase,
|
|
4
|
+
type CurrencySymbolProps,
|
|
5
|
+
} from '@graphcommerce/next-ui'
|
|
6
|
+
import { StoreConfigDocument } from '../../StoreConfig.gql'
|
|
7
|
+
|
|
8
|
+
export function CurrencySymbol(props: CurrencySymbolProps) {
|
|
9
|
+
const baseCurrencyCode = useQuery(StoreConfigDocument).data?.storeConfig?.base_currency_code ?? ''
|
|
10
|
+
|
|
11
|
+
return <CurrencySymbolBase {...props} currency={baseCurrencyCode} />
|
|
12
|
+
}
|
package/index.ts
CHANGED
|
@@ -11,3 +11,4 @@ export * from './components/StoreSwitcherButton/StoreSwitcherButton'
|
|
|
11
11
|
export * from './components/StoreSwitcherList/StoreSwitcherList'
|
|
12
12
|
export * from './components/StoreSwitcherList/StoreSwitcherList.gql'
|
|
13
13
|
export * from './utils/redirectOrNotFound'
|
|
14
|
+
export * from './components/CurrencySymbol/CurrencySymbol'
|
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": "9.0
|
|
5
|
+
"version": "9.1.0-canary.15",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^9.0
|
|
16
|
-
"@graphcommerce/graphql": "^9.0
|
|
17
|
-
"@graphcommerce/graphql-mesh": "^9.0
|
|
18
|
-
"@graphcommerce/image": "^9.0
|
|
19
|
-
"@graphcommerce/next-ui": "^9.0
|
|
20
|
-
"@graphcommerce/prettier-config-pwa": "^9.0
|
|
21
|
-
"@graphcommerce/typescript-config-pwa": "^9.0
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^9.1.0-canary.15",
|
|
16
|
+
"@graphcommerce/graphql": "^9.1.0-canary.15",
|
|
17
|
+
"@graphcommerce/graphql-mesh": "^9.1.0-canary.15",
|
|
18
|
+
"@graphcommerce/image": "^9.1.0-canary.15",
|
|
19
|
+
"@graphcommerce/next-ui": "^9.1.0-canary.15",
|
|
20
|
+
"@graphcommerce/prettier-config-pwa": "^9.1.0-canary.15",
|
|
21
|
+
"@graphcommerce/typescript-config-pwa": "^9.1.0-canary.15",
|
|
22
22
|
"@lingui/core": "^4.2.1",
|
|
23
23
|
"@lingui/macro": "^4.2.1",
|
|
24
24
|
"@lingui/react": "^4.2.1",
|