gatsby-theme-q3 3.1.4 → 3.2.2
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 +74 -35
- package/gatsby-browser.js +29 -0
- package/gatsby-config.js +7 -47
- package/gatsby-node.js +0 -1
- package/lib/components/PageWrapper.js +2 -11
- package/lib/components/PublicTemplate.js +125 -6
- package/lib/components/PublicTemplateBackground.js +120 -0
- package/lib/components/SearchEngine.js +67 -20
- package/lib/components/Wrapper.js +3 -25
- package/lib/components/__tests__/SearchEngine.test.js +41 -0
- package/lib/components/useSiteMetaData.js +13 -12
- 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 +6 -6
- package/src/components/PageWrapper.jsx +1 -13
- package/src/components/PublicTemplate.jsx +129 -5
- package/src/components/PublicTemplateBackground.jsx +140 -0
- package/src/components/SearchEngine.jsx +82 -23
- package/src/components/Wrapper.jsx +3 -27
- package/src/components/__tests__/SearchEngine.test.jsx +58 -0
- package/src/components/useSiteMetaData.js +17 -16
- 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/__tests__/config.int.test.js +0 -73
- package/helpers/__tests__/loadContent.unit.test.js +0 -13
- package/helpers/__tests__/pagination.unit.test.js +0 -139
- package/helpers/__tests__/slug.unit.test.js +0 -21
- package/helpers/archive.js +0 -42
- package/helpers/index.js +0 -19
- package/helpers/loadContent.js +0 -45
- package/helpers/loadTheme.js +0 -10
- package/helpers/pagination.js +0 -109
- package/helpers/setup.js +0 -60
- package/helpers/slug.js +0 -31
- package/helpers/slugType.js +0 -24
- package/lib/components/LocaleBundles.js +0 -42
- package/lib/components/useLocale.js +0 -31
- package/src/components/LocaleBundles.jsx +0 -37
- package/src/components/useLocale.js +0 -20
@@ -7,41 +7,19 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var _axios = _interopRequireDefault(require("axios"));
|
11
|
-
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
13
11
|
|
14
12
|
var _q3UiPermissions = _interopRequireDefault(require("q3-ui-permissions"));
|
15
13
|
|
16
|
-
var _LocaleBundles = _interopRequireDefault(require("./LocaleBundles"));
|
17
|
-
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
15
|
|
20
16
|
/* eslint-disable import/no-extraneous-dependencies */
|
21
|
-
const setBaseUrlForRest = (baseURL = process.env.GATSBY_APP_BASE_URL || 'http://localhost:9000') => {
|
22
|
-
_axios.default.defaults.baseURL = baseURL;
|
23
|
-
return _axios.default.defaults;
|
24
|
-
};
|
25
|
-
|
26
17
|
const Wrapper = ({
|
27
|
-
|
28
|
-
|
29
|
-
locale
|
30
|
-
}) => {
|
31
|
-
setBaseUrlForRest(baseURL);
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_LocaleBundles.default, {
|
33
|
-
locale: locale
|
34
|
-
}, /*#__PURE__*/_react.default.createElement(_q3UiPermissions.default, null, children));
|
35
|
-
};
|
18
|
+
children
|
19
|
+
}) => /*#__PURE__*/_react.default.createElement(_q3UiPermissions.default, null, children);
|
36
20
|
|
37
|
-
Wrapper.defaultProps = {
|
38
|
-
baseURL: undefined
|
39
|
-
};
|
40
21
|
Wrapper.propTypes = {
|
41
|
-
|
42
|
-
children: _propTypes.default.node.isRequired,
|
43
|
-
// eslint-disable-next-line
|
44
|
-
locale: _propTypes.default.object.isRequired
|
22
|
+
children: _propTypes.default.node.isRequired
|
45
23
|
};
|
46
24
|
var _default = Wrapper;
|
47
25
|
exports.default = _default;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _SearchEngine = require("../SearchEngine");
|
4
|
+
|
5
|
+
jest.mock('q3-ui-locale', () => ({
|
6
|
+
browser: {
|
7
|
+
isBrowserReady: jest.fn()
|
8
|
+
}
|
9
|
+
}));
|
10
|
+
const host = 'https://google.ca';
|
11
|
+
beforeEach(() => {
|
12
|
+
Object.defineProperty(window, 'location', {
|
13
|
+
value: {
|
14
|
+
host
|
15
|
+
}
|
16
|
+
});
|
17
|
+
});
|
18
|
+
describe('SearchEngine', () => {
|
19
|
+
it('should not render descriptions without content', () => {
|
20
|
+
expect((0, _SearchEngine.generateMetaDescriptionOptions)().length).toBe(0);
|
21
|
+
});
|
22
|
+
it('should render descriptions with content', () => {
|
23
|
+
expect((0, _SearchEngine.generateMetaDescriptionOptions)('foo').length).toBeGreaterThanOrEqual(1);
|
24
|
+
});
|
25
|
+
it('should return host', () => {
|
26
|
+
expect((0, _SearchEngine.getStartUrl)()).toMatch(host);
|
27
|
+
});
|
28
|
+
it('should render favicon', () => {
|
29
|
+
expect((0, _SearchEngine.generateIcons)({
|
30
|
+
favicon: host
|
31
|
+
})).toHaveLength(1);
|
32
|
+
});
|
33
|
+
it('should not render favicon', () => {
|
34
|
+
expect((0, _SearchEngine.generateIcons)({
|
35
|
+
favicon: undefined
|
36
|
+
})).toHaveLength(0);
|
37
|
+
});
|
38
|
+
it('should include template literals', () => {
|
39
|
+
expect((0, _SearchEngine.generateBrand)('3merge')).toMatch('%s | 3merge');
|
40
|
+
});
|
41
|
+
});
|
@@ -9,19 +9,20 @@ var _lodash = require("lodash");
|
|
9
9
|
|
10
10
|
var _gatsby = require("gatsby");
|
11
11
|
|
12
|
-
var
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
var _useRunTime = _interopRequireDefault(require("gatsby-theme-q3-mui/src/components/useRunTime"));
|
13
|
+
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
+
|
16
|
+
var _default = () => (0, _lodash.merge)((0, _lodash.get)((0, _gatsby.useStaticQuery)((0, _gatsby.graphql)`
|
17
|
+
query {
|
18
|
+
site {
|
19
|
+
siteMetadata {
|
20
|
+
appDirectory
|
21
|
+
description
|
22
|
+
title
|
23
|
+
}
|
22
24
|
}
|
23
25
|
}
|
24
|
-
}
|
25
|
-
`), 'site.siteMetadata', {});
|
26
|
+
`), 'site.siteMetadata', {}), (0, _useRunTime.default)());
|
26
27
|
|
27
28
|
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.
|
3
|
+
"version": "3.2.2",
|
4
4
|
"main": "index.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"peerDependencies": {
|
@@ -23,24 +23,24 @@
|
|
23
23
|
"gatsby-image": "^3.11.0",
|
24
24
|
"gatsby-plugin-canonical-urls": "^4.2.0",
|
25
25
|
"gatsby-plugin-force-trailing-slashes": "^1.0.5",
|
26
|
-
"gatsby-plugin-manifest": "^4.2.0",
|
27
26
|
"gatsby-plugin-material-ui": "^3.0.1",
|
28
27
|
"gatsby-plugin-netlify": "^3.14.0",
|
29
28
|
"gatsby-plugin-robots-txt": "^1.6.14",
|
30
29
|
"gatsby-plugin-sharp": "^4.2.0",
|
31
30
|
"gatsby-plugin-sitemap": "^5.2.0",
|
32
|
-
"gatsby-
|
33
|
-
"gatsby-theme-q3-mui": "^3.1.4",
|
31
|
+
"gatsby-theme-q3-mui": "^3.2.2",
|
34
32
|
"gatsby-transformer-sharp": "^4.2.0",
|
35
33
|
"lodash": "^4.17.20",
|
36
34
|
"process": "^0.11.10",
|
37
35
|
"prop-types": "^15.7.2",
|
38
|
-
"q3-ui-
|
36
|
+
"q3-ui-helpers": "^3.2.0",
|
37
|
+
"q3-ui-locale": "^3.2.1",
|
39
38
|
"query-string": "^7.0.1",
|
39
|
+
"react-helmet": "^6.1.0",
|
40
40
|
"react-share": "^4.3.1",
|
41
41
|
"slugify": "^1.6.3",
|
42
42
|
"transform-loader": "^0.2.4",
|
43
43
|
"yarn": "^1.22.17"
|
44
44
|
},
|
45
|
-
"gitHead": "
|
45
|
+
"gitHead": "c250a6bd44f4475e85b15057c649c2b6cc584836"
|
46
46
|
}
|
@@ -2,23 +2,11 @@ import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Loader } from 'q3-admin/lib/components';
|
4
4
|
import SearchEngine from './SearchEngine';
|
5
|
-
import useLocale from './useLocale';
|
6
5
|
|
7
|
-
|
8
|
-
const Locale = () => {
|
9
|
-
useLocale();
|
10
|
-
return null;
|
11
|
-
};
|
12
|
-
|
13
|
-
const PageWrapper = ({
|
14
|
-
children,
|
15
|
-
includeLoader,
|
16
|
-
includeLocale,
|
17
|
-
}) => (
|
6
|
+
const PageWrapper = ({ children, includeLoader }) => (
|
18
7
|
<>
|
19
8
|
<SearchEngine />
|
20
9
|
{includeLoader && <Loader />}
|
21
|
-
{includeLocale && <Locale />}
|
22
10
|
{children}
|
23
11
|
</>
|
24
12
|
);
|
@@ -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;
|