gatsby-core-theme 21.0.7 → 21.0.9
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 +29 -0
- package/gatsby-config.js +1 -1
- package/gatsby-node.esm.js +2 -0
- package/package.json +1 -1
- package/src/components/atoms/module-title/index.js +14 -7
- package/src/components/molecules/module/index.js +11 -3
- package/src/components/molecules/pagination/index.js +11 -2
- package/src/components/molecules/pagination/with-midpoints.js +11 -2
- package/src/components/organisms/archive/index.js +3 -1
- package/src/components/pages/body/index.js +1 -0
- package/storybook/.ci.yml +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [21.0.9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v21.0.8...v21.0.9) (2023-05-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added all markets to page context for multiple markets ([7c1b7d4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7c1b7d43a00566abff583d0866b8c85c3db2eda4))
|
|
7
|
+
* pipelines ([95037e9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/95037e991dadb97187376860b40c01b75a11e1dc))
|
|
8
|
+
* pipelines ([d42b627](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d42b6270d12e7fc8a90ca3b3c76c8c1504c4fca1))
|
|
9
|
+
|
|
10
|
+
## [21.0.8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v21.0.7...v21.0.8) (2023-05-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add hash in the class name ([d0e4a25](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d0e4a25cdb7a388d22268ff36d181699fbbe9a33))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Code Refactoring
|
|
19
|
+
|
|
20
|
+
* update anchor label id element ([c096ff4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c096ff47f2a8cbdd241eeecaabfafe7489df776e))
|
|
21
|
+
* update archive module conditional anchor label ([3c874c4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3c874c43cb4700da9ce950a01f23261f2332469d))
|
|
22
|
+
* update archive module pagination to scroll into view ([7fb0e28](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7fb0e289857c61c25fd999b4b9fd6c7557148cac))
|
|
23
|
+
* update module title anchor only for archive module ([2a481c7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2a481c770ec3bd6b5a77178df708c0bfe80da6d6))
|
|
24
|
+
* update pagination component path generation ([907af0c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/907af0c6fd5ffd91cd0733b77c25d7f3267e2880))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
* Merge branch 'tm-3416-archive-module-pagination-focus' into 'master' ([569c899](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/569c8990aea9643ef5f09684c784fa09fb42d0be))
|
|
28
|
+
* Merge branch 'tm-3416-archive-module-pagination-focus' into 'master' ([5c639be](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5c639be39274a3c79a4e58fbc1b6d4d0f5f4278d))
|
|
29
|
+
|
|
1
30
|
## [21.0.7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v21.0.6...v21.0.7) (2023-05-04)
|
|
2
31
|
|
|
3
32
|
|
package/gatsby-config.js
CHANGED
|
@@ -11,7 +11,7 @@ module.exports = {
|
|
|
11
11
|
esModule: false,
|
|
12
12
|
modules: {
|
|
13
13
|
namedExport: false,
|
|
14
|
-
localIdentName: '[name]__[local]', // customize the class name structure here
|
|
14
|
+
localIdentName: '[name]__[local]__[hash:base64:5]', // customize the class name structure here
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
additionalData: '@import "gatsby-core-theme/src/styles/globals.scss";',
|
package/gatsby-node.esm.js
CHANGED
|
@@ -220,6 +220,7 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
|
|
|
220
220
|
processed.pages[siteMarket][pageType].forEach((page) => {
|
|
221
221
|
marketSections = processed.market_sections[siteMarket];
|
|
222
222
|
prefilledModules = processed.prefilled_market_modules[siteMarket];
|
|
223
|
+
const allMarkets = processed.site_markets;
|
|
223
224
|
const processedPage = page;
|
|
224
225
|
processedPage.preconnect_links = preconnectLinks;
|
|
225
226
|
|
|
@@ -250,6 +251,7 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
|
|
|
250
251
|
const autogenerated = template && template.autogenerated_content;
|
|
251
252
|
const contextData = {
|
|
252
253
|
page,
|
|
254
|
+
allMarkets,
|
|
253
255
|
marketSections,
|
|
254
256
|
prefilledModules,
|
|
255
257
|
siteInfo,
|
package/package.json
CHANGED
|
@@ -5,15 +5,22 @@ import { FaAngleRight } from '@react-icons/all-files/fa/FaAngleRight';
|
|
|
5
5
|
import Link from '~hooks/link';
|
|
6
6
|
import styles from './module-title.module.scss';
|
|
7
7
|
|
|
8
|
-
const ModuleTitle = ({
|
|
8
|
+
const ModuleTitle = ({
|
|
9
|
+
module,
|
|
10
|
+
viewMoreIcon = <FaAngleRight />,
|
|
11
|
+
pageContext = null,
|
|
12
|
+
anchorLabel = null,
|
|
13
|
+
}) => {
|
|
9
14
|
const getTitle = (classname = '') => {
|
|
10
|
-
if (module.module_title_tag === 'h2') return <h2>{module.module_title}</h2>;
|
|
11
|
-
if (module.module_title_tag === 'h3') return <h3>{module.module_title}</h3>;
|
|
12
|
-
if (module.module_title_tag === 'h4') return <h4>{module.module_title}</h4>;
|
|
13
|
-
if (module.module_title_tag === 'h5') return <h5>{module.module_title}</h5>;
|
|
14
|
-
if (module.module_title_tag === 'h6') return <h6>{module.module_title}</h6>;
|
|
15
|
+
if (module.module_title_tag === 'h2') return <h2 id={anchorLabel}>{module.module_title}</h2>;
|
|
16
|
+
if (module.module_title_tag === 'h3') return <h3 id={anchorLabel}>{module.module_title}</h3>;
|
|
17
|
+
if (module.module_title_tag === 'h4') return <h4 id={anchorLabel}>{module.module_title}</h4>;
|
|
18
|
+
if (module.module_title_tag === 'h5') return <h5 id={anchorLabel}>{module.module_title}</h5>;
|
|
19
|
+
if (module.module_title_tag === 'h6') return <h6 id={anchorLabel}>{module.module_title}</h6>;
|
|
15
20
|
return (
|
|
16
|
-
<span className={`${styles?.noTag || ''} ${classname || ''}`}
|
|
21
|
+
<span className={`${styles?.noTag || ''} ${classname || ''}`} id={anchorLabel}>
|
|
22
|
+
{module.module_title}
|
|
23
|
+
</span>
|
|
17
24
|
);
|
|
18
25
|
};
|
|
19
26
|
// if (
|
|
@@ -61,6 +61,12 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
61
61
|
|
|
62
62
|
const ModuleComponent = GetModuleComponent(module);
|
|
63
63
|
|
|
64
|
+
const anchorLabel = module.anchor_label
|
|
65
|
+
? removeSymbols(anchorLink(module.anchor_label))
|
|
66
|
+
: module.name === 'archive'
|
|
67
|
+
? 'archiveLabel'
|
|
68
|
+
: null;
|
|
69
|
+
|
|
64
70
|
const extraProps =
|
|
65
71
|
module.name === 'bonus'
|
|
66
72
|
? {
|
|
@@ -69,7 +75,9 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
69
75
|
hasLink: true,
|
|
70
76
|
prettyLink: prettyTracker(module?.value, 'main', false, page.template),
|
|
71
77
|
}
|
|
72
|
-
: {
|
|
78
|
+
: {
|
|
79
|
+
anchorLabel,
|
|
80
|
+
};
|
|
73
81
|
|
|
74
82
|
const moduleClassName = `${module.name}Module`;
|
|
75
83
|
|
|
@@ -81,13 +89,13 @@ const Modules = ({ module, page, pageContext }) => {
|
|
|
81
89
|
return (
|
|
82
90
|
ModuleComponent && (
|
|
83
91
|
<div
|
|
84
|
-
id={module.
|
|
92
|
+
id={module.name === 'archive' && module.module_title ? null : anchorLabel}
|
|
85
93
|
style={module.background_color && moduleBackgroundColor}
|
|
86
94
|
className={`${styles[moduleClassName] !== undefined ? styles[moduleClassName] || '' : ''} ${
|
|
87
95
|
module.name || ''
|
|
88
96
|
} ${styles.module || ''} ${module?.style ? styles[module.style] || '' : ''} module`}
|
|
89
97
|
>
|
|
90
|
-
<ModuleTitle module={module} />
|
|
98
|
+
<ModuleTitle module={module} anchorLabel={module.name === 'archive' && anchorLabel} />
|
|
91
99
|
{ModuleIntro && <ModuleIntro module={{ value: module.module_introduction }} />}
|
|
92
100
|
<ModuleComponent module={module} page={page} pageContext={pageContext} {...extraProps} />
|
|
93
101
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
import Link from '~hooks/link';
|
|
@@ -13,11 +13,15 @@ const Pagination = ({
|
|
|
13
13
|
previousText = 'Previous',
|
|
14
14
|
nextText = 'Next',
|
|
15
15
|
numOfItems = 5,
|
|
16
|
+
anchorLabel,
|
|
16
17
|
}) => {
|
|
17
18
|
const numOfItemsEachSide = Math.ceil(numOfItems / 2);
|
|
18
19
|
|
|
19
20
|
function getPagePath(index) {
|
|
20
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
(index === 1 ? pagePath : `${pagePath}/page/${index}`) +
|
|
23
|
+
(anchorLabel ? `#${anchorLabel}` : '')
|
|
24
|
+
);
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
function generatePaginationList() {
|
|
@@ -45,6 +49,11 @@ const Pagination = ({
|
|
|
45
49
|
return pages;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const hash = window?.location?.hash?.replace('#', '');
|
|
54
|
+
document?.getElementById(hash)?.scrollIntoView();
|
|
55
|
+
});
|
|
56
|
+
|
|
48
57
|
return (
|
|
49
58
|
<ul className={styles.pagination || ''}>
|
|
50
59
|
{/* previous button */}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useEffect, useContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { MdLastPage } from '@react-icons/all-files/md/MdLastPage';
|
|
4
4
|
import { MdFirstPage } from '@react-icons/all-files/md/MdFirstPage';
|
|
@@ -18,18 +18,27 @@ const PaginationWithMidPoints = ({
|
|
|
18
18
|
nextComp = <MdChevronRight />,
|
|
19
19
|
firstComp = <MdFirstPage />,
|
|
20
20
|
lastComp = <MdLastPage />,
|
|
21
|
+
anchorLabel,
|
|
21
22
|
}) => {
|
|
22
23
|
const { translations } = useContext(Context) || {};
|
|
23
24
|
const current = Number(currentPage);
|
|
24
25
|
const total = Number(totalPages);
|
|
25
26
|
function getPagePath(index) {
|
|
26
|
-
return
|
|
27
|
+
return (
|
|
28
|
+
(index === 1 ? pagePath : `${pagePath}/page/${index}`) +
|
|
29
|
+
(anchorLabel ? `#${anchorLabel}` : '')
|
|
30
|
+
);
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
const midPage = (a, b) => Math.ceil((a + b) / 2);
|
|
30
34
|
const firstMidPage = midPage(0, current);
|
|
31
35
|
const lastMidPage = midPage(total, current);
|
|
32
36
|
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const hash = window?.location?.hash?.replace('#', '');
|
|
39
|
+
document?.getElementById(hash)?.scrollIntoView();
|
|
40
|
+
});
|
|
41
|
+
|
|
33
42
|
return (
|
|
34
43
|
<ul className={styles.pagination || ''}>
|
|
35
44
|
{/* got to first page */}
|
|
@@ -9,7 +9,7 @@ import { translate } from '~helpers/getters';
|
|
|
9
9
|
import { Context } from '~context/MainProvider';
|
|
10
10
|
import styles from './archive.module.scss';
|
|
11
11
|
|
|
12
|
-
const Archive = ({ module, PaginationComponent, page, loadMore, gtmClass = '' }) => {
|
|
12
|
+
const Archive = ({ module, PaginationComponent, page, loadMore, gtmClass = '', anchorLabel }) => {
|
|
13
13
|
const [moduleItems, setModuleItems] = useState([...module.items]);
|
|
14
14
|
const updatedModule = { ...module };
|
|
15
15
|
const hasLoadMore = module.pagination_type === 'load_more';
|
|
@@ -55,12 +55,14 @@ const Archive = ({ module, PaginationComponent, page, loadMore, gtmClass = '' })
|
|
|
55
55
|
pagePath={module.rootPath}
|
|
56
56
|
currentPage={module.currentPage}
|
|
57
57
|
totalPages={module.numOfPages}
|
|
58
|
+
anchorLabel={anchorLabel}
|
|
58
59
|
/>
|
|
59
60
|
) : (
|
|
60
61
|
<Pagination
|
|
61
62
|
pagePath={module.rootPath}
|
|
62
63
|
currentPage={module.currentPage}
|
|
63
64
|
totalPages={module.numOfPages}
|
|
65
|
+
anchorLabel={anchorLabel}
|
|
64
66
|
/>
|
|
65
67
|
)}
|
|
66
68
|
</>
|
package/storybook/.ci.yml
CHANGED
|
@@ -31,7 +31,6 @@ Storybook Deploy:
|
|
|
31
31
|
- gatsby-runner-dev-1
|
|
32
32
|
script:
|
|
33
33
|
- mkdir -p ~/.ssh
|
|
34
|
-
- ssh-keyscan -H storybook >> ~/.ssh/known_hosts
|
|
35
34
|
- echo "$FLOYD_ROOT_KEY" > ~/.ssh/id_rsa
|
|
36
35
|
- chmod 600 ~/.ssh/id_rsa
|
|
37
36
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
|