gatsby-theme-q3 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/lib/components/PublicTemplate.js +125 -6
- package/lib/components/PublicTemplateBackground.js +120 -0
- package/lib/components/withPublicTemplate.js +17 -0
- package/lib/components/withSuccessOp.js +1 -1
- package/lib/pages/login.js +5 -3
- 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/PublicTemplate.jsx +129 -5
- package/src/components/PublicTemplateBackground.jsx +140 -0
- package/src/components/withPublicTemplate.jsx +11 -0
- package/src/components/withSuccessOp.jsx +1 -1
- package/src/pages/login.jsx +51 -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,14 @@
|
|
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.2](https://github.com/3merge/q/compare/v3.2.1...v3.2.2) (2022-02-10)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package gatsby-theme-q3
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
## [3.2.1](https://github.com/3merge/q/compare/v3.2.0...v3.2.1) (2022-02-09)
|
7
15
|
|
8
16
|
|
@@ -9,7 +9,11 @@ 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");
|
13
17
|
|
14
18
|
var _AdminPublicGateway = _interopRequireDefault(require("./AdminPublicGateway"));
|
15
19
|
|
@@ -17,18 +21,133 @@ var _useSiteMetaData = _interopRequireDefault(require("./useSiteMetaData"));
|
|
17
21
|
|
18
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
23
|
|
24
|
+
const useStyle = (0, _core.makeStyles)(theme => ({
|
25
|
+
logo: {
|
26
|
+
height: 95,
|
27
|
+
width: 180,
|
28
|
+
display: 'block',
|
29
|
+
'& img': {
|
30
|
+
objectFit: 'contain',
|
31
|
+
height: '100%',
|
32
|
+
width: '100%'
|
33
|
+
}
|
34
|
+
},
|
35
|
+
container: {
|
36
|
+
maxWidth: '85vw',
|
37
|
+
width: 850,
|
38
|
+
[theme.breakpoints.down('md')]: {
|
39
|
+
width: '100%'
|
40
|
+
},
|
41
|
+
[theme.breakpoints.down('sm')]: {
|
42
|
+
width: 'auto'
|
43
|
+
}
|
44
|
+
},
|
45
|
+
photo: ({
|
46
|
+
photo
|
47
|
+
}) => ({
|
48
|
+
backgroundColor: theme.palette.secondary.light,
|
49
|
+
backgroundImage: `url(${photo})`,
|
50
|
+
backgroundSize: 'contain',
|
51
|
+
backgroundPosition: 'center',
|
52
|
+
backgroundRepeat: 'no-repeat',
|
53
|
+
width: '100%',
|
54
|
+
height: '100%'
|
55
|
+
})
|
56
|
+
}));
|
57
|
+
|
58
|
+
const Copyright = () => {
|
59
|
+
const {
|
60
|
+
brand
|
61
|
+
} = (0, _useSiteMetaData.default)();
|
62
|
+
return brand ? /*#__PURE__*/_react.default.createElement(_core.Box, {
|
63
|
+
display: "inline-block",
|
64
|
+
mx: 1
|
65
|
+
}, "\xA9", new Date().getFullYear(), " ", brand) : null;
|
66
|
+
}; // eslint-disable-next-line
|
67
|
+
|
68
|
+
|
69
|
+
const TextLink = ({
|
70
|
+
href,
|
71
|
+
text
|
72
|
+
}) => {
|
73
|
+
const {
|
74
|
+
t
|
75
|
+
} = (0, _q3UiLocale.useTranslation)('labels');
|
76
|
+
return href ? /*#__PURE__*/_react.default.createElement(_core.Box, {
|
77
|
+
display: "inline-block",
|
78
|
+
mx: 1
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Link, {
|
80
|
+
href: href,
|
81
|
+
target: "_blank"
|
82
|
+
}, t(text)), ' ') : null;
|
83
|
+
};
|
84
|
+
|
20
85
|
const PublicTemplate = ({
|
21
86
|
children,
|
22
87
|
...rest
|
23
88
|
}) => {
|
24
89
|
const {
|
25
90
|
brand,
|
26
|
-
|
91
|
+
cancellation,
|
92
|
+
logo,
|
93
|
+
terms,
|
94
|
+
privacy,
|
95
|
+
photo
|
27
96
|
} = (0, _useSiteMetaData.default)();
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
97
|
+
const cls = useStyle({
|
98
|
+
photo
|
99
|
+
});
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_AdminPublicGateway.default, rest, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
101
|
+
alignItems: "center",
|
102
|
+
component: "article",
|
103
|
+
display: "flex",
|
104
|
+
flexDirection: "column",
|
105
|
+
justifyContent: "center",
|
106
|
+
width: "100%"
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
108
|
+
component: "header",
|
109
|
+
mt: "2vh",
|
110
|
+
mb: 2,
|
111
|
+
textAlign: "center"
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_gatsby.Link, {
|
113
|
+
to: "/",
|
114
|
+
className: cls.logo
|
115
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
116
|
+
alt: brand,
|
117
|
+
src: logo
|
118
|
+
}))), /*#__PURE__*/_react.default.createElement(_core.Paper, {
|
119
|
+
className: cls.container
|
120
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
121
|
+
container: true,
|
122
|
+
spacing: 1
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Hidden, {
|
124
|
+
smDown: true
|
125
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
126
|
+
item: true,
|
127
|
+
xs: 6
|
128
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
129
|
+
className: cls.photo
|
130
|
+
}))), /*#__PURE__*/_react.default.createElement(_core.Grid, {
|
131
|
+
item: true,
|
132
|
+
md: 6,
|
133
|
+
xs: 12
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
135
|
+
p: 2
|
136
|
+
}, children)))), /*#__PURE__*/_react.default.createElement(_core.Box, {
|
137
|
+
maxWidth: "75vw",
|
138
|
+
component: "footer",
|
139
|
+
mt: 3,
|
140
|
+
textAlign: "center"
|
141
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, /*#__PURE__*/_react.default.createElement(Copyright, null), /*#__PURE__*/_react.default.createElement(TextLink, {
|
142
|
+
href: terms,
|
143
|
+
text: "termsAndConditions"
|
144
|
+
}), /*#__PURE__*/_react.default.createElement(TextLink, {
|
145
|
+
href: privacy,
|
146
|
+
text: "privacyPolicy"
|
147
|
+
}), /*#__PURE__*/_react.default.createElement(TextLink, {
|
148
|
+
href: cancellation,
|
149
|
+
text: "cancellationPolicy"
|
150
|
+
})))));
|
32
151
|
};
|
33
152
|
|
34
153
|
PublicTemplate.defaultProps = {
|
@@ -0,0 +1,120 @@
|
|
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 _core = require("@material-ui/core");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
const PublicTemplateBackground = () => {
|
15
|
+
const theme = (0, _core.useTheme)();
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_core.Box, {
|
17
|
+
position: "fixed",
|
18
|
+
top: 0,
|
19
|
+
right: 0,
|
20
|
+
left: 0,
|
21
|
+
bottom: 0,
|
22
|
+
overflow: "hidden"
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_core.Box, {
|
24
|
+
position: "fixed",
|
25
|
+
top: 0,
|
26
|
+
right: 0,
|
27
|
+
left: 0,
|
28
|
+
bottom: 0,
|
29
|
+
style: {
|
30
|
+
backgroundImage: 'url(https://images.unsplash.com/photo-1523293836414-f04e712e1f3b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=703&q=80)',
|
31
|
+
opacity: 0.1
|
32
|
+
}
|
33
|
+
}), /*#__PURE__*/_react.default.createElement(_core.Box, {
|
34
|
+
position: "fixed",
|
35
|
+
top: 0,
|
36
|
+
right: 0,
|
37
|
+
left: 0,
|
38
|
+
bottom: 0,
|
39
|
+
style: {
|
40
|
+
background: `linear-gradient(90deg, ${theme.palette.secondary.dark} 0%, ${theme.palette.secondary.light} 35%, ${theme.palette.secondary.main} 100%)`,
|
41
|
+
opacity: 0.1
|
42
|
+
}
|
43
|
+
}), /*#__PURE__*/_react.default.createElement("svg", {
|
44
|
+
xmlns: "http://www.w3.org/2000/svg",
|
45
|
+
style: {
|
46
|
+
opacity: 0.15,
|
47
|
+
minHeight: '100vh',
|
48
|
+
minWidth: '100vw'
|
49
|
+
}
|
50
|
+
}, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
51
|
+
id: "a",
|
52
|
+
x1: "0",
|
53
|
+
x2: "0",
|
54
|
+
y1: "1",
|
55
|
+
y2: "0"
|
56
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
57
|
+
offset: "0",
|
58
|
+
stopColor: theme.palette.background.muted
|
59
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
60
|
+
offset: "1",
|
61
|
+
stopColor: theme.palette.secondary.dark
|
62
|
+
})), /*#__PURE__*/_react.default.createElement("linearGradient", {
|
63
|
+
id: "b",
|
64
|
+
x1: "0",
|
65
|
+
x2: "0",
|
66
|
+
y1: "0",
|
67
|
+
y2: "1"
|
68
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
69
|
+
offset: "0",
|
70
|
+
stopColor: theme.palette.secondary.light
|
71
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
72
|
+
offset: "1",
|
73
|
+
stopColor: theme.palette.secondary.main
|
74
|
+
}))), /*#__PURE__*/_react.default.createElement("g", {
|
75
|
+
fill: theme.palette.background.muted,
|
76
|
+
fillOpacity: "0",
|
77
|
+
strokeMiterlimit: "10"
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
79
|
+
stroke: "url(#a)",
|
80
|
+
strokeWidth: "2"
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
82
|
+
transform: "translate(0 0)",
|
83
|
+
d: "M1409 581 1450.35 511 1490 581z"
|
84
|
+
}), /*#__PURE__*/_react.default.createElement("circle", {
|
85
|
+
strokeWidth: "4",
|
86
|
+
transform: "rotate(0 800 450)",
|
87
|
+
cx: "500",
|
88
|
+
cy: "100",
|
89
|
+
r: "40"
|
90
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
91
|
+
transform: "translate(0 0)",
|
92
|
+
d: "M400.86 735.5h-83.73c0-23.12 18.74-41.87 41.87-41.87S400.86 712.38 400.86 735.5z"
|
93
|
+
})), /*#__PURE__*/_react.default.createElement("g", {
|
94
|
+
stroke: "url(#b)",
|
95
|
+
strokeWidth: "4"
|
96
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
97
|
+
transform: "translate(0 0)",
|
98
|
+
d: "M149.8 345.2 118.4 389.8 149.8 434.4 181.2 389.8z"
|
99
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
100
|
+
strokeWidth: "8",
|
101
|
+
transform: "rotate(0 1089 759)",
|
102
|
+
x: "1039",
|
103
|
+
y: "709",
|
104
|
+
width: "100",
|
105
|
+
height: "100"
|
106
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
107
|
+
transform: "rotate(0 1400 132)",
|
108
|
+
d: "M1426.8 132.4 1405.7 168.8 1363.7 168.8 1342.7 132.4 1363.7 96 1405.7 96z"
|
109
|
+
})))), /*#__PURE__*/_react.default.createElement(_core.Box, {
|
110
|
+
position: "fixed",
|
111
|
+
bottom: "1rem",
|
112
|
+
right: "1rem",
|
113
|
+
zIndex: 10
|
114
|
+
}, /*#__PURE__*/_react.default.createElement("small", null, "Texture made with", ' ', /*#__PURE__*/_react.default.createElement(_core.Link, {
|
115
|
+
href: "https://www.design.svgbackgrounds.com/"
|
116
|
+
}, "SVGBackgrounds.com"))));
|
117
|
+
};
|
118
|
+
|
119
|
+
var _default = PublicTemplateBackground;
|
120
|
+
exports.default = _default;
|
@@ -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 {
|
@@ -68,6 +70,6 @@ var _default = (0, _withAuthenticate.default)(({
|
|
68
70
|
gutterBottom: true
|
69
71
|
}, t('titles:login'))
|
70
72
|
});
|
71
|
-
});
|
72
|
-
|
73
|
+
}));
|
74
|
+
var _default = Login;
|
73
75
|
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.2",
|
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.2",
|
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": "c250a6bd44f4475e85b15057c649c2b6cc584836"
|
46
46
|
}
|
@@ -1,17 +1,141 @@
|
|
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';
|
4
13
|
import AdminPublicGateway from './AdminPublicGateway';
|
5
14
|
import useSiteMetaData from './useSiteMetaData';
|
6
15
|
|
16
|
+
const useStyle = makeStyles((theme) => ({
|
17
|
+
logo: {
|
18
|
+
height: 95,
|
19
|
+
width: 180,
|
20
|
+
display: 'block',
|
21
|
+
|
22
|
+
'& img': {
|
23
|
+
objectFit: 'contain',
|
24
|
+
height: '100%',
|
25
|
+
width: '100%',
|
26
|
+
},
|
27
|
+
},
|
28
|
+
container: {
|
29
|
+
maxWidth: '85vw',
|
30
|
+
width: 850,
|
31
|
+
|
32
|
+
[theme.breakpoints.down('md')]: {
|
33
|
+
width: '100%',
|
34
|
+
},
|
35
|
+
|
36
|
+
[theme.breakpoints.down('sm')]: {
|
37
|
+
width: 'auto',
|
38
|
+
},
|
39
|
+
},
|
40
|
+
photo: ({ photo }) => ({
|
41
|
+
backgroundColor: theme.palette.secondary.light,
|
42
|
+
backgroundImage: `url(${photo})`,
|
43
|
+
backgroundSize: 'contain',
|
44
|
+
backgroundPosition: 'center',
|
45
|
+
backgroundRepeat: 'no-repeat',
|
46
|
+
width: '100%',
|
47
|
+
height: '100%',
|
48
|
+
}),
|
49
|
+
}));
|
50
|
+
|
51
|
+
const Copyright = () => {
|
52
|
+
const { brand } = useSiteMetaData();
|
53
|
+
|
54
|
+
return brand ? (
|
55
|
+
<Box display="inline-block" mx={1}>
|
56
|
+
©{new Date().getFullYear()} {brand}
|
57
|
+
</Box>
|
58
|
+
) : null;
|
59
|
+
};
|
60
|
+
|
61
|
+
// eslint-disable-next-line
|
62
|
+
const TextLink = ({ href, text }) => {
|
63
|
+
const { t } = useTranslation('labels');
|
64
|
+
|
65
|
+
return href ? (
|
66
|
+
<Box display="inline-block" mx={1}>
|
67
|
+
<Link href={href} target="_blank">
|
68
|
+
{t(text)}
|
69
|
+
</Link>{' '}
|
70
|
+
</Box>
|
71
|
+
) : null;
|
72
|
+
};
|
73
|
+
|
7
74
|
const PublicTemplate = ({ children, ...rest }) => {
|
8
|
-
const {
|
75
|
+
const {
|
76
|
+
brand,
|
77
|
+
cancellation,
|
78
|
+
logo,
|
79
|
+
terms,
|
80
|
+
privacy,
|
81
|
+
photo,
|
82
|
+
} = useSiteMetaData();
|
83
|
+
const cls = useStyle({
|
84
|
+
photo,
|
85
|
+
});
|
9
86
|
|
10
87
|
return (
|
11
88
|
<AdminPublicGateway {...rest}>
|
12
|
-
<
|
13
|
-
|
14
|
-
|
89
|
+
<Box
|
90
|
+
alignItems="center"
|
91
|
+
component="article"
|
92
|
+
display="flex"
|
93
|
+
flexDirection="column"
|
94
|
+
justifyContent="center"
|
95
|
+
width="100%"
|
96
|
+
>
|
97
|
+
<Box
|
98
|
+
component="header"
|
99
|
+
mt="2vh"
|
100
|
+
mb={2}
|
101
|
+
textAlign="center"
|
102
|
+
>
|
103
|
+
<ReachLink to="/" className={cls.logo}>
|
104
|
+
<img alt={brand} src={logo} />
|
105
|
+
</ReachLink>
|
106
|
+
</Box>
|
107
|
+
<Paper className={cls.container}>
|
108
|
+
<Grid container spacing={1}>
|
109
|
+
<Hidden smDown>
|
110
|
+
<Grid item xs={6}>
|
111
|
+
<Box className={cls.photo} />
|
112
|
+
</Grid>
|
113
|
+
</Hidden>
|
114
|
+
<Grid item md={6} xs={12}>
|
115
|
+
<Box p={2}>{children}</Box>
|
116
|
+
</Grid>
|
117
|
+
</Grid>
|
118
|
+
</Paper>
|
119
|
+
<Box
|
120
|
+
maxWidth="75vw"
|
121
|
+
component="footer"
|
122
|
+
mt={3}
|
123
|
+
textAlign="center"
|
124
|
+
>
|
125
|
+
<small>
|
126
|
+
<Copyright />
|
127
|
+
<TextLink
|
128
|
+
href={terms}
|
129
|
+
text="termsAndConditions"
|
130
|
+
/>
|
131
|
+
<TextLink href={privacy} text="privacyPolicy" />
|
132
|
+
<TextLink
|
133
|
+
href={cancellation}
|
134
|
+
text="cancellationPolicy"
|
135
|
+
/>
|
136
|
+
</small>
|
137
|
+
</Box>
|
138
|
+
</Box>
|
15
139
|
</AdminPublicGateway>
|
16
140
|
);
|
17
141
|
};
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Box, Link, useTheme } from '@material-ui/core';
|
3
|
+
|
4
|
+
const PublicTemplateBackground = () => {
|
5
|
+
const theme = useTheme();
|
6
|
+
|
7
|
+
return (
|
8
|
+
<Box
|
9
|
+
position="fixed"
|
10
|
+
top={0}
|
11
|
+
right={0}
|
12
|
+
left={0}
|
13
|
+
bottom={0}
|
14
|
+
overflow="hidden"
|
15
|
+
>
|
16
|
+
<Box
|
17
|
+
position="fixed"
|
18
|
+
top={0}
|
19
|
+
right={0}
|
20
|
+
left={0}
|
21
|
+
bottom={0}
|
22
|
+
style={{
|
23
|
+
backgroundImage:
|
24
|
+
'url(https://images.unsplash.com/photo-1523293836414-f04e712e1f3b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=703&q=80)',
|
25
|
+
opacity: 0.1,
|
26
|
+
}}
|
27
|
+
/>
|
28
|
+
<Box
|
29
|
+
position="fixed"
|
30
|
+
top={0}
|
31
|
+
right={0}
|
32
|
+
left={0}
|
33
|
+
bottom={0}
|
34
|
+
style={{
|
35
|
+
background: `linear-gradient(90deg, ${theme.palette.secondary.dark} 0%, ${theme.palette.secondary.light} 35%, ${theme.palette.secondary.main} 100%)`,
|
36
|
+
opacity: 0.1,
|
37
|
+
}}
|
38
|
+
/>
|
39
|
+
<svg
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
41
|
+
style={{
|
42
|
+
opacity: 0.15,
|
43
|
+
minHeight: '100vh',
|
44
|
+
minWidth: '100vw',
|
45
|
+
}}
|
46
|
+
>
|
47
|
+
<defs>
|
48
|
+
<linearGradient
|
49
|
+
id="a"
|
50
|
+
x1="0"
|
51
|
+
x2="0"
|
52
|
+
y1="1"
|
53
|
+
y2="0"
|
54
|
+
>
|
55
|
+
<stop
|
56
|
+
offset="0"
|
57
|
+
stopColor={theme.palette.background.muted}
|
58
|
+
/>
|
59
|
+
<stop
|
60
|
+
offset="1"
|
61
|
+
stopColor={theme.palette.secondary.dark}
|
62
|
+
/>
|
63
|
+
</linearGradient>
|
64
|
+
<linearGradient
|
65
|
+
id="b"
|
66
|
+
x1="0"
|
67
|
+
x2="0"
|
68
|
+
y1="0"
|
69
|
+
y2="1"
|
70
|
+
>
|
71
|
+
<stop
|
72
|
+
offset="0"
|
73
|
+
stopColor={theme.palette.secondary.light}
|
74
|
+
/>
|
75
|
+
<stop
|
76
|
+
offset="1"
|
77
|
+
stopColor={theme.palette.secondary.main}
|
78
|
+
/>
|
79
|
+
</linearGradient>
|
80
|
+
</defs>
|
81
|
+
<g
|
82
|
+
fill={theme.palette.background.muted}
|
83
|
+
fillOpacity="0"
|
84
|
+
strokeMiterlimit="10"
|
85
|
+
>
|
86
|
+
<g stroke="url(#a)" strokeWidth="2">
|
87
|
+
<path
|
88
|
+
transform="translate(0 0)"
|
89
|
+
d="M1409 581 1450.35 511 1490 581z"
|
90
|
+
/>
|
91
|
+
<circle
|
92
|
+
strokeWidth="4"
|
93
|
+
transform="rotate(0 800 450)"
|
94
|
+
cx="500"
|
95
|
+
cy="100"
|
96
|
+
r="40"
|
97
|
+
/>
|
98
|
+
<path
|
99
|
+
transform="translate(0 0)"
|
100
|
+
d="M400.86 735.5h-83.73c0-23.12 18.74-41.87 41.87-41.87S400.86 712.38 400.86 735.5z"
|
101
|
+
/>
|
102
|
+
</g>
|
103
|
+
<g stroke="url(#b)" strokeWidth="4">
|
104
|
+
<path
|
105
|
+
transform="translate(0 0)"
|
106
|
+
d="M149.8 345.2 118.4 389.8 149.8 434.4 181.2 389.8z"
|
107
|
+
/>
|
108
|
+
<rect
|
109
|
+
strokeWidth="8"
|
110
|
+
transform="rotate(0 1089 759)"
|
111
|
+
x="1039"
|
112
|
+
y="709"
|
113
|
+
width="100"
|
114
|
+
height="100"
|
115
|
+
/>
|
116
|
+
<path
|
117
|
+
transform="rotate(0 1400 132)"
|
118
|
+
d="M1426.8 132.4 1405.7 168.8 1363.7 168.8 1342.7 132.4 1363.7 96 1405.7 96z"
|
119
|
+
/>
|
120
|
+
</g>
|
121
|
+
</g>
|
122
|
+
</svg>
|
123
|
+
<Box
|
124
|
+
position="fixed"
|
125
|
+
bottom="1rem"
|
126
|
+
right="1rem"
|
127
|
+
zIndex={10}
|
128
|
+
>
|
129
|
+
<small>
|
130
|
+
Texture made with{' '}
|
131
|
+
<Link href="https://www.design.svgbackgrounds.com/">
|
132
|
+
SVGBackgrounds.com
|
133
|
+
</Link>
|
134
|
+
</small>
|
135
|
+
</Box>
|
136
|
+
</Box>
|
137
|
+
);
|
138
|
+
};
|
139
|
+
|
140
|
+
export default PublicTemplateBackground;
|
@@ -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,56 @@ 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 variant="h1" gutterBottom>
|
56
|
+
{t('titles:login')}
|
57
|
+
</Typography>
|
58
|
+
}
|
59
|
+
/>
|
60
|
+
);
|
61
|
+
}),
|
62
|
+
);
|
63
|
+
|
64
|
+
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;
|