@graphcommerce/ecommerce-ui 1.0.23 → 1.1.0

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,18 @@
1
1
  # @graphcommerce/ecommerce-ui
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1544](https://github.com/graphcommerce-org/graphcommerce/pull/1544) [`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b) Thanks [@mikekeehnen](https://github.com/mikekeehnen)! - Fixed hydration errors on account, cart and wishlist
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b), [`c756f42e5`](https://github.com/graphcommerce-org/graphcommerce/commit/c756f42e503761a497e4a5a7a02d02141df231c3)]:
12
+ - @graphcommerce/graphql@3.4.0
13
+ - @graphcommerce/react-hook-form@3.3.0
14
+ - @graphcommerce/next-ui@4.12.0
15
+
3
16
  ## 1.0.23
4
17
 
5
18
  ### Patch Changes
@@ -4,7 +4,7 @@ import { AlertProps } from '@mui/material'
4
4
  import { ApolloErrorAlert } from './ApolloErrorAlert'
5
5
 
6
6
  export type ApolloErrorFullPageProps = {
7
- error?: ApolloError
7
+ error: ApolloError
8
8
  graphqlErrorAlertProps?: Omit<AlertProps, 'severity'>
9
9
  networkErrorAlertProps?: Omit<AlertProps, 'severity'>
10
10
  } & Omit<FullPageMessageProps, 'title' | 'description'>
@@ -18,14 +18,24 @@ export function ApolloErrorFullPage(props: ApolloErrorFullPageProps) {
18
18
  ...fullPageMessageProps
19
19
  } = props
20
20
 
21
- const singleError = error?.graphQLErrors.length === 1
21
+ const errorCount = error?.graphQLErrors?.length ?? +(error?.networkError ? 1 : 0)
22
+
23
+ if (errorCount === 0) return null
24
+
25
+ if (errorCount === 1) {
26
+ return (
27
+ <FullPageMessage
28
+ title={error?.graphQLErrors[0].message ?? error?.networkError?.message}
29
+ {...fullPageMessageProps}
30
+ >
31
+ {children}
32
+ </FullPageMessage>
33
+ )
34
+ }
22
35
 
23
36
  return (
24
- <FullPageMessage
25
- title={singleError ? error?.graphQLErrors[0].message : 'Several errors occured'}
26
- {...fullPageMessageProps}
27
- >
28
- {singleError ? children : <ApolloErrorAlert error={error} />}
37
+ <FullPageMessage title='Several errors occured' {...fullPageMessageProps}>
38
+ <ApolloErrorAlert error={error} />
29
39
  </FullPageMessage>
30
40
  )
31
41
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/ecommerce-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "1.0.23",
5
+ "version": "1.1.0",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,9 +12,9 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/next-ui": "4.11.2",
16
- "@graphcommerce/react-hook-form": "3.2.2",
17
- "@graphcommerce/graphql": "3.3.0"
15
+ "@graphcommerce/next-ui": "4.12.0",
16
+ "@graphcommerce/react-hook-form": "3.3.0",
17
+ "@graphcommerce/graphql": "3.4.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@graphcommerce/eslint-config-pwa": "^4.1.8",