@graphcommerce/next-ui 3.1.5 → 3.1.6
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/ApolloError/ApolloErrorFullPage.tsx +10 -3
- package/CHANGELOG.md +11 -0
- package/Form/index.tsx +1 -1
- package/FullPageMessage/index.tsx +20 -16
- package/package.json +3 -3
|
@@ -11,15 +11,22 @@ export type ApolloErrorFullPageProps = {
|
|
|
11
11
|
} & Omit<FullPageMessageProps, 'title' | 'description'>
|
|
12
12
|
|
|
13
13
|
export default function ApolloErrorFullPage(props: ApolloErrorFullPageProps) {
|
|
14
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
error,
|
|
16
|
+
graphqlErrorAlertProps,
|
|
17
|
+
networkErrorAlertProps,
|
|
18
|
+
children,
|
|
19
|
+
...fullPageMessageProps
|
|
20
|
+
} = props
|
|
15
21
|
|
|
16
22
|
const singleError = error?.graphQLErrors.length === 1
|
|
17
23
|
|
|
18
24
|
return (
|
|
19
25
|
<FullPageMessage
|
|
20
26
|
title={singleError ? error?.graphQLErrors[0].message : 'Several errors occured'}
|
|
21
|
-
description={singleError ? undefined : <ApolloErrorAlert error={error} />}
|
|
22
27
|
{...fullPageMessageProps}
|
|
23
|
-
|
|
28
|
+
>
|
|
29
|
+
{singleError ? children : <ApolloErrorAlert error={error} />}
|
|
30
|
+
</FullPageMessage>
|
|
24
31
|
)
|
|
25
32
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.1.6](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.1.5...@graphcommerce/next-ui@3.1.6) (2021-10-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Form component added classes attribute ([269fd46](https://github.com/ho-nl/m2-pwa/commit/269fd4629cedcaab74043604ac21a4557b4e514f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [3.1.4](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.1.3...@graphcommerce/next-ui@3.1.4) (2021-10-06)
|
|
7
18
|
|
|
8
19
|
|
package/Form/index.tsx
CHANGED
|
@@ -46,7 +46,7 @@ export type DivFormProps = BaseFormProps & JSX.IntrinsicElements['div']
|
|
|
46
46
|
|
|
47
47
|
export const FormDiv = React.forwardRef<HTMLDivElement, DivFormProps>((props, ref) => {
|
|
48
48
|
const classes = useStyles(props)
|
|
49
|
-
const { contained, background = 'default', ...formProps } = props
|
|
49
|
+
const { contained, background = 'default', classes: _classes, ...formProps } = props
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { Container, Theme, Typography } from '@material-ui/core'
|
|
2
2
|
import { makeStyles } from '@material-ui/styles'
|
|
3
|
+
import clsx from 'clsx'
|
|
3
4
|
import React from 'react'
|
|
4
|
-
import PageMeta from '../PageMeta'
|
|
5
5
|
import responsiveVal from '../Styles/responsiveVal'
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles(
|
|
8
8
|
(theme: Theme) => ({
|
|
9
9
|
root: {
|
|
10
|
-
marginTop: responsiveVal(50, 250),
|
|
11
10
|
alignItems: 'center',
|
|
11
|
+
marginTop: theme.spacings.md,
|
|
12
|
+
marginBottom: theme.spacings.md,
|
|
13
|
+
},
|
|
14
|
+
rootMargin: {
|
|
15
|
+
marginTop: responsiveVal(50, 250),
|
|
12
16
|
},
|
|
13
17
|
subject: {
|
|
14
18
|
textAlign: 'center',
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
description: {
|
|
18
|
-
marginTop: 8,
|
|
19
|
+
marginTop: theme.spacings.sm,
|
|
19
20
|
},
|
|
20
21
|
innerContainer: {
|
|
21
22
|
display: 'grid',
|
|
@@ -23,6 +24,9 @@ const useStyles = makeStyles(
|
|
|
23
24
|
justifyItems: 'center',
|
|
24
25
|
},
|
|
25
26
|
button: {
|
|
27
|
+
marginTop: theme.spacings.sm,
|
|
28
|
+
},
|
|
29
|
+
altButton: {
|
|
26
30
|
marginTop: 6,
|
|
27
31
|
},
|
|
28
32
|
}),
|
|
@@ -34,34 +38,34 @@ const useStyles = makeStyles(
|
|
|
34
38
|
export type FullPageMessageProps = {
|
|
35
39
|
icon: React.ReactNode
|
|
36
40
|
title: React.ReactNode
|
|
37
|
-
|
|
41
|
+
children?: React.ReactNode
|
|
38
42
|
button?: React.ReactNode
|
|
39
43
|
altButton?: React.ReactNode
|
|
44
|
+
disableMargin?: boolean
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
export default function FullPageMessage(props: FullPageMessageProps) {
|
|
43
|
-
const { icon, title,
|
|
48
|
+
const { icon, title, children, button, altButton, disableMargin = false } = props
|
|
44
49
|
const classes = useStyles()
|
|
45
50
|
|
|
46
51
|
return (
|
|
47
|
-
<div className={classes.root}>
|
|
52
|
+
<div className={clsx(classes.root, disableMargin || classes.rootMargin)}>
|
|
48
53
|
<Container maxWidth='md' className={classes.innerContainer}>
|
|
49
|
-
<PageMeta title='Account' metaDescription='Account Dashboard' metaRobots={['noindex']} />
|
|
50
54
|
{icon}
|
|
51
55
|
|
|
52
56
|
<div className={classes.subject}>
|
|
53
|
-
<Typography
|
|
57
|
+
<Typography variant='h3' gutterBottom>
|
|
54
58
|
{title}
|
|
55
59
|
</Typography>
|
|
56
|
-
{
|
|
57
|
-
<Typography component='
|
|
58
|
-
{
|
|
60
|
+
{children && (
|
|
61
|
+
<Typography component='div' variant='body1'>
|
|
62
|
+
{children}
|
|
59
63
|
</Typography>
|
|
60
64
|
)}
|
|
61
65
|
</div>
|
|
62
66
|
|
|
63
|
-
<div>{button}</div>
|
|
64
|
-
<div className={classes.
|
|
67
|
+
<div className={classes.button}>{button}</div>
|
|
68
|
+
<div className={classes.altButton}>{altButton}</div>
|
|
65
69
|
</Container>
|
|
66
70
|
</div>
|
|
67
71
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apollo/client": "^3.4.16",
|
|
13
13
|
"@graphcommerce/framer-next-pages": "^2.106.6",
|
|
14
|
-
"@graphcommerce/framer-scroller": "^0.2.
|
|
14
|
+
"@graphcommerce/framer-scroller": "^0.2.7",
|
|
15
15
|
"@graphcommerce/framer-sheet": "^2.105.5",
|
|
16
16
|
"@graphcommerce/framer-utils": "^2.103.5",
|
|
17
17
|
"@graphcommerce/graphql": "^2.103.5",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"project": "./tsconfig.json"
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "717bd3c1658e421c247c1f8b210935cdb7780197"
|
|
59
59
|
}
|