gatsby-theme-q3 4.5.17 → 4.5.19

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.
Files changed (80) hide show
  1. package/.eslintrc.js +12 -12
  2. package/CHANGELOG.md +1208 -1200
  3. package/LICENSE +21 -21
  4. package/__fixtures__/en/titles.json +2 -2
  5. package/__fixtures__/fr/titles.json +2 -2
  6. package/gatsby-browser.js +38 -38
  7. package/gatsby-config.js +62 -62
  8. package/gatsby-node.js +77 -77
  9. package/gatsby-ssr.js +11 -11
  10. package/index.js +1 -1
  11. package/lib/components/AccountPublicGateway.js +2 -3
  12. package/lib/components/AdminLoader.js +2 -3
  13. package/lib/components/AdminPrivateGateway.js +3 -4
  14. package/lib/components/AdminPublicGateway.js +3 -4
  15. package/lib/components/AdminRouter.js +3 -4
  16. package/lib/components/BlogArchiveTemplate.js +2 -3
  17. package/lib/components/BlogTemplate.js +2 -3
  18. package/lib/components/FormBox.js +2 -3
  19. package/lib/components/FormBoxContent.js +2 -3
  20. package/lib/components/FormBoxNotice.js +2 -3
  21. package/lib/components/IsBrowserReady.js +2 -3
  22. package/lib/components/PageWrapper.js +2 -3
  23. package/lib/components/PublicTemplate.js +2 -3
  24. package/lib/components/Redirect.js +2 -3
  25. package/lib/components/RedirectToIndex.js +2 -3
  26. package/lib/components/RichText.js +2 -3
  27. package/lib/components/SearchEngine.js +4 -7
  28. package/lib/components/ShareButton.js +2 -3
  29. package/lib/components/Wrapper.js +2 -3
  30. package/lib/components/__tests__/useSiteMetaData.test.js +44 -44
  31. package/lib/components/__tests__/withAuthenticate.test.js +2 -2
  32. package/lib/components/__tests__/withSuccessOp.test.js +4 -4
  33. package/lib/components/index.js +2 -3
  34. package/lib/components/useSiteMetaData.js +1 -1
  35. package/lib/components/utils.js +2 -3
  36. package/lib/components/withAuthenticate.js +2 -2
  37. package/lib/components/withPublicTemplate.js +2 -3
  38. package/lib/components/withSuccessOp.js +3 -4
  39. package/lib/pages/404.js +2 -3
  40. package/lib/pages/login.js +2 -3
  41. package/lib/pages/password-change.js +2 -3
  42. package/lib/pages/password-reset.js +2 -3
  43. package/lib/pages/reverify.js +2 -3
  44. package/lib/pages/verify.js +2 -3
  45. package/package.json +5 -5
  46. package/src/components/AccountPublicGateway.jsx +18 -18
  47. package/src/components/AdminLoader.jsx +16 -16
  48. package/src/components/AdminPrivateGateway.jsx +37 -37
  49. package/src/components/AdminPublicGateway.jsx +34 -34
  50. package/src/components/AdminRouter.jsx +44 -44
  51. package/src/components/BlogArchiveTemplate.jsx +55 -55
  52. package/src/components/BlogTemplate.jsx +104 -104
  53. package/src/components/FormBox.jsx +22 -22
  54. package/src/components/FormBoxContent.jsx +26 -26
  55. package/src/components/FormBoxNotice.jsx +21 -21
  56. package/src/components/IsBrowserReady.jsx +13 -13
  57. package/src/components/PageWrapper.jsx +20 -20
  58. package/src/components/PublicTemplate.jsx +198 -198
  59. package/src/components/Redirect.jsx +13 -13
  60. package/src/components/RedirectToIndex.jsx +9 -9
  61. package/src/components/RichText.jsx +196 -196
  62. package/src/components/SearchEngine.jsx +124 -124
  63. package/src/components/ShareButton.jsx +80 -80
  64. package/src/components/Wrapper.jsx +14 -14
  65. package/src/components/__tests__/SearchEngine.test.jsx +58 -58
  66. package/src/components/__tests__/useSiteMetaData.test.js +44 -44
  67. package/src/components/__tests__/withAuthenticate.test.jsx +52 -52
  68. package/src/components/__tests__/withSuccessOp.test.jsx +57 -57
  69. package/src/components/index.js +16 -16
  70. package/src/components/useSiteMetaData.js +35 -35
  71. package/src/components/utils.js +23 -23
  72. package/src/components/withAuthenticate.jsx +20 -20
  73. package/src/components/withPublicTemplate.jsx +11 -11
  74. package/src/components/withSuccessOp.jsx +43 -43
  75. package/src/pages/404.jsx +31 -31
  76. package/src/pages/login.jsx +71 -71
  77. package/src/pages/password-change.jsx +72 -72
  78. package/src/pages/password-reset.jsx +47 -47
  79. package/src/pages/reverify.jsx +72 -72
  80. package/src/pages/verify.jsx +70 -70
