gatsby-core-theme 1.6.6 → 1.6.10

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 CHANGED
@@ -1,3 +1,56 @@
1
+ ## [1.6.10](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.9...v1.6.10) (2021-11-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sitemap changed to a page from hercules ([a0e90e4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a0e90e4916fcc0a2918dde39971265cc48fe89da))
7
+ * sitemap fixes ([7c35ba4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/7c35ba42cf54a937800140387b84278479caad92))
8
+
9
+
10
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([a75119b](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a75119b9e50cf2f5143242dcedc49b54abcfb6ce))
11
+
12
+ ## [1.6.9](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.8...v1.6.9) (2021-11-24)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * scroll-to-top fix ([8f7264c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/8f7264cac3d4c0b11daaf1ddf5f08539e1bc5473))
18
+
19
+
20
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/gatsby-themes ([3d4fc0d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/3d4fc0d86f199761b32785f0ced0ae1c8c3c5ebb))
21
+
22
+ ## [1.6.8](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.7...v1.6.8) (2021-11-24)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * non main trackers ([adb1c71](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/adb1c71f34e7bc552696b358ea1cbbccf7b3d2e3))
28
+
29
+ ## [1.6.7](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.6...v1.6.7) (2021-11-24)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * added translations to the archive page and fixes for link list ([69ebe2e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/69ebe2ef1fea637a093436ab015aa26058f9fde1))
35
+ * fix some more links without accessible name ([2e8f905](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2e8f9053369a69c67935e45490f3c5cafdebd4c1))
36
+ * fixes on accesibility ([6689ff1](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6689ff182b750ef70143bdce779889805d88be02))
37
+ * tab change lazyload issue ([a1c30c2](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a1c30c2a98a23048f653cd0d56f9a17d0e7affbd))
38
+
39
+
40
+ ### Code Refactoring
41
+
42
+ * fixes on accessbility ([de7482a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/de7482ae746bc60e8939ed6031a6b883f61e2954))
43
+
44
+
45
+ ### Config
46
+
47
+ * changing sitename for testing purposes ([391c01c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/391c01c7668771feacb551c4ae4e022c7c90db93))
48
+
49
+
50
+ * Merge branch 'tm-2605-translations-in-archive' into 'master' ([9be0770](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/9be07704de3e011af549f76ff67e570264766dc0))
51
+ * Merge branch 'tm-2595-accessibility-scores' into 'master' ([c63653f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/c63653f1bdac5e6abfa5a49d9029b7de8cd23e33))
52
+ * Merge branch 'tm-2478-search' into 'master' ([a4fbd15](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a4fbd1528bcf9cde03dc2097e9b79c618a0f544a))
53
+
1
54
  ## [1.6.6](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.5...v1.6.6) (2021-11-23)
2
55
 
3
56
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-unused-vars */
1
2
  /* eslint no-console: ["error", { allow: ["log"] }], no-shadow: ["error", { "allow": ["marketSections", "prefilledModules"] }] */
2
3
  /* eslint-disable dot-notation */
3
4
 
@@ -72,7 +73,7 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
72
73
  createPage({
73
74
  path: page.path,
74
75
  component: require.resolve(appName),
75
- context: { page, marketSections, prefilledModules, siteInfo },
76
+ context: { page, marketSections, prefilledModules, siteInfo, translations },
76
77
  });
77
78
  });
78
79
  } else {
@@ -84,7 +85,7 @@ function createArchivePage(pageObject, marketSections, prefilledModules, createP
84
85
  createPage({
85
86
  path: page.path,
86
87
  component: require.resolve(appName),
87
- context: { page, marketSections, prefilledModules, siteInfo },
88
+ context: { page, marketSections, prefilledModules, siteInfo, translations },
88
89
  });
89
90
  }
90
91
  }
@@ -233,6 +234,12 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
233
234
  });
