gatsby-theme-q3 3.2.1 → 3.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +38 -0
- package/gatsby-browser.js +6 -5
- package/gatsby-config.js +1 -1
- package/lib/components/FormBoxContent.js +2 -1
- package/lib/components/PublicTemplate.js +130 -6
- package/lib/components/withPublicTemplate.js +17 -0
- package/lib/components/withSuccessOp.js +1 -1
- package/lib/pages/login.js +7 -4
- package/lib/pages/password-change.js +4 -3
- package/lib/pages/password-reset.js +4 -3
- package/lib/pages/reverify.js +5 -2
- package/lib/pages/verify.js +5 -3
- package/package.json +3 -3
- package/src/components/FormBoxContent.jsx +1 -1
- package/src/components/PublicTemplate.jsx +134 -5
- package/src/components/withPublicTemplate.jsx +11 -0
- package/src/components/withSuccessOp.jsx +1 -1
- package/src/pages/login.jsx +55 -43
- package/src/pages/password-change.jsx +5 -3
- package/src/pages/password-reset.jsx +5 -3
- package/src/pages/reverify.jsx +4 -2
- package/src/pages/verify.jsx +9 -12
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,44 @@
|
|
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.2.5](https://github.com/3merge/q/compare/v3.2.4...v3.2.5) (2022-02-11)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* subdomain detection in production ([c7d91ca](https://github.com/3merge/q/commit/c7d91ca8a694335fc5fc13888a529755d718ce3c))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
## [3.2.4](https://github.com/3merge/q/compare/v3.2.3...v3.2.4) (2022-02-10)
|
18
|
+
|
19
|
+
|
20
|
+
### Bug Fixes
|
21
|
+
|
22
|
+
* feature photo and margins ([c8cd20a](https://github.com/3merge/q/commit/c8cd20a4f51a5ef0be67a4fbffa25f007641171e))
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
## [3.2.3](https://github.com/3merge/q/compare/v3.2.2...v3.2.3) (2022-02-10)
|
29
|
+
|
30
|
+
**Note:** Version bump only for package gatsby-theme-q3
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
## [3.2.2](https://github.com/3merge/q/compare/v3.2.1...v3.2.2) (2022-02-10)
|
37
|
+
|
38
|
+
**Note:** Version bump only for package gatsby-theme-q3
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
6
44
|
## [3.2.1](https://github.com/3merge/q/compare/v3.2.0...v3.2.1) (2022-02-09)
|
7
45
|
|
8
46
|
|
package/gatsby-browser.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import axios from 'axios';
|
2
|
-
import {
|
2
|
+
import { size } from 'lodash';
|
3
3
|
import { getDomain } from 'q3-admin';
|
4
4
|
import { browser } from 'q3-ui-helpers';
|
5
5
|
|
@@ -22,11 +22,12 @@ export const onClientEntry = async () => {
|
|
22
22
|
|
23
23
|
// set tenant default
|
24
24
|
const { host } = window.location;
|
25
|
-
const
|
25
|
+
const str = String(host);
|
26
|
+
const offset = str.includes('localhost') ? -1 : -2;
|
27
|
+
const parts = str.split('.').slice(0, offset).join('.');
|
26
28
|
|
27
|
-
if (size(parts)
|
28
|
-
axios.defaults.headers['X-Session-Tenant'] =
|
29
|
-
last(parts);
|
29
|
+
if (size(parts))
|
30
|
+
axios.defaults.headers['X-Session-Tenant'] = parts;
|
30
31
|
|
31
32
|
// calls Q3 API
|
32
33
|
await getDomain();
|
package/gatsby-config.js
CHANGED
@@ -23,7 +23,8 @@ const FormBoxContent = ({
|
|
23
23
|
t
|
24
24
|
} = (0, _q3UiLocale.useTranslation)();
|
25
25
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
26
|
-
|
26
|
+
component: "h1",
|
27
|
+
variant: "h2",
|
27
28
|
gutterBottom: true
|
28
29
|
}, t(`titles:${title}`)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
29
30
|
gutterBottom: true
|
@@ -9,7 +9,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _core = require("@material-ui/core");
|
13
|
+
|
14
|
+
var _gatsby = require("gatsby");
|
15
|
+
|
16
|
+
var _q3UiLocale = require("q3-ui-locale");
|
17
|
+
|
18
|
+
var _lodash = require("lodash");
|
13
19
|
|
14
20
|
var _AdminPublicGateway = _interopRequireDefault(require("./AdminPublicGateway"));
|
15
21
|
|
@@ -17,18 +23,136 @@ var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
|
|
17
23
|
|
18
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
25
|
|
26
|
+
const useStyle = (0, _core.makeStyles)(theme => ({
|
27
|
+
logo: {
|
28
|
+
height: 95,
|
29
|
+
width: 180,
|
30
|
+
display: 'block',
|
31
|
+
'& img': {
|
32
|
+
objectFit: 'contain',
|
33
|
+
height: '100%',
|
34
|
+
width: '100%'
|
35
|
+
}
|
36
|
+
},
|
37
|
+
container: {
|
38
|
+
maxWidth: '85vw',
|
39
|
+
width: 850,
|
40
|
+
[theme.breakpoints.down('md')]: {
|
41
|
+
width: '100%'
|
42
|
+
},
|
43
|
+
[theme.breakpoints.down('sm')]: {
|
44
|
+
width: 'auto'
|
45
|
+
}
|
46
|
+
},
|
47
|
+
photo: ({
|
48
|
+
photo
|
49
|
+
}) => ({
|
50
|
+
backgroundColor: theme.palette.secondary.light,
|
51
|
+
backgroundImage: (0, _lodash.isString)(photo) ? `url("${String(photo).replace(/\s/gi, '%20')}")` : undefined,
|
52
|
+
backgroundSize: 'contain',
|
53
|
+
backgroundPosition: 'center',
|
54
|
+
backgroundRepeat: 'no-repeat',
|
55
|
+
width: '100%',
|
56
|
+
height: '100%',
|
57
|
+
backgroundBlendMode: 'multiply',
|
58
|
+
minHeight: '55vh'
|
59
|
+
})
|
60
|
+
}));
|
61
|
+
|
62
|
+
const Copyright = () => {
|
63
|
+
const {
|
64
|
+
brand
|
65
|
+
} = (0, _useSiteMetaData.default)();
|
66
|
+
return brand ? /*#__PURE__*/_react.default.createElement(_core.Box, {
|
67
|
+
display: "inline-block",
|
68
|
+
mx: 1
|
69
|
+
}, "\xA9", new Date().getFullYear(), " ", brand) : null;
|
70
|
+
}; // eslint-disable-next-line
|
71
|
+
|
72
|
+
|
73
|
+
const TextLink = ({
|
74
|
+
href,
|
75
|
+
text
|
76
|
+
}) => {
|
77
|
+
const {
|
78
|
+
t
|
79
|
+
} = (0, _q3UiLocale.useTranslation)('labels');
|
80
|
+
return href ? /*#__PURE__*/_react.default.createElement(_core.Box, {
|
81
|
+
display: "inline-block",
|
82
|
+
mx: 1
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Link, {
|
84
|
+
href: href,
|
85
|
+
target: "_blank"
|
86
|
+
}, t(text))) : null;
|
87
|
+
};
|
88
|
+
|
20
89
|
const PublicTemplate = ({
|
21
90
|
children,
|
22
91
|
...rest
|
23
92
|
}) => {
|
24
93
|
const {
|
25
94
|
brand,
|
26
|
-
|
95
|
+
cancellation,
|
96
|
+
logo,
|
97
|
+
terms,
|
98
|
+
privacy,
|
99
|
+
photo
|
27
100
|
} = (0, _useSiteMetaData.default)();
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
101
|
+
const cls = useStyle({
|
102
|
+
photo
|
103
|
+
});
|
104
|
+
return /*#__PURE__*/_react.default.createElement(_AdminPublicGateway.default, rest, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
105
|
+
alignItems: "center",
|
106
|
+
component: "article",
|
107
|
+
display: "flex",
|
108
|
+
flexDirection: "column",
|
109
|
+
justifyContent: "center",
|
110
|
+
width: "100%"
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
112
|
+
component: "header",
|
113
|
+
mt: "2vh",
|
114
|
+
mb: 1,
|
115
|
+
textAlign: "center"
|
116
|
+
}, /*#__PURE__*/_react.default.createElement(_gatsby.Link, {
|
117
|
+
to: "/",
|
118
|
+
className: cls.logo
|
119
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
120
|
+
alt: brand,
|
121
|
+
src: logo
|
122
|
+
}))), /*#__PURE__*/_react.default.createElement(_core.Paper, {
|
123
|
+
className: cls.container
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
125
|
+
alignItems: "center",
|
126
|
+
container: true,
|
127
|
+
spacing: 1
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Hidden, {
|
129
|
+
smDown: true
|
130
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
131
|
+
item: true,
|
132
|
+
xs: 6
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
134
|
+
className: cls.photo
|
135
|
+
}))), /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
136
|
+
item: true,
|
137
|
+
md: 6,
|
138
|
+
xs: 12
|
139
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
140
|
+
p: 2
|
141
|
+
}, children)))), /*#__PURE__*/_react.default.createElement(_core.Box, {
|
142
|
+
maxWidth: "75vw",
|
143
|
+
component: "footer",
|
144
|
+
mt: 2,
|
145
|
+
textAlign: "center"
|
146
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, /*#__PURE__*/_react.default.createElement(Copyright, null), /*#__PURE__*/_react.default.createElement(TextLink, {
|
147
|
+
href: terms,
|
148
|
+
text: "termsAndConditions"
|
149
|
+
}), /*#__PURE__*/_react.default.createElement(TextLink, {
|
150
|
+
href: privacy,
|
151
|
+
text: "privacyPolicy"
|
152
|
+
}), /*#__PURE__*/_react.default.createElement(TextLink, {
|
153
|
+
href: cancellation,
|
154
|
+
text: "cancellationPolicy"
|
155
|
+
})))));
|
32
156
|
};
|
33
157
|
|
34
158
|
PublicTemplate.defaultProps = {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _PublicTemplate = _interopRequireDefault(require("./PublicTemplate"));
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
const withPublicTemplate = Component => props => /*#__PURE__*/_react.default.createElement(_PublicTemplate.default, props, /*#__PURE__*/_react.default.createElement(Component, props));
|
15
|
+
|
16
|
+
var _default = withPublicTemplate;
|
17
|
+
exports.default = _default;
|
@@ -41,7 +41,7 @@ const withSuccessOp = (Component, msg) => {
|
|
41
41
|
component: _gatsby.Link,
|
42
42
|
to: "/login",
|
43
43
|
variant: "contained",
|
44
|
-
color: "
|
44
|
+
color: "secondary"
|
45
45
|
}, t('labels:login'))) : /*#__PURE__*/_react.default.createElement(Component, _extends({}, props, {
|
46
46
|
onSuccess: (0, _utils.toOp)(pathname)
|
47
47
|
}));
|
package/lib/pages/login.js
CHANGED
@@ -27,9 +27,11 @@ var _FormBox = _interopRequireDefault(require("../components/FormBox"));
|
|
27
27
|
|
28
28
|
var _withAuthenticate = _interopRequireDefault(require("../components/withAuthenticate"));
|
29
29
|
|
30
|
+
var _withPublicTemplate = _interopRequireDefault(require("../components/withPublicTemplate"));
|
31
|
+
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
33
|
|
32
|
-
|
34
|
+
const Login = (0, _withPublicTemplate.default)((0, _withAuthenticate.default)(({
|
33
35
|
authenticate
|
34
36
|
}) => {
|
35
37
|
const {
|
@@ -64,10 +66,11 @@ var _default = (0, _withAuthenticate.default)(({
|
|
64
66
|
to: "/reverify"
|
65
67
|
}, t('labels:reverifyLink')))),
|
66
68
|
renderTop: /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
67
|
-
|
69
|
+
component: "h1",
|
70
|
+
variant: "h2",
|
68
71
|
gutterBottom: true
|
69
72
|
}, t('titles:login'))
|
70
73
|
});
|
71
|
-
});
|
72
|
-
|
74
|
+
}));
|
75
|
+
var _default = Login;
|
73
76
|
exports.default = _default;
|
@@ -25,6 +25,8 @@ var _FormBox = _interopRequireDefault(require("../components/FormBox"));
|
|
25
25
|
|
26
26
|
var _withSuccessOp = _interopRequireDefault(require("../components/withSuccessOp"));
|
27
27
|
|
28
|
+
var _withPublicTemplate = _interopRequireDefault(require("../components/withPublicTemplate"));
|
29
|
+
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
31
|
|
30
32
|
const PasswordChange = ({
|
@@ -65,7 +67,6 @@ PasswordChange.propTypes = {
|
|
65
67
|
search: _propTypes.default.string
|
66
68
|
}).isRequired
|
67
69
|
};
|
68
|
-
|
69
|
-
var _default =
|
70
|
-
|
70
|
+
const PasswordChangeWithTemplate = (0, _withPublicTemplate.default)((0, _withSuccessOp.default)(PasswordChange, 'passwordChangeNotice'));
|
71
|
+
var _default = PasswordChangeWithTemplate;
|
71
72
|
exports.default = _default;
|
@@ -19,6 +19,8 @@ var _FormBoxContent = _interopRequireDefault(require("../components/FormBoxConte
|
|
19
19
|
|
20
20
|
var _withSuccessOp = _interopRequireDefault(require("../components/withSuccessOp"));
|
21
21
|
|
22
|
+
var _withPublicTemplate = _interopRequireDefault(require("../components/withPublicTemplate"));
|
23
|
+
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
23
25
|
|
24
26
|
const PasswordReset = ({
|
@@ -43,7 +45,6 @@ const PasswordReset = ({
|
|
43
45
|
PasswordReset.propTypes = {
|
44
46
|
onSuccess: _propTypes.default.func.isRequired
|
45
47
|
};
|
46
|
-
|
47
|
-
var _default =
|
48
|
-
|
48
|
+
const PasswordResetWithTemplate = (0, _withPublicTemplate.default)((0, _withSuccessOp.default)(PasswordReset, 'passwordResetNotice'));
|
49
|
+
var _default = PasswordResetWithTemplate;
|
49
50
|
exports.default = _default;
|
package/lib/pages/reverify.js
CHANGED
@@ -27,6 +27,8 @@ var _FormBoxNotice = _interopRequireDefault(require("../components/FormBoxNotice
|
|
27
27
|
|
28
28
|
var _utils = require("../components/utils");
|
29
29
|
|
30
|
+
var _withPublicTemplate = _interopRequireDefault(require("../components/withPublicTemplate"));
|
31
|
+
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
33
|
|
32
34
|
const Reverify = ({
|
@@ -45,7 +47,7 @@ const Reverify = ({
|
|
45
47
|
component: _gatsby.Link,
|
46
48
|
to: "/reverify",
|
47
49
|
variant: "contained",
|
48
|
-
color: "
|
50
|
+
color: "secondary"
|
49
51
|
}, t('labels:tryAgain')));
|
50
52
|
return /*#__PURE__*/_react.default.createElement(_FormBox.default, {
|
51
53
|
renderBottom: /*#__PURE__*/_react.default.createElement(_builders.Form, {
|
@@ -71,5 +73,6 @@ Reverify.propTypes = {
|
|
71
73
|
pathname: _propTypes.default.string
|
72
74
|
}).isRequired
|
73
75
|
};
|
74
|
-
|
76
|
+
const ReverifyWithTemplate = (0, _withPublicTemplate.default)(Reverify);
|
77
|
+
var _default = ReverifyWithTemplate;
|
75
78
|
exports.default = _default;
|
package/lib/pages/verify.js
CHANGED
@@ -25,9 +25,11 @@ var _FormBox = _interopRequireDefault(require("../components/FormBox"));
|
|
25
25
|
|
26
26
|
var _withAuthenticate = _interopRequireDefault(require("../components/withAuthenticate"));
|
27
27
|
|
28
|
+
var _withPublicTemplate = _interopRequireDefault(require("../components/withPublicTemplate"));
|
29
|
+
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
31
|
|
30
|
-
|
32
|
+
const Verify = (0, _withPublicTemplate.default)((0, _withAuthenticate.default)(({
|
31
33
|
authenticate,
|
32
34
|
...props
|
33
35
|
}) => {
|
@@ -70,6 +72,6 @@ var _default = (0, _withAuthenticate.default)(({
|
|
70
72
|
description: "verify"
|
71
73
|
})
|
72
74
|
});
|
73
|
-
});
|
74
|
-
|
75
|
+
}));
|
76
|
+
var _default = Verify;
|
75
77
|
exports.default = _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "gatsby-theme-q3",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.5",
|
4
4
|
"main": "index.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"peerDependencies": {
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"gatsby-plugin-robots-txt": "^1.6.14",
|
29
29
|
"gatsby-plugin-sharp": "^4.2.0",
|
30
30
|
"gatsby-plugin-sitemap": "^5.2.0",
|
31
|
-
"gatsby-theme-q3-mui": "^3.2.
|
31
|
+
"gatsby-theme-q3-mui": "^3.2.3",
|
32
32
|
"gatsby-transformer-sharp": "^4.2.0",
|
33
33
|
"lodash": "^4.17.20",
|
34
34
|
"process": "^0.11.10",
|
@@ -42,5 +42,5 @@
|
|
42
42
|
"transform-loader": "^0.2.4",
|
43
43
|
"yarn": "^1.22.17"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "491dbd6d8280a171288f7054f6e29261c530a53c"
|
46
46
|
}
|
@@ -1,17 +1,146 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import PropTypes from 'prop-types';
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Box,
|
5
|
+
Paper,
|
6
|
+
Link,
|
7
|
+
Grid,
|
8
|
+
Hidden,
|
9
|
+
makeStyles,
|
10
|
+
} from '@material-ui/core';
|
11
|
+
import { Link as ReachLink } from 'gatsby';
|
12
|
+
import { useTranslation } from 'q3-ui-locale';
|
13
|
+
import { isString } from 'lodash';
|
4
14
|
import AdminPublicGateway from './AdminPublicGateway';
|
5
15
|
import useSiteMetaData from './useSiteMetaData';
|
6
16
|
|
17
|
+
const useStyle = makeStyles((theme) => ({
|
18
|
+
logo: {
|
19
|
+
height: 95,
|
20
|
+
width: 180,
|
21
|
+
display: 'block',
|
22
|
+
|
23
|
+
'& img': {
|
24
|
+
objectFit: 'contain',
|
25
|
+
height: '100%',
|
26
|
+
width: '100%',
|
27
|
+
},
|
28
|
+
},
|
29
|
+
container: {
|
30
|
+
maxWidth: '85vw',
|
31
|
+
width: 850,
|
32
|
+
|
33
|
+
[theme.breakpoints.down('md')]: {
|
34
|
+
width: '100%',
|
35
|
+
},
|
36
|
+
|
37
|
+
[theme.breakpoints.down('sm')]: {
|
38
|
+
width: 'auto',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
photo: ({ photo }) => ({
|
42
|
+
backgroundColor: theme.palette.secondary.light,
|
43
|
+
backgroundImage: isString(photo)
|
44
|
+
? `url("${String(photo).replace(/\s/gi, '%20')}")`
|
45
|
+
: undefined,
|
46
|
+
backgroundSize: 'contain',
|
47
|
+
backgroundPosition: 'center',
|
48
|
+
backgroundRepeat: 'no-repeat',
|
49
|
+
width: '100%',
|
50
|
+
height: '100%',
|
51
|
+
backgroundBlendMode: 'multiply',
|
52
|
+
minHeight: '55vh',
|
53
|
+
}),
|
54
|
+
}));
|
55
|
+
|
56
|
+
const Copyright = () => {
|
57
|
+
const { brand } = useSiteMetaData();
|
58
|
+
|
59
|
+
return brand ? (
|
60
|
+
<Box display="inline-block" mx={1}>
|
61
|
+
©{new Date().getFullYear()} {brand}
|
62
|
+
</Box>
|
63
|
+
) : null;
|
64
|
+
};
|
65
|
+
|
66
|
+
// eslint-disable-next-line
|
67
|
+
const TextLink = ({ href, text }) => {
|
68
|
+
const { t } = useTranslation('labels');
|
69
|
+
|
70
|
+
return href ? (
|
71
|
+
<Box display="inline-block" mx={1}>
|
72
|
+
<Link href={href} target="_blank">
|
73
|
+
{t(text)}
|
74
|
+
</Link>
|
75
|
+
</Box>
|
76
|
+
) : null;
|
77
|
+
};
|
78
|
+
|
7
79
|
const PublicTemplate = ({ children, ...rest }) => {
|
8
|
-
const {
|
80
|
+
const {
|
81
|
+
brand,
|
82
|
+
cancellation,
|
83
|
+
logo,
|
84
|
+
terms,
|
85
|
+
privacy,
|
86
|
+
photo,
|
87
|
+
} = useSiteMetaData();
|
88
|
+
const cls = useStyle({
|
89
|
+
photo,
|
90
|
+
});
|
9
91
|
|
10
92
|
return (
|
11
93
|
<AdminPublicGateway {...rest}>
|
12
|
-
<
|
13
|
-
|
14
|
-
|
94
|
+
<Box
|
95
|
+
alignItems="center"
|
96
|
+
component="article"
|
97
|
+
display="flex"
|
98
|
+
flexDirection="column"
|
99
|
+
justifyContent="center"
|
100
|
+
width="100%"
|
101
|
+
>
|
102
|
+
<Box
|
103
|
+
component="header"
|
104
|
+
mt="2vh"
|
105
|
+
mb={1}
|
106
|
+
textAlign="center"
|
107
|
+
>
|
108
|
+
<ReachLink to="/" className={cls.logo}>
|
109
|
+
<img alt={brand} src={logo} />
|
110
|
+
</ReachLink>
|
111
|
+
</Box>
|
112
|
+
<Paper className={cls.container}>
|
113
|
+
<Grid alignItems="center" container spacing={1}>
|
114
|
+
<Hidden smDown>
|
115
|
+
<Grid item xs={6}>
|
116
|
+
<Box className={cls.photo} />
|
117
|
+
</Grid>
|
118
|
+
</Hidden>
|
119
|
+
<Grid item md={6} xs={12}>
|
120
|
+
<Box p={2}>{children}</Box>
|
121
|
+
</Grid>
|
122
|
+
</Grid>
|
123
|
+
</Paper>
|
124
|
+
<Box
|
125
|
+
maxWidth="75vw"
|
126
|
+
component="footer"
|
127
|
+
mt={2}
|
128
|
+
textAlign="center"
|
129
|
+
>
|
130
|
+
<small>
|
131
|
+
<Copyright />
|
132
|
+
<TextLink
|
133
|
+
href={terms}
|
134
|
+
text="termsAndConditions"
|
135
|
+
/>
|
136
|
+
<TextLink href={privacy} text="privacyPolicy" />
|
137
|
+
<TextLink
|
138
|
+
href={cancellation}
|
139
|
+
text="cancellationPolicy"
|
140
|
+
/>
|
141
|
+
</small>
|
142
|
+
</Box>
|
143
|
+
</Box>
|
15
144
|
</AdminPublicGateway>
|
16
145
|
);
|
17
146
|
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import PublicTemplate from './PublicTemplate';
|
3
|
+
|
4
|
+
const withPublicTemplate = (Component) => (props) =>
|
5
|
+
(
|
6
|
+
<PublicTemplate {...props}>
|
7
|
+
<Component {...props} />
|
8
|
+
</PublicTemplate>
|
9
|
+
);
|
10
|
+
|
11
|
+
export default withPublicTemplate;
|
package/src/pages/login.jsx
CHANGED
@@ -9,48 +9,60 @@ import Box from '@material-ui/core/Box';
|
|
9
9
|
import { Form, Field } from 'q3-ui-forms/lib/builders';
|
10
10
|
import FormBox from '../components/FormBox';
|
11
11
|
import withAuthenticate from '../components/withAuthenticate';
|
12
|
+
import withPublicTemplate from '../components/withPublicTemplate';
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
const Login = withPublicTemplate(
|
15
|
+
withAuthenticate(({ authenticate }) => {
|
16
|
+
const { t } = useTranslation();
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
18
|
+
return (
|
19
|
+
<FormBox
|
20
|
+
renderBottom={
|
21
|
+
<>
|
22
|
+
<Form onSubmit={authenticate}>
|
23
|
+
<Field
|
24
|
+
name="email"
|
25
|
+
type="email"
|
26
|
+
required
|
27
|
+
xl={12}
|
28
|
+
lg={12}
|
29
|
+
/>
|
30
|
+
<Field
|
31
|
+
required
|
32
|
+
name="password"
|
33
|
+
type="password"
|
34
|
+
xl={12}
|
35
|
+
lg={12}
|
36
|
+
/>
|
37
|
+
</Form>
|
38
|
+
<Box mt={2} mb={1}>
|
39
|
+
<Divider />
|
40
|
+
</Box>
|
41
|
+
<Grid container spacing={1}>
|
42
|
+
<MuiLink
|
43
|
+
component={Link}
|
44
|
+
to="/password-reset"
|
45
|
+
>
|
46
|
+
{t('labels:requestNewPassword')}
|
47
|
+
</MuiLink>
|
48
|
+
<MuiLink component={Link} to="/reverify">
|
49
|
+
{t('labels:reverifyLink')}
|
50
|
+
</MuiLink>
|
51
|
+
</Grid>
|
52
|
+
</>
|
53
|
+
}
|
54
|
+
renderTop={
|
55
|
+
<Typography
|
56
|
+
component="h1"
|
57
|
+
variant="h2"
|
58
|
+
gutterBottom
|
59
|
+
>
|
60
|
+
{t('titles:login')}
|
61
|
+
</Typography>
|
62
|
+
}
|
63
|
+
/>
|
64
|
+
);
|
65
|
+
}),
|
66
|
+
);
|
67
|
+
|
68
|
+
export default Login;
|
@@ -8,6 +8,7 @@ import { Form, Field } from 'q3-ui-forms/lib/builders';
|
|
8
8
|
import FormBoxContent from '../components/FormBoxContent';
|
9
9
|
import FormBox from '../components/FormBox';
|
10
10
|
import withSuccessOp from '../components/withSuccessOp';
|
11
|
+
import withPublicTemplate from '../components/withPublicTemplate';
|
11
12
|
|
12
13
|
const PasswordChange = ({ onSuccess, location }) => {
|
13
14
|
const { passwordResetToken, email } = queryString.parse(
|
@@ -64,7 +65,8 @@ PasswordChange.propTypes = {
|
|
64
65
|
}).isRequired,
|
65
66
|
};
|
66
67
|
|
67
|
-
|
68
|
-
PasswordChange,
|
69
|
-
'passwordChangeNotice',
|
68
|
+
const PasswordChangeWithTemplate = withPublicTemplate(
|
69
|
+
withSuccessOp(PasswordChange, 'passwordChangeNotice'),
|
70
70
|
);
|
71
|
+
|
72
|
+
export default PasswordChangeWithTemplate;
|
@@ -5,6 +5,7 @@ import { Form, Field } from 'q3-ui-forms/lib/builders';
|
|
5
5
|
import FormBox from '../components/FormBox';
|
6
6
|
import FormBoxContent from '../components/FormBoxContent';
|
7
7
|
import withSuccessOp from '../components/withSuccessOp';
|
8
|
+
import withPublicTemplate from '../components/withPublicTemplate';
|
8
9
|
|
9
10
|
const PasswordReset = ({ onSuccess }) => (
|
10
11
|
<FormBox
|
@@ -39,7 +40,8 @@ PasswordReset.propTypes = {
|
|
39
40
|
onSuccess: PropTypes.func.isRequired,
|
40
41
|
};
|
41
42
|
|
42
|
-
|
43
|
-
PasswordReset,
|
44
|
-
'passwordResetNotice',
|
43
|
+
const PasswordResetWithTemplate = withPublicTemplate(
|
44
|
+
withSuccessOp(PasswordReset, 'passwordResetNotice'),
|
45
45
|
);
|
46
|
+
|
47
|
+
export default PasswordResetWithTemplate;
|
package/src/pages/reverify.jsx
CHANGED
@@ -9,6 +9,7 @@ import FormBox from '../components/FormBox';
|
|
9
9
|
import FormBoxContent from '../components/FormBoxContent';
|
10
10
|
import FormBoxNotice from '../components/FormBoxNotice';
|
11
11
|
import { hasOp, toOp } from '../components/utils';
|
12
|
+
import withPublicTemplate from '../components/withPublicTemplate';
|
12
13
|
|
13
14
|
const Reverify = ({ location: { search, pathname } }) => {
|
14
15
|
const { t } = useTranslation();
|
@@ -23,7 +24,7 @@ const Reverify = ({ location: { search, pathname } }) => {
|
|
23
24
|
component={Link}
|
24
25
|
to="/reverify"
|
25
26
|
variant="contained"
|
26
|
-
color="
|
27
|
+
color="secondary"
|
27
28
|
>
|
28
29
|
{t('labels:tryAgain')}
|
29
30
|
</Button>
|
@@ -67,4 +68,5 @@ Reverify.propTypes = {
|
|
67
68
|
}).isRequired,
|
68
69
|
};
|
69
70
|
|
70
|
-
|
71
|
+
const ReverifyWithTemplate = withPublicTemplate(Reverify);
|
72
|
+
export default ReverifyWithTemplate;
|
package/src/pages/verify.jsx
CHANGED
@@ -8,19 +8,14 @@ import { Form, Field } from 'q3-ui-forms/lib/builders';
|
|
8
8
|
import FormBoxContent from '../components/FormBoxContent';
|
9
9
|
import FormBox from '../components/FormBox';
|
10
10
|
import withAuthenticate from '../components/withAuthenticate';
|
11
|
+
import withPublicTemplate from '../components/withPublicTemplate';
|
11
12
|
|
12
|
-
|
13
|
-
({ authenticate, ...props }) => {
|
14
|
-
const {
|
15
|
-
|
16
|
-
id,
|
17
|
-
email,
|
18
|
-
} = queryString.parse(
|
19
|
-
get(props, 'location.search', ''),
|
20
|
-
{
|
13
|
+
const Verify = withPublicTemplate(
|
14
|
+
withAuthenticate(({ authenticate, ...props }) => {
|
15
|
+
const { verificationCode, id, email } =
|
16
|
+
queryString.parse(get(props, 'location.search', ''), {
|
21
17
|
decode: false,
|
22
|
-
}
|
23
|
-
);
|
18
|
+
});
|
24
19
|
|
25
20
|
return (
|
26
21
|
<FormBox
|
@@ -69,5 +64,7 @@ export default withAuthenticate(
|
|
69
64
|
}
|
70
65
|
/>
|
71
66
|
);
|
72
|
-
},
|
67
|
+
}),
|
73
68
|
);
|
69
|
+
|
70
|
+
export default Verify;
|