@@ -1,47 +1,47 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import axios from 'axios';
4
- import { Form, Field } from 'q3-ui-forms/lib/builders';
5
- import FormBox from '../components/FormBox';
6
- import FormBoxContent from '../components/FormBoxContent';
7
- import withSuccessOp from '../components/withSuccessOp';
8
- import withPublicTemplate from '../components/withPublicTemplate';
9
-
10
- const PasswordReset = ({ onSuccess }) => (
11
- <FormBox
12
- renderBottom={
13
- <Form
14
- onSubmit={(body) =>
15
- axios
16
- .post('/password-reset', body)
17
- .then(onSuccess)
18
- }
19
- >
20
- <Field
21
- type="email"
22
- name="email"
23
- xl={12}
24
- lg={12}
25
- md={12}
26
- required
27
- />
28
- </Form>
29
- }
30
- renderTop={
31
- <FormBoxContent
32
- title="passwordReset"
33
- description="passwordReset"
34
- />
35
- }
36
- />
37
- );
38
-
39
- PasswordReset.propTypes = {
40
- onSuccess: PropTypes.func.isRequired,
41
- };
42
-
43
- const PasswordResetWithTemplate = withPublicTemplate(
44
- withSuccessOp(PasswordReset, 'passwordResetNotice'),
45
- );
46
-
47
- export default PasswordResetWithTemplate;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import axios from 'axios';
4
+ import { Form, Field } from 'q3-ui-forms/lib/builders';
5
+ import FormBox from '../components/FormBox';
6
+ import FormBoxContent from '../components/FormBoxContent';
7
+ import withSuccessOp from '../components/withSuccessOp';
8
+ import withPublicTemplate from '../components/withPublicTemplate';
9
+
10
+ const PasswordReset = ({ onSuccess }) => (
11
+ <FormBox
12
+ renderBottom={
13
+ <Form
14
+ onSubmit={(body) =>
15
+ axios
16
+ .post('/password-reset', body)
17
+ .then(onSuccess)
18
+ }
19
+ >
20
+ <Field
21
+ type="email"
22
+ name="email"
23
+ xl={12}
24
+ lg={12}
25
+ md={12}
26
+ required
27
+ />
28
+ </Form>
29
+ }
30
+ renderTop={
31
+ <FormBoxContent
32
+ title="passwordReset"
33
+ description="passwordReset"
34
+ />
35
+ }
36
+ />
37
+ );
38
+
39
+ PasswordReset.propTypes = {
40
+ onSuccess: PropTypes.func.isRequired,
41
+ };
42
+
43
+ const PasswordResetWithTemplate = withPublicTemplate(
44
+ withSuccessOp(PasswordReset, 'passwordResetNotice'),
45
+ );
46
+
47
+ export default PasswordResetWithTemplate;
@@ -1,72 +1,72 @@
1
- import React from 'react';
2
- import { useTranslation } from 'q3-ui-locale';
3
- import PropTypes from 'prop-types';
4
- import { Link } from 'gatsby';
5
- import axios from 'axios';
6
- import { Form, Field } from 'q3-ui-forms/lib/builders';
7
- import Button from '@material-ui/core/Button';
8
- import FormBox from '../components/FormBox';
9
- import FormBoxContent from '../components/FormBoxContent';
10
- import FormBoxNotice from '../components/FormBoxNotice';
11
- import { hasOp, toOp } from '../components/utils';
12
- import withPublicTemplate from '../components/withPublicTemplate';
13
-
14
- const Reverify = ({ location: { search, pathname } }) => {
15
- const { t } = useTranslation();
16
-
17
- if (hasOp(search))
18
- return (
19
- <FormBoxNotice
20
- title="reverified"
21
- description="reverified"
22
- >
23
- <Button
24
- component={Link}
25
- to="/reverify"
26
- variant="contained"
27
- color="secondary"
28
- >
29
- {t('labels:tryAgain')}
30
- </Button>
31
- </FormBoxNotice>
32
- );
33
-
34
- return (
35
- <FormBox
36
- renderBottom={
37
- <Form
38
- onSubmit={(body) =>
39
- axios
40
- .post('/reverify', body)
41
- .then(toOp(pathname))
42
- }
43
- >
44
- <Field
45
- type="email"
46
- name="email"
47
- xl={12}
48
- lg={12}
49
- md={12}
50
- required
51
- />
52
- </Form>
53
- }
54
- renderTop={
55
- <FormBoxContent
56
- title="reverify"
57
- description="reverify"
58
- />
59
- }
60
- />
61
- );
62
- };
63
-
64
- Reverify.propTypes = {
65
- location: PropTypes.shape({
66
- search: PropTypes.string,
67
- pathname: PropTypes.string,
68
- }).isRequired,
69
- };
70
-
71
- const ReverifyWithTemplate = withPublicTemplate(Reverify);
72
- export default ReverifyWithTemplate;
1
+ import React from 'react';
2
+ import { useTranslation } from 'q3-ui-locale';
3
+ import PropTypes from 'prop-types';
4
+ import { Link } from 'gatsby';
5
+ import axios from 'axios';
6
+ import { Form, Field } from 'q3-ui-forms/lib/builders';
7
+ import Button from '@material-ui/core/Button';
8
+ import FormBox from '../components/FormBox';
9
+ import FormBoxContent from '../components/FormBoxContent';
10
+ import FormBoxNotice from '../components/FormBoxNotice';
11
+ import { hasOp, toOp } from '../components/utils';
12
+ import withPublicTemplate from '../components/withPublicTemplate';
13
+
14
+ const Reverify = ({ location: { search, pathname } }) => {
15
+ const { t } = useTranslation();
16
+
17
+ if (hasOp(search))
18
+ return (
19
+ <FormBoxNotice
20
+ title="reverified"
21
+ description="reverified"
22
+ >
23
+ <Button
24
+ component={Link}
25
+ to="/reverify"
26
+ variant="contained"
27
+ color="secondary"
28
+ >
29
+ {t('labels:tryAgain')}
30
+ </Button>
31
+ </FormBoxNotice>
32
+ );
33
+
34
+ return (
35
+ <FormBox
36
+ renderBottom={
37
+ <Form
38
+ onSubmit={(body) =>
39
+ axios
40
+ .post('/reverify', body)
41
+ .then(toOp(pathname))
42
+ }
43
+ >
44
+ <Field
45
+ type="email"
46
+ name="email"
47
+ xl={12}
48
+ lg={12}
49
+ md={12}
50
+ required
51
+ />
52
+ </Form>
53
+ }
54
+ renderTop={
55
+ <FormBoxContent
56
+ title="reverify"
57
+ description="reverify"
58
+ />
59
+ }
60
+ />
61
+ );
62
+ };
63
+
64
+ Reverify.propTypes = {
65
+ location: PropTypes.shape({
66
+ search: PropTypes.string,
67
+ pathname: PropTypes.string,
68
+ }).isRequired,
69
+ };
70
+
71
+ const ReverifyWithTemplate = withPublicTemplate(Reverify);
72
+ export default ReverifyWithTemplate;
@@ -1,70 +1,70 @@
1
- import React from 'react';
2
- import queryString from 'query-string';
3
- import { navigate } from '@reach/router';
4
- import { get } from 'lodash';
5
- import axios from 'axios';
6
- import { NewPasswordFields } from 'q3-ui-forms/lib/presets';
7
- import { Form, Field } from 'q3-ui-forms/lib/builders';
8
- import FormBoxContent from '../components/FormBoxContent';
9
- import FormBox from '../components/FormBox';
10
- import withAuthenticate from '../components/withAuthenticate';
11
- import withPublicTemplate from '../components/withPublicTemplate';
12
-
13
- const Verify = withPublicTemplate(
14
- withAuthenticate(({ authenticate, ...props }) => {
15
- const { verificationCode, id, email } =
16
- queryString.parse(get(props, 'location.search', ''), {
17
- decode: false,
18
- });
19
-
20
- return (
21
- <FormBox
22
- renderBottom={
23
- <Form
24
- onSubmit={(passwords) =>
25
- axios.post('/verify', passwords).then(() => {
26
- if (!email) return navigate('/');
27
- return authenticate({
28
- password: passwords.newPassword,
29
- email,
30
- });
31
- })
32
- }
33
- initialValues={{
34
- id,
35
- verificationCode,
36
- }}
37
- >
38
- {(values) => (
39
- <>
40
- <Field
41
- name="id"
42
- type="string"
43
- required
44
- xl={6}
45
- lg={6}
46
- />
47
- <Field
48
- name="verificationCode"
49
- type="string"
50
- required
51
- xl={6}
52
- lg={6}
53
- />
54
- <NewPasswordFields {...values} />
55
- </>
56
- )}
57
- </Form>
58
- }
59
- renderTop={
60
- <FormBoxContent
61
- title="verify"
62
- description="verify"
63
- />
64
- }
65
- />
66
- );
67
- }),
68
- );
69
-
70
- export default Verify;
1
+ import React from 'react';
2
+ import queryString from 'query-string';
3
+ import { navigate } from '@reach/router';
4
+ import { get } from 'lodash';
5
+ import axios from 'axios';
6
+ import { NewPasswordFields } from 'q3-ui-forms/lib/presets';
7
+ import { Form, Field } from 'q3-ui-forms/lib/builders';
8
+ import FormBoxContent from '../components/FormBoxContent';
9
+ import FormBox from '../components/FormBox';
10
+ import withAuthenticate from '../components/withAuthenticate';
11
+ import withPublicTemplate from '../components/withPublicTemplate';
12
+
13
+ const Verify = withPublicTemplate(
14
+ withAuthenticate(({ authenticate, ...props }) => {
15
+ const { verificationCode, id, email } =
16
+ queryString.parse(get(props, 'location.search', ''), {
17
+ decode: false,
18
+ });
19
+
20
+ return (
21
+ <FormBox
22
+ renderBottom={
23
+ <Form
24
+ onSubmit={(passwords) =>
25
+ axios.post('/verify', passwords).then(() => {
26
+ if (!email) return navigate('/');
27
+ return authenticate({
28
+ password: passwords.newPassword,
29
+ email,
30
+ });
31
+ })
32
+ }
33
+ initialValues={{
34
+ id,
35
+ verificationCode,
36
+ }}
37
+ >
38
+ {(values) => (
39
+ <>
40
+ <Field
41
+ name="id"
42
+ type="string"
43
+ required
44
+ xl={6}
45
+ lg={6}
46
+ />
47
+ <Field
48
+ name="verificationCode"
49
+ type="string"
50
+ required
51
+ xl={6}
52
+ lg={6}
53
+ />
54
+ <NewPasswordFields {...values} />
55
+ </>
56
+ )}
57
+ </Form>
58
+ }
59
+ renderTop={
60
+ <FormBoxContent
61
+ title="verify"
62
+ description="verify"
63
+ />
64
+ }
65
+ />
66
+ );
67
+ }),
68
+ );
69
+
70
+ export default Verify;