234
235
  } else if (page.path === '404') {
235
236
  context404 = contextData;
237
+ } else if (page.path === 'sitemap') {
238
+ createPage({
239
+ path: `/${page.path}`,
240
+ component: require.resolve('./src/components/app.js'),
241
+ context: { ...contextData, sitemapData: { ...htmlSitemapPages }, templates },
242
+ });
236
243
  } else {
237
244
  createPage({
238
245
  path: page.path.charAt(0) === '/' ? page.path : `/${page.path}`,
@@ -297,31 +304,7 @@ exports.createPages = async ({ actions: { createPage } }, themeOptions) => {
297
304
  exports.onCreatePage = ({ page, actions }) => {
298
305
  const { createPage } = actions;
299
306
 
300
- if (page.path.includes('sitemap')) {
301
- const pageNotFoundData = {
302
- meta_title: 'Sitemap',
303
- template: 'sitemap',
304
- title: 'Site Map',
305
- type: 'page',
306
- sections: {
307
- main: null,
308
- navigation: null,
309
- sidebar: null,
310
- footer: null,
311
- },
312
- language: languageKey,
313
- translations,
314
- relation: {
315
- sports,
316
- },
317
- };
318
- page = Object.assign(pageNotFoundData, page); // eslint-disable-line no-param-reassign
319
- createPage({
320
- path: page.path,
321
- component: require.resolve('./src/pages/sitemap/'),
322
- context: { page, siteInfo, marketSections, sitemapData: { ...htmlSitemapPages }, templates },
323
- });
324
- } else if (page.path.includes('404')) {
307
+ if (page.path.includes('404')) {
325
308
  createPage({
326
309
  path: page.path,
327
310
  component: require.resolve('./src/pages/404/'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.6.6",
3
+ "version": "1.6.10",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -60,7 +60,8 @@
60
60
  "react-google-recaptcha": "^2.1.0",
61
61
  "react-helmet": "^6.0.0",
62
62
  "react-icons": "^4.2.0",
63
- "react-lazyload": "^2.6.5"
63
+ "react-lazyload": "^2.6.5",
64
+ "react-masonry-css": "^1.0.16"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@babel/core": "^7.13.1",
@@ -20,7 +20,13 @@ const Author = ({
20
20
  <>
21
21
  {link && icon && (
22
22
  <div className={styles.authorIcon}>
23
- <a href={link} target="_blank" rel="noreferrer" className="author-gtm">
23
+ <a
24
+ href={link}
25
+ target="_blank"
26
+ rel="noreferrer"
27
+ aria-label={`${name} Link`}
28
+ className="author-gtm"
29
+ >
24
30
  {icon}
25
31
  </a>
26
32
  </div>
@@ -73,6 +73,7 @@ export default function AuthorBox({ author }) {
73
73
  target="_blank"
74
74
  rel="noreferrer"
75
75
  key={`author-box-link-${filteredLinks.id}`}
76
+ aria-label={`${filteredLinks.id} Link`}
76
77
  >
77
78
  {filteredLinks.icon}
78
79
  </a>
@@ -16,6 +16,7 @@ const Logo = ({ item = {} }) => {
16
16
  title={item.name}
17
17
  target="_blank"
18
18
  rel="noopener noreferrer"
19
+ aria-label={`${item.name} Link`}
19
20
  >
20
21
  <LazyImage alt={item.name} src={imagePrettyUrl(item.logo_url)} />
21
22
  </a>
@@ -55,6 +55,7 @@ export default function Item({
55
55
  >
56
56
  {item.value?.includes('http') || item.value?.includes('www') ? (
57
57
  <a
58
+ aria-label={`${item?.title} link`}
58
59
  href={item.value}
59
60
  title={item.title}
60
61
  rel={`noreferrer ${item.nofollow && 'nofollow'}`}
@@ -82,6 +83,7 @@ export default function Item({
82
83
  to={item.value ? item.value : '#'}
83
84
  title={item.title}
84
85
  rel={item.nofollow && 'nofollow'}
86
+ aria-label={`${item?.title} link`}
85
87
  >
86
88
  <ItemImage />
87
89
  {item.title}
@@ -89,6 +91,7 @@ export default function Item({
89
91
  )}
90
92
  {options.mobile.subMenuDropDownButton && isMobile && hasChildren && (
91
93
  <button
94
+ aria-label={`${item?.title} Dropdown`}
92
95
  type="button"
93
96
  className={`${gtmClass} btn-cta`}
94
97
  onClick={(e) => {
@@ -30,6 +30,7 @@ const OpenGraph = ({ page, text = 'Share: ' }) => {
30
30
  role="button"
31
31
  className={`${styles.btn} open-graph-gtm`}
32
32
  onClick={(e) => share(e, 555, 602)}
33
+ aria-label="Facebook Link"
33
34
  >
34
35
  <FaFacebookF />
35
36
  </a>
@@ -40,6 +41,7 @@ const OpenGraph = ({ page, text = 'Share: ' }) => {
40
41
  role="button"
41
42
  className={`${styles.btn} open-graph-gtm`}
42
43
  onClick={(e) => share(e, 555, 255)}
44
+ aria-label="Twitter Link"
43
45
  >
44
46
  <FaTwitter />
45
47
  </a>
@@ -1,25 +1,42 @@
1
- import React from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- import { registerScroll } from '~helpers/scroll';
5
4
  import styles from './scroll-to-top.module.scss';
6
5
 
7
6
  const ScrollToTop = ({ scrollTo = '0' }) => {
8
- registerScroll();
9
-
10
- function scrollToTop(e) {
11
- e.preventDefault();
12
- window.scrollTo({
13
- top: scrollTo,
14
- behavior: 'smooth',
15
- });
16
- }
7
+ const [showScroll, setShowScroll] = useState(false);
8
+
9
+ const checkScrollTop = () => {
10
+ if (!showScroll && window.pageYOffset > 400) {
11
+ setShowScroll(true);
12
+ } else if (showScroll && window.pageYOffset <= 400) {
13
+ setShowScroll(false);
14
+ }
15
+ };
16
+
17
+ const scrollTop = () => {
18
+ window.scrollTo({ top: scrollTo, behavior: 'smooth' });
19
+ };
20
+
21
+ useEffect(() => {
22
+ if (typeof window !== 'undefined') {
23
+ window.addEventListener('scroll', checkScrollTop);
24
+
25
+ return () => {
26
+ window.removeEventListener('scroll', checkScrollTop);
27
+ };
28
+ }
29
+
30
+ return null;
31
+ });
32
+
17
33
  return (
18
34
  <button
19
35
  type="button"
20
36
  aria-label="Scroll to top"
21
- onClick={(e) => scrollToTop(e)}
37
+ onClick={(e) => scrollTop(e)}
22
38
  className={styles.scrollToTop}
39
+ style={{ display: showScroll ? 'flex' : 'none' }}
23
40
  />
24
41
  );
25
42
  };
@@ -1,3 +1,9 @@
1
+ body[data-scroll='0'] {
2
+ .scrollToTop {
3
+ opacity: 0;
4
+ }
5
+ }
6
+
1
7
  .scrollToTop {
2
8
  z-index: map-get($z-index, scroll-to-top);
3
9
  border-radius: 50%;
@@ -6,9 +12,12 @@
6
12
  width: 64px;
7
13
  height: 64px;
8
14
  text-align: center;
9
-
15
+ bottom: 0;
16
+ position: fixed;
17
+ right: 0;
18
+
10
19
  &:before {
11
- @include arrow(#fff, 2rem, up, false);
20
+ @include arrow(#000, 2rem, up, false);
12
21
  position: absolute;
13
22
  bottom: calc(50% - 1.25rem);
14
23
  left: calc(50% - 1rem);
@@ -1,18 +1,27 @@
1
1
  /* eslint-disable array-callback-return */
2
2
  /* eslint-disable react/forbid-prop-types */
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
4
  import PropTypes from 'prop-types';
5
+ import { BiSitemap } from 'react-icons/bi';
6
+ import { IoMdLink } from 'react-icons/io';
7
+ // eslint-disable-next-line import/no-extraneous-dependencies
8
+ import Masonry from 'react-masonry-css';
9
+ import { Context } from '~context/TranslationsProvider';
10
+ import { translate } from '~helpers/getters';
5
11
  import styles from './sitemap.module.scss';
6
- import Body from '~pages/body';
7
- import Head from '~organisms/head';
8
12
  import Link from '~hooks/link';
9
13
 
10
- const Sitemap = ({ pageContext, templateIcon, linkIcon }) => {
14
+ const Sitemap = ({ pageContext, templateIcon = <BiSitemap />, linkIcon = <IoMdLink /> }) => {
11
15
  const { templates, sitemapData } = pageContext;
16
+ const { translations } = useContext(Context) || {};
12
17
  const market = Object.keys(sitemapData)[0];
13
18
 
14
19
  const getTemplateName = (template) => {
15
- const templateName = templates[template].short_name.replace('_', ' ');
20
+ const templateName = translate(
21
+ translations,
22
+ templates[template].short_name,
23
+ templates[template].short_name.replace('_', ' ')
24
+ );
16
25
  const templatePages = sitemapData[market][template];
17
26
  const templatePagesCount = templatePages && templatePages.length;
18
27
 
@@ -47,19 +56,14 @@ const Sitemap = ({ pageContext, templateIcon, linkIcon }) => {
47
56
  };
48
57
 
49
58
  return (
50
- <>
51
- <Head page={pageContext.page} siteInfo={pageContext.siteInfo} />
52
- <Body pageContext={pageContext}>
53
- <div className={styles.container}>
54
- {Object.keys(templates).map((template) => (
55
- <ul key={template} className={styles.list}>
56
- {getTemplateName(template)}
57
- {getTemplatePages(template)}
58
- </ul>
59
- ))}
60
- </div>
61
- </Body>
62
- </>
59
+ <Masonry breakpointCols={3} className={styles.container} columnClassName={styles.list}>
60
+ {Object.keys(templates).map((template) => (
61
+ <ul key={template}>
62
+ {getTemplateName(template)}
63
+ {getTemplatePages(template)}
64
+ </ul>
65
+ ))}
66
+ </Masonry>
63
67
  );
64
68
  };
65
69
 
@@ -67,8 +71,6 @@ Sitemap.propTypes = {
67
71
  pageContext: PropTypes.shape({
68
72
  sitemapData: PropTypes.object,
69
73
  templates: PropTypes.object,
70
- siteInfo: PropTypes.object,
71
- page: PropTypes.object,
72
74
  }),
73
75
  templateIcon: PropTypes.element,
74
76
  linkIcon: PropTypes.element,
@@ -0,0 +1,111 @@
1
+ .container {
2
+ display: flex;
3
+ max-width: var(--main-container-max);
4
+ margin: 0 auto;
5
+ padding: 0 2.4rem 2rem 2.4rem;
6
+
7
+ @include min(mobile) {
8
+ padding: 0 1.6rem 2rem 1.6rem;
9
+ }
10
+
11
+ @include max(mobile) {
12
+ display: block;
13
+ }
14
+ }
15
+
16
+ .list {
17
+ @include max(mobile) {
18
+ width: 100% !important;
19
+ }
20
+
21
+ > ul {
22
+ display: flex;
23
+ flex-direction: column;
24
+ padding: 1rem;
25
+
26
+ > div {
27
+ position: relative;
28
+ @include flex-align(center, flex-start);
29
+
30
+ svg {
31
+ fill: white !important;
32
+ background-color: var(--template-name-icon-background, red);
33
+ padding: 1rem;
34
+ width: 4.8rem;
35
+ height: 4.8rem;
36
+ border-radius: 2.8rem;
37
+ }
38
+
39
+ > span {
40
+ color: black;
41
+ font-weight: 700;
42
+ font-size: 2rem;
43
+ margin-left: 1.6rem;
44
+ text-transform: capitalize;
45
+ }
46
+
47
+ span:last-child {
48
+ @include flex-align(center, center);
49
+ position: absolute;
50
+ top: -1.2rem;
51
+ background-color: var(--page-number-background, green);
52
+ border-radius: 1.2rem;
53
+ border: 0.2rem solid white;
54
+ margin: 0;
55
+ font-size: 1rem;
56
+ color: var(--page-number-color, white);
57
+ font-weight: 700;
58
+ width: 2.4rem;
59
+ height: 2.4rem;
60
+ left: 3.2rem;
61
+ }
62
+ }
63
+
64
+ > ul {
65
+ padding-top: 3rem;
66
+ padding-left: 2.7rem;
67
+ margin-left: 2.3rem;
68
+ border-left: dashed 1px #e3e6ef;
69
+
70
+ li {
71
+ display: grid;
72
+ grid-template-columns: 0.1fr 1fr;
73
+ gap: 0.5rem;
74
+ margin-bottom: 1rem;
75
+ position: relative;
76
+
77
+ &:before {
78
+ content: ' ';
79
+ position: absolute;
80
+ left: -2.7rem;
81
+ width: 2.5rem;
82
+ top: 1.2rem;
83
+ border: dashed 1px #e3e6ef;
84
+ }
85
+
86
+ &:last-child:after {
87
+ content: ' ';
88
+ width: 1rem;
89
+ height: 5rem;
90
+ background-color: var(--sitemap-background-color);
91
+ position: absolute;
92
+ top: 1.3rem;
93
+ left: -2.8rem;
94
+ }
95
+
96
+ svg {
97
+ fill: white !important;
98
+ background-color: #6e6e84;
99
+ padding: 0.3rem;
100
+ width: 2.4rem;
101
+ height: 2.4rem;
102
+ border-radius: 0.8rem;
103
+ }
104
+
105
+ a {
106
+ padding-left: 0.3rem;
107
+ }
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,96 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import React from 'react';
3
+ import {
4
+ Title,
5
+ Description,
6
+ Primary,
7
+ PRIMARY_STORY,
8
+ ArgsTable,
9
+ } from '@storybook/addon-docs/blocks';
10
+
11
+ import Sitemap from '.';
12
+
13
+ export default {
14
+ title: 'Gatsby-Theme/Atoms/Sitemap',
15
+ component: Sitemap,
16
+ argTypes: {
17
+ // pageContext: {
18
+ // name: 'sitemapData',
19
+ // type: { name: 'object', required: true },
20
+ // defaultValue: null,
21
+ // description: 'Object containing all links grouped by page type.',
22
+ // table: {
23
+ // type: { summary: 'object' },
24
+ // defaultValue: { summary: null },
25
+ // },
26
+ // },
27
+ },
28
+ parameters: {
29
+ docs: {
30
+ description: {
31
+ component: 'An HTML sitemap showing all pages as links',
32
+ },
33
+ page: () => (
34
+ <>
35
+ <Title />
36
+ <Description />
37
+ <Primary />
38
+ <ArgsTable story={PRIMARY_STORY} />
39
+ </>
40
+ ),
41
+ },
42
+ },
43
+ };
44
+
45
+ const Template = (args) => <Sitemap {...args} />;
46
+
47
+ export const Default = Template.bind({});
48
+ Default.args = {
49
+ pageContext: {
50
+ sitemapData: {
51
+ ie_en: {
52
+ 1: [
53
+ {
54
+ title: 'test one',
55
+ path: '/test_one',
56
+ },
57
+ {
58
+ title: 'test two',
59
+ path: '/test_two',
60
+ },
61
+ {
62
+ title: 'test three',
63
+ path: '/test_three',
64
+ },
65
+ ],
66
+ 2: [
67
+ {
68
+ title: 'template page one',
69
+ path: '/template_page_one',
70
+ },
71
+ {
72
+ title: 'template page two',
73
+ path: '/template_page_two',
74
+ },
75
+ ],
76
+ 3: [
77
+ {
78
+ title: 'template two page',
79
+ path: 'template_teo_page',
80
+ },
81
+ ],
82
+ },
83
+ },
84
+ templates: {
85
+ 1: {
86
+ short_name: 'template one',
87
+ },
88
+ 2: {
89
+ short_name: 'template two',
90
+ },
91
+ 3: {
92
+ short_name: 'template three',
93
+ },
94
+ },
95
+ },
96
+ };
@@ -18,39 +18,37 @@ const LinkList = ({
18
18
  listIcon = <></>,
19
19
  multiIcon = false,
20
20
  classes,
21
- once = false,
21
+ disableLazyLoad = false,
22
22
  height,
23
23
  width,
24
24
  gtmClass = '',
25
25
  }) => {
26
26
  function renderLinkContent(item, index) {
27
27
  const icon = listIcon[index];
28
+
29
+ const LinkImage = () => {
30
+ return disableLazyLoad ? (
31
+ <img src={imagePrettyUrl(item.image)} width={width} height={height} alt={item.title} />
32
+ ) : (
33
+ <LazyImage
34
+ src={imagePrettyUrl(item.image)}
35
+ alt={item.title}
36
+ width={width}
37
+ height={height}
38
+ />
39
+ );
40
+ };
41
+
28
42
  return (
29
43
  <>
30
44
  {!imageOnly && (
31
45
  <>
32
46
  {multiIcon ? icon : listIcon}
33
47
  <span>{item.title}</span>
34
- {item.image && (
35
- <LazyImage
36
- src={imagePrettyUrl(item.image)}
37
- alt={item.title}
38
- once={once}
39
- width={width}
40
- height={height}
41
- />
42
- )}
48
+ {item.image && <LinkImage />}
43
49
  </>
44
50
  )}
45
- {item.image && imageOnly && (
46
- <LazyImage
47
- src={imagePrettyUrl(item.image)}
48
- alt={item.title}
49
- once={once}
50
- width={width}
51
- height={height}
52
- />
53
- )}
51
+ {item.image && imageOnly && <LinkImage />}
54
52
  </>
55
53
  );
56
54
  }
@@ -66,6 +64,7 @@ const LinkList = ({
66
64
  rel={`noreferrer ${item.nofollow && 'nofollow'}`}
67
65
  target="_blank"
68
66
  className={gtmClass}
67
+ aria-label={`${item.title} Link`}
69
68
  >
70
69
  {renderLinkContent(item, index)}
71
70
  </a>
@@ -75,6 +74,7 @@ const LinkList = ({
75
74
  title={item.title}
76
75
  className={gtmClass}
77
76
  rel={item.nofollow && 'nofollow'}
77
+ aria-label={`${item.title} Link`}
78
78
  >
79
79
  {renderLinkContent(item, index)}
80
80
  </Link>
@@ -130,7 +130,7 @@ LinkList.propTypes = {
130
130
  listIcon: PropTypes.oneOfType([PropTypes.element, PropTypes.any, PropTypes.node]),
131
131
  multiIcon: PropTypes.bool,
132
132
  classes: PropTypes.string,
133
- once: PropTypes.bool,
133
+ disableLazyLoad: PropTypes.bool,
134
134
  width: PropTypes.number,
135
135
  height: PropTypes.number,
136
136
  gtmClass: PropTypes.string,
@@ -70,8 +70,8 @@ export default {
70
70
  type: null,
71
71
  },
72
72
  },
73
- once: {
74
- name: 'once',
73
+ disableLazyLoad: {
74
+ name: 'disableLazyLoad',
75
75
  type: { name: 'boolean', required: false },
76
76
  defaultValue: '',
77
77
  description:
@@ -5,14 +5,17 @@ import Module from '~molecules/module';
5
5
  import styles from './main.module.scss';
6
6
  import keygen from '~helpers/keygen';
7
7
 
8
- const Main = ({ section = {}, page = {}, pageContext = {} }) => {
8
+ const Main = ({ section = {}, pageContext = {} }) => {
9
+ const { page } = pageContext;
9
10
  const SearchPage = page.path === 's' ? loadable(() => import(`~pages/search`)) : null;
11
+ const HtmlSitemap = page.path === 'sitemap' ? loadable(() => import(`~atoms/sitemap`)) : null;
10
12
  const AuthorBox = page.author ? loadable(() => import(`~atoms/author-box`)) : null;
11
13
  const NotFound = page?.path?.includes('404') ? loadable(() => import(`~atoms/not-found`)) : null;
12
14
 
13
15
  return (
14
16
  <main className={styles.modulePage}>
15
17
  {NotFound && <NotFound />}
18
+ {HtmlSitemap && <HtmlSitemap pageContext={pageContext} />}
16
19
  {section.modules &&
17
20
  section.modules.map((module) => (
18
21
  <Module key={keygen()} module={module} page={page} pageContext={pageContext} />
@@ -10,16 +10,16 @@ const section = {
10
10
  modules: [
11
11
  {
12
12
  name: 'content',
13
- ...getSingleContentData()
13
+ ...getSingleContentData(),
14
14
  },
15
15
  ],
16
16
  };
17
17
 
18
- const pagePath = 's';
18
+ const pageObject = { page: { path: 's' } };
19
19
 
20
20
  describe('Main Component', () => {
21
21
  test('render main', async () => {
22
- const { container, getByText } = render(<Main section={section} pagePath={pagePath} />);
22
+ const { container, getByText } = render(<Main section={section} pageContext={pageObject} />);
23
23
  expect(container).toBeTruthy();
24
24
  expect(container.querySelectorAll('main.modulePage')).toHaveLength(1);
25
25
 
@@ -47,6 +47,7 @@ export default function OperatorBanner({
47
47
  title={operator?.name}
48
48
  target="_blank"
49
49
  rel="noreferrer"
50
+ aria-label={`${operator?.name} Link`}
50
51
  >
51
52
  <LazyImage alt={operator?.name} src={imagePrettyUrl(logo)} />
52
53
  </a>
@@ -34,6 +34,7 @@ const PaginationWithMidPoints = ({
34
34
  <Link
35
35
  to={getPagePath(1)}
36
36
  className={`${styles.button} ${styles.isActive} pagination-gtm`}
37
+ aria-label="Go to First Page"
37
38
  >
38
39
  {firstComp}
39
40
  </Link>
@@ -47,6 +48,7 @@ const PaginationWithMidPoints = ({
47
48
  <Link
48
49
  to={getPagePath(current - 1)}
49
50
  className={`${styles.button} ${styles.isActive} pagination-gtm`}
51
+ aria-label="Previous Button"
50
52
  >
51
53
  {previousComp}
52
54
  </Link>
@@ -128,6 +130,7 @@ const PaginationWithMidPoints = ({
128
130
  <Link
129
131
  to={getPagePath(current + 1)}
130
132
  className={`${styles.button} ${styles.isActive} pagination-gtm`}
133
+ aria-label="Next Button"
131
134
  >
132
135
  {nextComp}
133
136
  </Link>
@@ -141,6 +144,7 @@ const PaginationWithMidPoints = ({
141
144
  <Link
142
145
  to={getPagePath(total)}
143
146
  className={`${styles.button} ${styles.isActive} pagination-gtm`}
147
+ aria-label="Go to Last"
144
148
  >
145
149
  {lastComp}
146
150
  </Link>
@@ -31,6 +31,7 @@ const Row = ({ item, oneliner = 'main', layout = 'list' }) => {
31
31
  className="casinos-top-list-gtm logo-cta"
32
32
  target="_blank"
33
33
  rel="noreferrer"
34
+ aria-label={`${item.name} Link`}
34
35
  >
35
36
  <LazyImage alt={item.name} src={imagePrettyUrl(item.logo_url, 100)} />
36
37
  </a>
@@ -62,7 +62,12 @@ const Navigation = ({
62
62
  >
63
63
  <nav className={styles.nav} style={{ justifyContent: logoPosition }} ref={navRef}>
64
64
  <NavigationProvider>
65
- <Link className={`${styles.logo} main-menu-gtm logo-cta`} to="/" onClick={onClickHandler}>
65
+ <Link
66
+ className={`${styles.logo} main-menu-gtm logo-cta`}
67
+ aria-label="Nav Logo"
68
+ to="/"
69
+ onClick={onClickHandler}
70
+ >
66
71
  <img alt="logo" src={logo} width={logoWidth} height={logoHeight} />
67
72
  </Link>
68
73
  {showMenu && (
@@ -24,7 +24,7 @@ function Body({ pageContext, children }) {
24
24
  <>
25
25
  {navigation && <Navigation template={template} section={navigation} />}
26
26
  {!is404 && <Header section={pageContext} />}
27
- {main && !children && <Main section={main} page={pageContext.page} />}
27
+ {main && !children && <Main section={main} pageContext={pageContext} />}
28
28
  {children && <main>{children}</main>}
29
29
  {Sidebar && <Sidebar section={sidebar} />}
30
30
  <ScrollToTop />
@@ -28,7 +28,10 @@ const Tracker = ({
28
28
  for (let i = 0; i < trackerLinks.length; i += 1) {
29
29
  const trackerLink = trackerLinks[i].toLowerCase().replace(' ', '_');
30
30
  if (path.includes(trackerLink)) {
31
- tracker = operator.links[trackerLink];
31
+ tracker =
32
+ operator.links[
33
+ Object.keys(operator.links).find((key) => key.toLowerCase() === trackerLink.toLowerCase())
34
+ ];
32
35
  break;
33
36
  }
34
37
  if (path.includes('ppc_fallback')) {
@@ -25,7 +25,7 @@ const Tabs = ({
25
25
 
26
26
  function onClickTabItem(tabId) {
27
27
  setActiveTab(tabId);
28
- forceCheck();
28
+ setTimeout(forceCheck);
29
29
  }
30
30
 
31
31
  return (
@@ -77,6 +77,12 @@
77
77
  --second-table-background: var(--color-17);
78
78
  --secondary-module-background: var(--color-42);
79
79
 
80
+ // HTML Sitemap
81
+ --template-name-icon-background: #ff893f;
82
+ --page-number-background: #393939;
83
+ --page-number-color: #fff;
84
+ --sitemap-background-color: #fff;
85
+
80
86
  --storybook-soccer: var(--color-45);
81
87
  --storybook-tennis: var(--color-46);
82
88
  --storybook-handball: var(--color-47);
@@ -1,21 +0,0 @@
1
-
2
- .container {
3
- display: flex;
4
- flex-flow: row;
5
- }
6
-
7
- .list {
8
- display: flex;
9
- flex-direction: column;
10
-
11
- padding: 1rem;
12
-
13
- > div {
14
- font-weight: 700;
15
- font-size: 1.6rem;
16
- }
17
-
18
- >ul {
19
- padding-top: 2rem;
20
- }
21
- }