@graphcommerce/magento-store 9.0.0-canary.103 → 9.0.0-canary.104

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.104
4
+
3
5
  ## 9.0.0-canary.103
4
6
 
5
7
  ## 9.0.0-canary.91
@@ -485,8 +487,8 @@
485
487
  Needs to be replaced with:
486
488
 
487
489
  ```tsx
488
- import { Trans } from '@lingui/react'
489
490
  import { i18n } from '@lingui/core'
491
+ import { Trans } from '@lingui/react'
490
492
 
491
493
  function MyComponent() {
492
494
  const foo = 'bar'
package/Money.tsx CHANGED
@@ -13,18 +13,19 @@ export type MoneyProps = MoneyFragment & OverridableProps
13
13
 
14
14
  export function Money(props: MoneyProps) {
15
15
  const { currency, value, round = false, formatOptions } = props
16
- const { data: config } = useQuery(StoreConfigDocument)
16
+ const baseCurrencyCode = useQuery(StoreConfigDocument).data?.storeConfig?.base_currency_code
17
17
  const digits = (value ?? 0) % 1 !== 0
18
+ const maximumFractionDigits = round && !digits ? 0 : 2
19
+ const currencyCode = currency ?? baseCurrencyCode ?? ''
18
20
 
19
21
  if (typeof value === 'undefined' || value === null) return null
20
22
 
21
23
  return (
22
24
  <CurrencyFormat
23
- currency={currency ?? config?.storeConfig?.base_currency_code ?? ''}
24
- maximumFractionDigits={round && !digits ? 0 : 2}
25
+ currency={currencyCode}
26
+ maximumFractionDigits={maximumFractionDigits}
25
27
  {...formatOptions}
26
- >
27
- {value}
28
- </CurrencyFormat>
28
+ value={value}
29
+ />
29
30
  )
30
31
  }
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable spaced-comment */
2
- import { extendableComponent, FlagAvatar, NextLink } from '@graphcommerce/next-ui'
2
+ import { FlagAvatar, NextLink, extendableComponent } from '@graphcommerce/next-ui'
3
3
  import type { SxProps, Theme } from '@mui/material'
4
- import { List, ListItemText, Collapse, ListItemAvatar, ListItemButton } from '@mui/material'
4
+ import { Collapse, List, ListItemAvatar, ListItemButton, ListItemText } from '@mui/material'
5
5
  import React from 'react'
6
6
  import { localeToStore, storeToLocale } from '../../localeToStore'
7
7
  import type { StoreSwitcherListQuery } from './StoreSwitcherList.gql'
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.0-canary.103",
5
+ "version": "9.0.0-canary.104",
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.0-canary.103",
16
- "@graphcommerce/graphql": "^9.0.0-canary.103",
17
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.103",
18
- "@graphcommerce/image": "^9.0.0-canary.103",
19
- "@graphcommerce/next-ui": "^9.0.0-canary.103",
20
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.103",
21
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.103",
15
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.104",
16
+ "@graphcommerce/graphql": "^9.0.0-canary.104",
17
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.104",
18
+ "@graphcommerce/image": "^9.0.0-canary.104",
19
+ "@graphcommerce/next-ui": "^9.0.0-canary.104",
20
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.104",
21
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.104",
22
22
  "@lingui/core": "^4.2.1",
23
23
  "@lingui/macro": "^4.2.1",
24
24
  "@lingui/react": "^4.2.1",
@@ -1,4 +1,4 @@
1
- import { setContext, type graphqlConfig as graphqlConfigType } from '@graphcommerce/graphql'
1
+ import { type graphqlConfig as graphqlConfigType, setContext } from '@graphcommerce/graphql'
2
2
  import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
 
4
4
  export const config: PluginConfig = {
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
+
2
3
  /* eslint-disable no-empty-pattern */
3
4
  import type { NormalizedCacheObject } from '@graphcommerce/graphql'
4
5
  import { ApolloClient, InMemoryCache } from '@graphcommerce/graphql'
@@ -1,8 +1,8 @@
1
- import type { ParsedUrlQuery } from 'querystring'
2
1
  import type { ApolloClient, ApolloQueryResult, NormalizedCacheObject } from '@graphcommerce/graphql'
3
2
  import { flushMeasurePerf } from '@graphcommerce/graphql'
4
- import { nonNullable, isTypename, storefrontConfig } from '@graphcommerce/next-ui'
3
+ import { isTypename, nonNullable, storefrontConfig } from '@graphcommerce/next-ui'
5
4
  import type { Redirect } from 'next'
5
+ import type { ParsedUrlQuery } from 'querystring'
6
6
  import type { StoreConfigQuery } from '../StoreConfig.gql'
7
7
  import { defaultLocale } from '../localeToStore'
8
8
  import type { HandleRedirectQuery } from './HandleRedirect.gql'