gatsby-matrix-theme 45.0.2 → 45.0.4

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.
Files changed (25) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/cards/comparison-table/table/index.js +0 -1
  4. package/src/components/atoms/table/column/index.js +3 -4
  5. package/src/components/molecules/cookie-modal/index.js +6 -2
  6. package/src/components/molecules/horse-calculator/index.js +9 -6
  7. package/src/components/organisms/cards/template-two/buttons/index.js +2 -0
  8. package/src/components/organisms/popup/index.js +2 -1
  9. package/src/gatsby-core-theme/components/molecules/main/index.js +1 -1
  10. package/src/gatsby-core-theme/components/molecules/search/search.module.scss +18 -32
  11. package/src/gatsby-core-theme/components/pages/search/index.js +5 -1
  12. package/src/gatsby-core-theme/components/pages/search/search.module.scss +2 -41
  13. package/src/gatsby-core-theme/helpers/server-data.js +30 -5
  14. package/src/gatsby-core-theme/hooks/tabs/tabs.module.scss +1 -1
  15. package/storybook/public/{251.c87ec048.iframe.bundle.js → 251.f40ce6cc.iframe.bundle.js} +4 -4
  16. package/storybook/public/{251.c87ec048.iframe.bundle.js.map → 251.f40ce6cc.iframe.bundle.js.map} +1 -1
  17. package/storybook/public/776.076dac5d.iframe.bundle.js +1 -0
  18. package/storybook/public/iframe.html +1 -1
  19. package/storybook/public/main.3efecd4d.iframe.bundle.js +1 -0
  20. package/storybook/public/project.json +1 -1
  21. package/storybook/public/{runtime~main.b60950da.iframe.bundle.js → runtime~main.f90c8371.iframe.bundle.js} +1 -1
  22. package/src/gatsby-core-theme/components/molecules/search/index.js +0 -503
  23. package/storybook/public/776.44fd86a4.iframe.bundle.js +0 -1
  24. package/storybook/public/main.86d48cf5.iframe.bundle.js +0 -1
  25. /package/storybook/public/{251.c87ec048.iframe.bundle.js.LICENSE.txt → 251.f40ce6cc.iframe.bundle.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ## [45.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v45.0.3...v45.0.4) (2024-06-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * search refactoring ([909d273](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/909d273084b4e1f185dd6bb4dab3087127060139))
7
+ * updated with latest version ([4ab185c](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4ab185c55aa17bf563d4f50d91260e0467639b25))
8
+
9
+ ## [45.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v45.0.2...v45.0.3) (2024-06-25)
10
+
11
+
12
+ ### Code Refactoring
13
+
14
+ * button popup ([6629bb2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/6629bb2c8c2283f4b129c37fab5143bf1addeb56))
15
+ * changes to aria buttons ([0037730](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0037730a4f2d90124416f8cbb55596ac677c3ba0))
16
+ * changes to aria labels buttons ([94064b9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/94064b991fb3f39f6c058de582fd6599785daa09))
17
+
18
+
19
+ ### Config
20
+
21
+ * update theme ([87ebae8](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/87ebae8eb1c9750bb58c64f220346b257d26f635))
22
+
23
+
24
+ * Merge branch 'tm-4505-aria-buttons' into 'master' ([3992f84](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/3992f84034384559c0737d84e6887cb4cf885be5))
25
+
1
26
  ## [45.0.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v45.0.1...v45.0.2) (2024-06-24)
2
27
 
3
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "45.0.2",
3
+ "version": "45.0.4",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "gatsby": "^5.11.0",
28
- "gatsby-core-theme": "33.1.0",
28
+ "gatsby-core-theme": "33.1.3",
29
29
  "gatsby-plugin-sharp": "^5.11.0",
30
30
  "gatsby-transformer-sharp": "^5.11.0",
31
31
  "prop-types": "15.7.2",
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-a11y/control-has-associated-label */
2
1
  /* eslint-disable react/forbid-prop-types */
3
2
  /* eslint-disable import/no-extraneous-dependencies */
4
3
  /* eslint-disable jsx-a11y/click-events-have-key-events */
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-a11y/control-has-associated-label */
2
1
  /* eslint-disable react/forbid-prop-types */
3
2
  /* eslint-disable camelcase */
4
3
  import React from 'react';
@@ -82,7 +81,7 @@ const Index = ({
82
81
  </td>
83
82
  </tr>
84
83
  <tr style={{ height: rating }} id="rating">
85
- <td>
84
+ <td aria-label="rating">
86
85
  <div className={styles?.rating || ''}>
87
86
  <StarRating
88
87
  numOfStars={5}
@@ -113,7 +112,7 @@ const Index = ({
113
112
  </td>
114
113
  </tr>
115
114
  <tr style={{ height: topFeatures, display: hideRow ? 'none' : null }} id="topFeatures">
116
- <td>
115
+ <td aria-label="top features">
117
116
  <div className={styles?.features || ''}>
118
117
  <SellingPoints
119
118
  icon={<FaCheck size={35} color="#17182F" title="Check Icon" />}
@@ -124,7 +123,7 @@ const Index = ({
124
123
  </td>
125
124
  </tr>
126
125
  <tr style={{ height: banking, display: hideRow ? 'none' : null }} id="banking">
127
- <td>
126
+ <td aria-label="banking">
128
127
  <div className={styles?.banking || ''}>
129
128
  <Banking
130
129
  min_deposit={min_deposit}
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
- /* eslint-disable jsx-a11y/control-has-associated-label */
3
2
  /* eslint-disable jsx-a11y/no-redundant-roles */
4
3
  import React, { useContext, useState, useRef, useEffect } from 'react';
5
4
  import PropTypes from 'prop-types';
@@ -99,7 +98,12 @@ const CookieModal = ({
99
98
  </span>
100
99
  )}
101
100
 
102
- <button role="button" type="button" onClick={() => closeModal()}>
101
+ <button
102
+ role="button"
103
+ aria-label="close cookie"
104
+ type="button"
105
+ onClick={() => closeModal()}
106
+ >
103
107
  <MdClose title="Close Icon" />
104
108
  </button>
105
109
  </div>
@@ -4,7 +4,6 @@
4
4
  /* eslint-disable react-hooks/exhaustive-deps */
5
5
  /* eslint-disable array-callback-return */
6
6
  /* eslint-disable no-return-assign */
7
- /* eslint-disable jsx-a11y/control-has-associated-label */
8
7
  import React, { useRef, useState, useEffect, useCallback, useContext } from 'react';
9
8
  import Button from 'gatsby-core-theme/src/components/atoms/button/button';
10
9
  import { Context } from 'gatsby-core-theme/src/context/MainProvider';
@@ -374,7 +373,7 @@ const HorseCalculator = () => {
374
373
  ref={(el) => (outcomesTableRefs.current[index] = el)}
375
374
  >
376
375
  {addNotes === 'No' && <td>{index + 1}</td>}
377
- <td className={`${styles.outComing} ${styles.cells}`}>
376
+ <td aria-label="outcome" className={`${styles.outComing} ${styles.cells}`}>
378
377
  <Select
379
378
  // label="Outcome:"
380
379
  id={`outcome-${index}`}
@@ -386,6 +385,7 @@ const HorseCalculator = () => {
386
385
  />
387
386
  </td>
388
387
  <td
388
+ aria-label="odds"
389
389
  className={`${styles.cells} ${styles.odds}${
390
390
  outcomeSelection[index] === 'lost' || outcomeSelection[index] === 'void'
391
391
  ? styles.displayNone || ''
@@ -407,7 +407,10 @@ const HorseCalculator = () => {
407
407
  </label>
408
408
  </td>
409
409
  {eachWay === 'Yes' && (
410
- <td className={`${styles?.placeOdds} ${styles.cells} ${styles.placeOdds}`}>
410
+ <td
411
+ aria-label="place odds"
412
+ className={`${styles?.placeOdds} ${styles.cells} ${styles.placeOdds}`}
413
+ >
411
414
  <Select
412
415
  id="place_odds"
413
416
  onChangeFunc={calculateTotalBet}
@@ -418,7 +421,7 @@ const HorseCalculator = () => {
418
421
  </td>
419
422
  )}
420
423
  {ruleFour === 'Yes' && (
421
- <td className={`${styles.cells} ${styles.ruleFour}`}>
424
+ <td aria-label="rule four" className={`${styles.cells} ${styles.ruleFour}`}>
422
425
  <Select
423
426
  id="rule_four"
424
427
  onChangeFunc={calculateTotalBet}
@@ -437,7 +440,7 @@ const HorseCalculator = () => {
437
440
  >
438
441
  {outcomeSelection[index] === 'dead_heat' && (
439
442
  <>
440
- <td />
443
+ <td aria-label="hidden" />
441
444
  <td colSpan={getColspan()}>
442
445
  <div className={styles?.deadHeat || ''}>
443
446
  <Select
@@ -505,7 +508,7 @@ const HorseCalculator = () => {
505
508
  {foldTableRows.map((row, index) => (
506
509
  <tr ref={(el) => (foldTableRefs.current[index] = el)}>
507
510
  <td>{row.name}</td>
508
- <td>
511
+ <td aria-label={row.name}>
509
512
  <input
510
513
  type="number"
511
514
  onChange={calculateTotalBet}
@@ -12,6 +12,7 @@ const Buttons = ({ scrollX, noModuleIntro, scrollEnd, scroll }) => (
12
12
  }`}
13
13
  onClick={() => scroll(-200)}
14
14
  type="button"
15
+ aria-label="carouselBtnLeft"
15
16
  >
16
17
  <IoIosArrowBack />
17
18
  </button>
@@ -21,6 +22,7 @@ const Buttons = ({ scrollX, noModuleIntro, scrollEnd, scroll }) => (
21
22
  }`}
22
23
  onClick={() => scroll(200)}
23
24
  type="button"
25
+ aria-label="carouselBtnRight"
24
26
  >
25
27
  <IoIosArrowForward />
26
28
  </button>
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable react/forbid-prop-types */
2
2
  /* eslint-disable import/no-extraneous-dependencies */
3
3
  /* eslint-disable no-unused-expressions */
4
- /* eslint-disable react/button-has-type */
5
4
  /* eslint-disable react-hooks/exhaustive-deps */
6
5
  /* eslint-disable jsx-a11y/no-static-element-interactions */
7
6
  /* eslint-disable jsx-a11y/click-events-have-key-events */
@@ -129,8 +128,10 @@ const Popup = ({
129
128
  <div className={styles?.modalTitle || ''}>
130
129
  <p>{title}</p>
131
130
  <button
131
+ type="button"
132
132
  className={`${styles?.closeIcon || ''} popup-gtm btn-cta`}
133
133
  onClick={() => handelActive(false)}
134
+ aria-label="close"
134
135
  >
135
136
  <MdClose title="Close Icon" />
136
137
  </button>
@@ -148,7 +148,7 @@ const Main = ({
148
148
  ))}
149
149
  {SearchPage && (
150
150
  <Suspense fallback={<></>}>
151
- <SearchPage page={page} />
151
+ <SearchPage page={page} serverData={serverData} allMarkets={pageContext.allMarkets} />
152
152
  </Suspense>
153
153
  )}
154
154
  {showAuthorBox && (
@@ -1,39 +1,25 @@
1
- .form {
2
- width: 50%;
3
- display: flex;
4
- flex-direction: column;
5
- position: absolute;
6
- top: 10%;
7
- left: 50%;
8
- transform: translateX(-50%);
1
+ .container {
2
+ form {
3
+ position: relative;
4
+ margin-bottom: 2.4rem;
9
5
 
10
- input {
11
- width: 100%;
12
- padding: 3rem 2rem;
13
- }
6
+ input {
7
+ width: 100%;
8
+ background-color: #ececec;
9
+ border-radius: .8rem;
10
+ padding: 2.4rem;
14
11
 
15
- .searchButton {
16
- position: absolute;
17
- right: 0;
18
- top: 0.6rem;
19
- padding: 2rem;
12
+
13
+ }
20
14
 
21
- svg {
22
- font-size: 3rem;
15
+ button {
16
+ position: absolute;
17
+ right: 3rem;
18
+ top: calc(50% - .8rem);
23
19
  }
24
20
  }
25
21
  }
26
22
 
27
- .searchGrid {
28
- display: grid;
29
- grid-template-columns: repeat(3, 1fr);
30
- }
31
-
32
- .loading {
33
- width: 150px;
34
- height: 20px;
35
- display: block;
36
- }
37
- .selectwrapper {
38
- position: relative;
39
- }
23
+ .results {
24
+
25
+ }
@@ -9,13 +9,15 @@ import { Context } from 'gatsby-core-theme/src/context/MainProvider';
9
9
  import Search from 'gatsby-core-theme/src/components/molecules/search';
10
10
  import styles from './search.module.scss';
11
11
 
12
- const SearchContent = ({ page }) => {
12
+ const SearchContent = ({ page, serverData, allMarkets }) => {
13
13
  const { translations } = useContext(Context) || {};
14
14
  const searchURLPageName = page.path;
15
15
  return (
16
16
  <div className={`${styles.searchPage} ${moduleStyles.module} module`}>
17
17
  {page.path && <Breadcrumbs page={page} />}
18
18
  <Search
19
+ serverData={serverData}
20
+ allMarkets={allMarkets}
19
21
  searchURLPageName={searchURLPageName}
20
22
  page={page}
21
23
  searchIcon="../../../../../../images/search.svg"
@@ -87,6 +89,8 @@ const SearchContent = ({ page }) => {
87
89
  };
88
90
 
89
91
  SearchContent.propTypes = {
92
+ serverData: PropTypes.shape({}),
93
+ allMarkets: PropTypes.shape({}),
90
94
  page: PropTypes.shape({
91
95
  template: PropTypes.string,
92
96
  path: PropTypes.string,
@@ -1,44 +1,5 @@
1
1
  .searchPage {
2
- margin-top: 6rem;
3
- @include min(tablet){
4
- div {
5
- div{
6
- div{
7
- button{
8
- margin-top: 2rem;
9
- }
10
- ol{
11
- button{
12
- margin-top: 0rem;
13
- }
14
- }
15
- }
16
- }
2
+ margin-top: var(--nav-height);
3
+
17
4
 
18
- }
19
- }
20
- @include min(laptop){
21
- div{
22
- button{
23
- margin-top: 2rem;
24
- }
25
- ol{
26
- display: block !important;
27
- li{
28
- margin-bottom: 1rem;
29
- display: inline-block;
30
- button{
31
- margin: 0;
32
- }
33
- }
34
- }
35
- }
36
- div:nth-child(2){
37
- ol{
38
- li{
39
- margin-bottom: 0rem;
40
- }
41
- }
42
- }
43
- }
44
5
  }
@@ -1,17 +1,42 @@
1
+ /* eslint-disable no-prototype-builtins */
2
+ /* eslint-disable no-nested-ternary */
1
3
  /* eslint-disable import/prefer-default-export */
2
4
  import { getApiQueryParams } from './sportstake';
3
5
  import { getApiBasedNames } from './lotto';
4
6
  import { getFixtures, getLatestResults, getAvailableDrawDays } from './services';
5
-
6
- export async function getAPIData(page) {
7
- let responseFixtures = {};
8
- let responseResults = {};
9
- let responseLotto = {};
7
+ import loadSource from '~helpers/search-source';
8
+ import { deparam } from '~helpers/strings';
9
+
10
+ export async function getAPIData(page, url) {
11
+ if (page.path.endsWith('/s') || page.path === 's') {
12
+ const results = await loadSource(page.market);
13
+ let urlParams = null;
14
+ if (url && url.split('?').length === 2) {
15
+ urlParams = deparam(`${url.split('?')[1]}`);
16
+ }
17
+
18
+ const searchData = urlParams
19
+ ? urlParams.hasOwnProperty('s')
20
+ ? results.filter((item) => item.title.toLowerCase().includes(urlParams.s.toLowerCase()))
21
+ : null
22
+ : null;
23
+
24
+ return {
25
+ props: {
26
+ data: searchData,
27
+ searchParam: urlParams ? urlParams.s : null,
28
+ },
29
+ };
30
+ }
10
31
 
11
32
  const containsFixtures = page.categories.filter((category) => category.short_name === 'fixtures');
12
33
  const containsResults = page.categories.filter((category) => category.short_name === 'results');
13
34
  const containsLotto = page.categories.filter((category) => category.short_name === 'lotto');
14
35
 
36
+ let responseFixtures = {};
37
+ let responseResults = {};
38
+ let responseLotto = {};
39
+
15
40
  if (containsFixtures.length >= 1) {
16
41
  const filteredArray = page?.sections?.main?.modules.filter(
17
42
  (x) => x.value_type === 'template_block'
@@ -6,7 +6,7 @@
6
6
  margin-bottom: 2rem;
7
7
  }
8
8
  @include min(tablet) {
9
- grid-template-columns: 1fr 0.4fr;
9
+ grid-template-columns: 1fr 1fr;
10
10
  &.tabsonly {
11
11
  grid-template-columns: 1fr;
12
12
  }