gatsby-matrix-theme 53.24.0 → 53.25.0
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 +11 -0
- package/package.json +1 -1
- package/src/components/molecules/sportstake/fixtures/index.js +19 -17
- package/src/components/molecules/sportstake/results/index.js +11 -17
- package/src/components/molecules/sportstake/results/table/index.js +7 -21
- package/src/components/molecules/sportstake/table/index.js +2 -2
- package/src/gatsby-core-theme/components/molecules/module/module-constants.js +6 -14
- package/src/gatsby-core-theme/components/molecules/module/module-registry.js +5 -2
- package/src/gatsby-core-theme/constants/sportstake.js +0 -12
- package/src/gatsby-core-theme/helpers/lotto.js +3 -17
- package/src/gatsby-core-theme/helpers/server-data.js +23 -28
- package/src/gatsby-core-theme/helpers/sportstake.js +45 -88
- package/storybook/public/333.41422704.iframe.bundle.js +1 -0
- package/storybook/public/638.b34fff20.iframe.bundle.js +1 -0
- package/storybook/public/650.4228498c.iframe.bundle.js +1 -0
- package/storybook/public/iframe.html +1 -1
- package/storybook/public/main.7e1380dd.iframe.bundle.js +1 -0
- package/storybook/public/project.json +1 -1
- package/storybook/public/{runtime~main.2eb89b2e.iframe.bundle.js → runtime~main.d2ee136d.iframe.bundle.js} +1 -1
- package/storybook/public/333.4e379536.iframe.bundle.js +0 -1
- package/storybook/public/638.7b0237f8.iframe.bundle.js +0 -1
- package/storybook/public/650.0b65f6f2.iframe.bundle.js +0 -1
- package/storybook/public/main.9508d55c.iframe.bundle.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# [53.25.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.24.0...v53.25.0) (2026-07-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
* Merge branch 'EN-574/update-lottery-api' into 'master' ([3d24359](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/3d24359cb39c9ec8d592e6bb83d7cf04124821d0))
|
|
5
|
+
* Merge branch 'master' of gitlab.com:g2m-gentoo/team-floyd/themes/matrix-theme into EN-574/update-lottery-api ([5e77ea7](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/5e77ea7b15a7298f11f10b3b4d258227c1fa4f95))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* replace sportstake api with matchplay ([f2e3410](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/commit/f2e34100aa28cecf371abd16e9f6e10d87ff20fa))
|
|
11
|
+
|
|
1
12
|
# [53.24.0](https://gitlab.com/g2m-gentoo/team-floyd/themes/matrix-theme/compare/v53.23.0...v53.24.0) (2026-07-02)
|
|
2
13
|
|
|
3
14
|
|
package/package.json
CHANGED
|
@@ -24,10 +24,9 @@ const Fixtures = ({ module, serverData }) => {
|
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const isCricket = moduleName.includes('cricket');
|
|
28
|
-
const isSportstake4 = moduleName.includes('sportstake4');
|
|
29
|
-
const hasTwoTables = moduleName.includes('sportstake8') || isSportstake4;
|
|
30
27
|
const query = getApiQueryParams(moduleName);
|
|
28
|
+
const isMatchplay8 = query.lotteryName === 'matchplay8';
|
|
29
|
+
const hasTwoTables = query.lotteryName === 'matchplay8' || query.lotteryName === 'matchplay14';
|
|
31
30
|
|
|
32
31
|
const headerList = tableHeader.slice(0, 4);
|
|
33
32
|
|
|
@@ -69,7 +68,7 @@ const Fixtures = ({ module, serverData }) => {
|
|
|
69
68
|
const { games } = activeFixture?.drawDetails || {};
|
|
70
69
|
|
|
71
70
|
const firstTableGames = games
|
|
72
|
-
? hasTwoTables
|
|
71
|
+
? hasTwoTables
|
|
73
72
|
? Object.values(games).slice(...query.firstTable)
|
|
74
73
|
: Object.values(games)
|
|
75
74
|
: [];
|
|
@@ -94,11 +93,11 @@ const Fixtures = ({ module, serverData }) => {
|
|
|
94
93
|
return (
|
|
95
94
|
<div label={label} results={results} key={res} className={`${styles.sportstake} ${hasTwoTables && styles.twoHalfs}`}>
|
|
96
95
|
<SportstakeHeader fixture={activeFixture} />
|
|
97
|
-
{
|
|
96
|
+
{isMatchplay8 && <h3>1st half</h3>}
|
|
98
97
|
<Table headerList={headerList} rowList={firstTableGames} />
|
|
99
98
|
{hasTwoTables && (
|
|
100
99
|
<>
|
|
101
|
-
<h3>{!
|
|
100
|
+
<h3>{!isMatchplay8 ? '2nd Half' : 'Full Time'}</h3>
|
|
102
101
|
<Table headerList={headerList} rowList={secondTableGames} />
|
|
103
102
|
</>
|
|
104
103
|
)}
|
|
@@ -121,15 +120,18 @@ Fixtures.propTypes = {
|
|
|
121
120
|
module_introduction: PropTypes.string,
|
|
122
121
|
}).isRequired,
|
|
123
122
|
pageContext: PropTypes.shape({}),
|
|
124
|
-
serverData: PropTypes.
|
|
125
|
-
PropTypes.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
serverData: PropTypes.shape({
|
|
124
|
+
data: PropTypes.objectOf(
|
|
125
|
+
PropTypes.arrayOf(
|
|
126
|
+
PropTypes.shape({
|
|
127
|
+
_id: PropTypes.string,
|
|
128
|
+
drawDate: PropTypes.string,
|
|
129
|
+
drawDetails: PropTypes.shape({
|
|
130
|
+
games: PropTypes.shape({}),
|
|
131
|
+
divs: PropTypes.shape({}),
|
|
132
|
+
}),
|
|
133
|
+
})
|
|
134
|
+
)
|
|
135
|
+
),
|
|
136
|
+
}),
|
|
135
137
|
};
|
|
@@ -5,11 +5,8 @@ import React, {useState} from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Tabs from 'gatsby-core-theme/src/hooks/tabs';
|
|
7
7
|
import { getResultsById } from '../../../../gatsby-core-theme/helpers/services';
|
|
8
|
-
import { getApiQueryParams } from '../../../../gatsby-core-theme/helpers/sportstake';
|
|
9
|
-
import {
|
|
10
|
-
tableHeader,
|
|
11
|
-
tableHeaderCricket,
|
|
12
|
-
} from '../../../../gatsby-core-theme/constants/sportstake';
|
|
8
|
+
import { getApiQueryParams, formatMatchResult } from '../../../../gatsby-core-theme/helpers/sportstake';
|
|
9
|
+
import { tableHeader } from '../../../../gatsby-core-theme/constants/sportstake';
|
|
13
10
|
import SportstakeHeader from './header';
|
|
14
11
|
import SportstakeTable from './table';
|
|
15
12
|
import Table from '../table';
|
|
@@ -29,11 +26,10 @@ const Results = ({ module, serverData }) => {
|
|
|
29
26
|
setTabData(response);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
const isCricket = moduleName.includes('cricket');
|
|
33
|
-
const isSportstake4 = moduleName.includes('sportstake4');
|
|
34
|
-
const hasTwoTables = moduleName.includes('sportstake8') || isSportstake4;
|
|
35
29
|
const query = getApiQueryParams(moduleName);
|
|
36
|
-
const
|
|
30
|
+
const isMatchplay8 = query.lotteryName === 'matchplay8';
|
|
31
|
+
const hasTwoTables = query.lotteryName === 'matchplay8' || query.lotteryName === 'matchplay14';
|
|
32
|
+
const headerList = tableHeader;
|
|
37
33
|
|
|
38
34
|
if(!serverData?.data[moduleName]) return;
|
|
39
35
|
const daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
@@ -51,10 +47,8 @@ const Results = ({ module, serverData }) => {
|
|
|
51
47
|
awayTeam: element.awayTeam,
|
|
52
48
|
toss: element.toss_winner || element.toss,
|
|
53
49
|
dateTime: element.eventDate || element.dateTime || fallbackDate,
|
|
54
|
-
score:
|
|
55
|
-
|
|
56
|
-
: element.score || fallbackScore,
|
|
57
|
-
results: element.result || element.results,
|
|
50
|
+
score: element.score || fallbackScore,
|
|
51
|
+
results: formatMatchResult(element.result ?? element.results),
|
|
58
52
|
};
|
|
59
53
|
});
|
|
60
54
|
};
|
|
@@ -73,7 +67,7 @@ const Results = ({ module, serverData }) => {
|
|
|
73
67
|
const { games } = activeFixture?.drawDetails || {};
|
|
74
68
|
|
|
75
69
|
const firstTableGames = games
|
|
76
|
-
? hasTwoTables
|
|
70
|
+
? hasTwoTables
|
|
77
71
|
? Object.values(games).slice(...query.firstTable)
|
|
78
72
|
: Object.values(games)
|
|
79
73
|
: [];
|
|
@@ -98,15 +92,15 @@ const Results = ({ module, serverData }) => {
|
|
|
98
92
|
return (
|
|
99
93
|
<div label={label} results={results} key={res} className={`${styles.sportstake} ${hasTwoTables && styles.twoHalfs}`}>
|
|
100
94
|
<SportstakeHeader fixture={activeFixture} />
|
|
101
|
-
{
|
|
95
|
+
{isMatchplay8 && <h3>1st half</h3>}
|
|
102
96
|
<Table headerList={headerList} rowList={firstTableGames} isResult />
|
|
103
97
|
{hasTwoTables && (
|
|
104
98
|
<>
|
|
105
|
-
<h3>{!
|
|
99
|
+
<h3>{!isMatchplay8 ? '2nd Half' : 'Full Time'}</h3>
|
|
106
100
|
<Table headerList={headerList} rowList={secondTableGames} isResult />
|
|
107
101
|
</>
|
|
108
102
|
)}
|
|
109
|
-
<SportstakeTable fixture={activeFixture} query={query}
|
|
103
|
+
<SportstakeTable fixture={activeFixture} query={query} />
|
|
110
104
|
</div>
|
|
111
105
|
);
|
|
112
106
|
})}
|
|
@@ -4,16 +4,15 @@
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Table from '../../table';
|
|
7
|
-
import { divHeader
|
|
7
|
+
import { divHeader } from '../../../../../gatsby-core-theme/constants/sportstake';
|
|
8
8
|
import { commaSeperate } from '../../../../../gatsby-core-theme/helpers/lotto';
|
|
9
9
|
import styles from '../results.module.scss';
|
|
10
10
|
|
|
11
|
-
const SportstakeTable = ({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!fixture) {return;}
|
|
11
|
+
const SportstakeTable = ({ fixture, query }) => {
|
|
12
|
+
if (!fixture) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
17
16
|
const { divs } = fixture?.drawDetails || {};
|
|
18
17
|
const { winnerData } = fixture?.more_info || {};
|
|
19
18
|
const { totalPrizePool, estimatedJackpot, nextEstimatedJackpotAmt } = fixture?.more_info || {};
|
|
@@ -56,15 +55,6 @@ const SportstakeTable = ({
|
|
|
56
55
|
isDivTable
|
|
57
56
|
resultTableNumber={query.secondTableStart}
|
|
58
57
|
/>
|
|
59
|
-
|
|
60
|
-
{isCricket && fixture?.toss_results?.winnerData && (
|
|
61
|
-
<Table
|
|
62
|
-
headerList={tossResultsHeader}
|
|
63
|
-
rowList={fixture?.toss_results?.winnerData}
|
|
64
|
-
isDivTable
|
|
65
|
-
resultTableNumber={query.secondTableStart}
|
|
66
|
-
/>
|
|
67
|
-
)}
|
|
68
58
|
</div>
|
|
69
59
|
{(totalPrizePoolValue !== null || nextEstimatedJackpotValue !== null) && (
|
|
70
60
|
<div className={styles.jackpotDiv}>
|
|
@@ -97,14 +87,10 @@ SportstakeTable.propTypes = {
|
|
|
97
87
|
divs: PropTypes.shape({}),
|
|
98
88
|
}),
|
|
99
89
|
more_info: PropTypes.shape({}),
|
|
100
|
-
toss_results: PropTypes.shape({
|
|
101
|
-
winnerData: PropTypes.arrayOf(PropTypes.shape({})),
|
|
102
|
-
}),
|
|
103
90
|
winnerData: PropTypes.arrayOf(PropTypes.shape({})),
|
|
104
91
|
}),
|
|
105
92
|
query: PropTypes.shape({
|
|
106
|
-
|
|
93
|
+
secondTableStart: PropTypes.number,
|
|
107
94
|
}).isRequired,
|
|
108
|
-
isCricket: PropTypes.bool
|
|
109
95
|
};
|
|
110
96
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { commaSeperate, formatDate } from '../../../../gatsby-core-theme/helpers/lotto';
|
|
5
|
-
import { formatScore, formatLowerCase } from '../../../../gatsby-core-theme/helpers/sportstake';
|
|
5
|
+
import { formatScore, formatLowerCase, formatMatchResult } from '../../../../gatsby-core-theme/helpers/sportstake';
|
|
6
6
|
import styles from './table.module.scss';
|
|
7
7
|
|
|
8
8
|
const Table = ({
|
|
@@ -13,7 +13,7 @@ const Table = ({
|
|
|
13
13
|
resultTableNumber = 0,
|
|
14
14
|
}) => {
|
|
15
15
|
const getIcon = (result) => {
|
|
16
|
-
switch (result
|
|
16
|
+
switch (formatMatchResult(result)) {
|
|
17
17
|
case 'home':
|
|
18
18
|
case 'home win':
|
|
19
19
|
return (
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
export const SPORTSTAKE_FIXTURE_MODULES = [
|
|
2
|
-
'
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
'sportstake13fixturesmidweek',
|
|
6
|
-
'sportstake13fixturesweekend',
|
|
7
|
-
'sportstakecricketfixturesweekend',
|
|
8
|
-
'sportstakerugbyfixturesweekend',
|
|
2
|
+
'matchplay8fixtures',
|
|
3
|
+
'matchplay14fixtures',
|
|
4
|
+
'matchplay13fixtures',
|
|
9
5
|
];
|
|
10
6
|
|
|
11
7
|
export const SPORTSTAKE_RESULT_MODULES = [
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'sportstake13resultsmidweek',
|
|
16
|
-
'sportstake13resultsweekend',
|
|
17
|
-
'sportstakecricketresultsweekend',
|
|
18
|
-
'sportstakerugbyresultsweekend',
|
|
8
|
+
'matchplay8results',
|
|
9
|
+
'matchplay14results',
|
|
10
|
+
'matchplay13results',
|
|
19
11
|
];
|
|
20
12
|
|
|
21
13
|
export const SPORTSTAKE_MODULES = [...SPORTSTAKE_FIXTURE_MODULES, ...SPORTSTAKE_RESULT_MODULES];
|
|
@@ -21,12 +21,15 @@ import {
|
|
|
21
21
|
getSportstakeResultProps,
|
|
22
22
|
} from './module-props';
|
|
23
23
|
|
|
24
|
+
const hasSportstakeServerData = (dataKey) => (module, ctx) =>
|
|
25
|
+
Boolean(ctx.serverData?.[dataKey]?.data?.[module?.name]?.length);
|
|
26
|
+
|
|
24
27
|
const sportstakeFixtureEntries = Object.fromEntries(
|
|
25
28
|
SPORTSTAKE_FIXTURE_MODULES.map((name) => [
|
|
26
29
|
name,
|
|
27
30
|
{
|
|
28
31
|
load: () => import('../../../../components/molecules/sportstake/fixtures'),
|
|
29
|
-
shouldRender: (
|
|
32
|
+
shouldRender: hasSportstakeServerData('fixtures'),
|
|
30
33
|
getProps: getSportstakeFixtureProps,
|
|
31
34
|
sportstakeSuspense: true,
|
|
32
35
|
},
|
|
@@ -38,7 +41,7 @@ const sportstakeResultEntries = Object.fromEntries(
|
|
|
38
41
|
name,
|
|
39
42
|
{
|
|
40
43
|
load: () => import('../../../../components/molecules/sportstake/results'),
|
|
41
|
-
shouldRender: (
|
|
44
|
+
shouldRender: hasSportstakeServerData('results'),
|
|
42
45
|
getProps: getSportstakeResultProps,
|
|
43
46
|
sportstakeSuspense: true,
|
|
44
47
|
},
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
export const tableHeader = ['Fixture', 'Home Team', 'Away Team', 'Date', 'Score', 'Result'];
|
|
2
2
|
|
|
3
|
-
export const tableHeaderCricket = [
|
|
4
|
-
'Fixture',
|
|
5
|
-
'Home Team',
|
|
6
|
-
'Away Team',
|
|
7
|
-
'Toss',
|
|
8
|
-
'Date',
|
|
9
|
-
'Score',
|
|
10
|
-
'Result',
|
|
11
|
-
];
|
|
12
|
-
|
|
13
3
|
export const divHeader = ['DIV', 'Matches', 'Number of Winners', 'Payout per Winner'];
|
|
14
|
-
|
|
15
|
-
export const tossResultsHeader = ['DIV', 'Toss Results', 'Number of Winners', 'Payout per Winner'];
|
|
@@ -108,23 +108,9 @@ export const generateCustomHeadings = (moduleName, title = '') => {
|
|
|
108
108
|
case 'daily_lotto':
|
|
109
109
|
todaysDate.setDate(todaysDate.getDate() - 1);
|
|
110
110
|
return `Daily Lotto Results for ${formatDate(todaysDate, 'dd/MMM/yy')}`;
|
|
111
|
-
case '
|
|
112
|
-
const
|
|
113
|
-
return `${title} for ${formatDate(
|
|
114
|
-
}
|
|
115
|
-
case 'sportstake-cricket': {
|
|
116
|
-
const sportstakeCricketDates = [getLastWeekday(6)];
|
|
117
|
-
return `${title} for ${formatDate(
|
|
118
|
-
sportstakeCricketDates.sort((a, b) => b - a)[0],
|
|
119
|
-
'dd/MMM/yy'
|
|
120
|
-
)}`;
|
|
121
|
-
}
|
|
122
|
-
case 'sportstake-rugby': {
|
|
123
|
-
const sportstakeRugbyDates = [getLastWeekday(6)];
|
|
124
|
-
return `${title} for ${formatDate(
|
|
125
|
-
sportstakeRugbyDates.sort((a, b) => b - a)[0],
|
|
126
|
-
'dd/MMM/yy'
|
|
127
|
-
)}`;
|
|
111
|
+
case 'matchplay-8': {
|
|
112
|
+
const matchplay8Dates = [getLastWeekday(6), getLastWeekday(3)];
|
|
113
|
+
return `${title} for ${formatDate(matchplay8Dates.sort((a, b) => b - a)[0], 'dd/MMM/yy')}`;
|
|
128
114
|
}
|
|
129
115
|
default:
|
|
130
116
|
return null;
|
|
@@ -123,20 +123,12 @@ export async function getAPIData(page, url, header, preview) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
const sportstakeTemplateBlocks = [
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
'
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'sportstakerugbyresultsweekend',
|
|
133
|
-
'sportstake4fixturesmidweek',
|
|
134
|
-
'sportstake8fixturesmidweek',
|
|
135
|
-
'sportstake8fixturesweekend',
|
|
136
|
-
'sportstake13fixturesmidweek',
|
|
137
|
-
'sportstake13fixturesweekend',
|
|
138
|
-
'sportstakecricketfixturesweekend',
|
|
139
|
-
'sportstakerugbyfixturesweekend',
|
|
126
|
+
'matchplay8results',
|
|
127
|
+
'matchplay14results',
|
|
128
|
+
'matchplay13results',
|
|
129
|
+
'matchplay8fixtures',
|
|
130
|
+
'matchplay14fixtures',
|
|
131
|
+
'matchplay13fixtures',
|
|
140
132
|
'lotto',
|
|
141
133
|
'daily_lotto',
|
|
142
134
|
'powerball',
|
|
@@ -157,15 +149,22 @@ export async function getAPIData(page, url, header, preview) {
|
|
|
157
149
|
(page?.categories &&
|
|
158
150
|
page?.categories.filter((category) => category.short_name === 'lotto_uk_49')) ||
|
|
159
151
|
[];
|
|
152
|
+
const sportstakeModules =
|
|
153
|
+
page?.sections?.main?.modules?.filter(
|
|
154
|
+
(x) => x.value_type === 'template_block' && sportstakeTemplateBlocks.includes(x.name)
|
|
155
|
+
) || [];
|
|
156
|
+
const hasFixtureModules = sportstakeModules.some((m) => m.name.includes('fixtures'));
|
|
157
|
+
const hasResultModules = sportstakeModules.some((m) => m.name.includes('results'));
|
|
158
|
+
const hasLottoModules = sportstakeModules.some((m) =>
|
|
159
|
+
['lotto', 'daily_lotto', 'powerball'].includes(m.name)
|
|
160
|
+
);
|
|
160
161
|
let responseFixtures = {};
|
|
161
162
|
let responseResults = {};
|
|
162
163
|
let responseLotto = {};
|
|
163
164
|
let lottoUK49 = [];
|
|
164
165
|
|
|
165
|
-
if (containsFixtures.length >= 1) {
|
|
166
|
-
const filteredArray =
|
|
167
|
-
(x) => x.value_type === 'template_block' && sportstakeTemplateBlocks.includes(x.name)
|
|
168
|
-
);
|
|
166
|
+
if (containsFixtures.length >= 1 || hasFixtureModules) {
|
|
167
|
+
const filteredArray = sportstakeModules;
|
|
169
168
|
|
|
170
169
|
const date = new Date();
|
|
171
170
|
const fixtureData = await Promise.all(
|
|
@@ -213,13 +212,11 @@ export async function getAPIData(page, url, header, preview) {
|
|
|
213
212
|
data: Object.assign({}, ...fixtureData.filter(Boolean)),
|
|
214
213
|
};
|
|
215
214
|
} else {
|
|
216
|
-
responseFixtures = { data:
|
|
215
|
+
responseFixtures = { data: {} };
|
|
217
216
|
}
|
|
218
217
|
|
|
219
|
-
if (containsResults.length >= 1) {
|
|
220
|
-
const filteredArray =
|
|
221
|
-
(x) => x.value_type === 'template_block' && sportstakeTemplateBlocks.includes(x.name)
|
|
222
|
-
);
|
|
218
|
+
if (containsResults.length >= 1 || hasResultModules) {
|
|
219
|
+
const filteredArray = sportstakeModules;
|
|
223
220
|
|
|
224
221
|
const date = new Date();
|
|
225
222
|
const resultData = await Promise.all(
|
|
@@ -268,13 +265,11 @@ export async function getAPIData(page, url, header, preview) {
|
|
|
268
265
|
data: Object.assign({}, ...resultData.filter(Boolean)),
|
|
269
266
|
};
|
|
270
267
|
} else {
|
|
271
|
-
responseResults = { data:
|
|
268
|
+
responseResults = { data: {} };
|
|
272
269
|
}
|
|
273
270
|
|
|
274
|
-
if (containsLotto.length >= 1) {
|
|
275
|
-
const filteredArray =
|
|
276
|
-
(x) => x.value_type === 'template_block' && sportstakeTemplateBlocks.includes(x.name)
|
|
277
|
-
);
|
|
271
|
+
if (containsLotto.length >= 1 || hasLottoModules) {
|
|
272
|
+
const filteredArray = sportstakeModules;
|
|
278
273
|
|
|
279
274
|
const responseArray = await Promise.all(
|
|
280
275
|
filteredArray.map(async (module) => {
|
|
@@ -13,6 +13,27 @@ export const formatScore = (val) => {
|
|
|
13
13
|
return scores?.join(' - ');
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
export const formatMatchResult = (result) => {
|
|
17
|
+
if (result === null || result === undefined || result === '') {
|
|
18
|
+
return '';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const code = String(result).trim().toLowerCase();
|
|
22
|
+
|
|
23
|
+
switch (code) {
|
|
24
|
+
case '1':
|
|
25
|
+
return 'away win';
|
|
26
|
+
case '2':
|
|
27
|
+
return 'draw';
|
|
28
|
+
case '4':
|
|
29
|
+
return 'home win';
|
|
30
|
+
case '7':
|
|
31
|
+
return 'cancelled';
|
|
32
|
+
default:
|
|
33
|
+
return code;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
16
37
|
export const formatLowerCase = (text) => {
|
|
17
38
|
if (!text) {
|
|
18
39
|
return '';
|
|
@@ -36,115 +57,52 @@ export const getLastWeekday = (weekday) => {
|
|
|
36
57
|
export function getApiQueryParams(moduleName) {
|
|
37
58
|
let type = '';
|
|
38
59
|
let lotteryName = '';
|
|
39
|
-
let listType = '';
|
|
40
60
|
let secondTableStart = 0;
|
|
41
61
|
let firstTable = [0, 8];
|
|
42
62
|
let secondTable = [8, 16];
|
|
43
63
|
let title = '';
|
|
44
64
|
|
|
45
65
|
switch (moduleName) {
|
|
46
|
-
case '
|
|
47
|
-
|
|
48
|
-
lotteryName = 'sportstake8';
|
|
49
|
-
secondTableStart = 16;
|
|
50
|
-
listType = 'MIDWEEK';
|
|
51
|
-
title = 'Sportstake 8 Results Midweek';
|
|
52
|
-
break;
|
|
53
|
-
case 'sportstake8resultsweekend':
|
|
54
|
-
lotteryName = 'sportstake8';
|
|
66
|
+
case 'matchplay8results':
|
|
67
|
+
lotteryName = 'matchplay8';
|
|
55
68
|
type = 'results';
|
|
56
|
-
secondTableStart = 16;
|
|
57
|
-
listType = 'WEEKEND';
|
|
58
|
-
title = 'Sportstake 8 Results Weekend';
|
|
59
|
-
break;
|
|
60
|
-
case 'sportstake8fixturesmidweek':
|
|
61
|
-
lotteryName = 'sportstake8';
|
|
62
|
-
type = 'fixtures';
|
|
63
|
-
listType = 'MIDWEEK';
|
|
64
|
-
title = 'Sportstake 8 Fixtures Midweek';
|
|
65
|
-
break;
|
|
66
|
-
case 'sportstake8fixturesweekend':
|
|
67
|
-
lotteryName = 'sportstake8';
|
|
68
|
-
type = 'fixtures';
|
|
69
|
-
listType = 'WEEKEND';
|
|
70
|
-
title = 'Sportstake 8 Fixtures Weekend';
|
|
71
|
-
break;
|
|
72
|
-
case 'sportstake13resultsmidweek':
|
|
73
|
-
lotteryName = 'sportstake13';
|
|
74
|
-
type = 'results';
|
|
75
|
-
secondTableStart = 13;
|
|
76
|
-
listType = 'MIDWEEK';
|
|
77
|
-
title = 'Sportstake 13 Results Midweek';
|
|
78
|
-
break;
|
|
79
|
-
case 'sportstake13resultsweekend':
|
|
80
|
-
lotteryName = 'sportstake13';
|
|
81
|
-
type = 'results';
|
|
82
|
-
secondTableStart = 13;
|
|
83
|
-
listType = 'WEEKEND';
|
|
84
|
-
title = 'Sportstake 13 Results Weekend';
|
|
85
|
-
break;
|
|
86
|
-
case 'sportstake13fixturesmidweek':
|
|
87
|
-
lotteryName = 'sportstake13';
|
|
88
|
-
type = 'fixtures';
|
|
89
|
-
listType = 'MIDWEEK';
|
|
90
|
-
title = 'Sportstake 13 Fixtures Midweek';
|
|
91
|
-
break;
|
|
92
|
-
case 'sportstake13fixturesweekend':
|
|
93
|
-
lotteryName = 'sportstake13';
|
|
94
|
-
type = 'fixtures';
|
|
95
|
-
listType = 'WEEKEND';
|
|
96
|
-
title = 'Sportstake 13 Fixtures Weekend';
|
|
97
|
-
break;
|
|
98
|
-
case 'sportstake4resultsmidweek':
|
|
99
|
-
lotteryName = 'sportstake4';
|
|
100
|
-
type = 'results';
|
|
101
|
-
listType = 'MIDWEEK';
|
|
102
69
|
secondTableStart = 8;
|
|
103
70
|
firstTable = [0, 4];
|
|
104
71
|
secondTable = [4, 8];
|
|
105
|
-
title = '
|
|
72
|
+
title = 'Match Play 8 Results';
|
|
106
73
|
break;
|
|
107
|
-
case '
|
|
108
|
-
lotteryName = '
|
|
74
|
+
case 'matchplay8fixtures':
|
|
75
|
+
lotteryName = 'matchplay8';
|
|
109
76
|
type = 'fixtures';
|
|
110
|
-
listType = 'MIDWEEK';
|
|
111
77
|
firstTable = [0, 4];
|
|
112
78
|
secondTable = [4, 8];
|
|
113
|
-
title = '
|
|
79
|
+
title = 'Match Play 8 Fixtures';
|
|
114
80
|
break;
|
|
115
|
-
case '
|
|
116
|
-
lotteryName = '
|
|
81
|
+
case 'matchplay14results':
|
|
82
|
+
lotteryName = 'matchplay14';
|
|
117
83
|
type = 'results';
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
title = 'Sportstake Cricket Results Weekend';
|
|
84
|
+
secondTableStart = 14;
|
|
85
|
+
firstTable = [0, 7];
|
|
86
|
+
secondTable = [7, 14];
|
|
87
|
+
title = 'Match Play 14 Results';
|
|
123
88
|
break;
|
|
124
|
-
case '
|
|
125
|
-
lotteryName = '
|
|
89
|
+
case 'matchplay14fixtures':
|
|
90
|
+
lotteryName = 'matchplay14';
|
|
126
91
|
type = 'fixtures';
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
title = 'Sportstake Cricket Fixtures Weekend';
|
|
92
|
+
firstTable = [0, 7];
|
|
93
|
+
secondTable = [7, 14];
|
|
94
|
+
title = 'Match Play 14 Fixtures';
|
|
131
95
|
break;
|
|
132
|
-
case '
|
|
133
|
-
lotteryName = '
|
|
96
|
+
case 'matchplay13results':
|
|
97
|
+
lotteryName = 'matchplay13';
|
|
134
98
|
type = 'results';
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
firstTable = [0, 10];
|
|
138
|
-
secondTable = [10, 20];
|
|
139
|
-
title = 'Sportstake Rugby Fixtures Weekend';
|
|
99
|
+
secondTableStart = 13;
|
|
100
|
+
title = 'Match Play 13 Results';
|
|
140
101
|
break;
|
|
141
|
-
case '
|
|
142
|
-
lotteryName = '
|
|
102
|
+
case 'matchplay13fixtures':
|
|
103
|
+
lotteryName = 'matchplay13';
|
|
143
104
|
type = 'fixtures';
|
|
144
|
-
|
|
145
|
-
firstTable = [0, 10];
|
|
146
|
-
secondTable = [10, 20];
|
|
147
|
-
title = 'Sportstake Rugby Fixtures Weekend';
|
|
105
|
+
title = 'Match Play 13 Fixtures';
|
|
148
106
|
break;
|
|
149
107
|
default:
|
|
150
108
|
break;
|
|
@@ -153,7 +111,6 @@ export function getApiQueryParams(moduleName) {
|
|
|
153
111
|
return {
|
|
154
112
|
type,
|
|
155
113
|
lotteryName,
|
|
156
|
-
listType,
|
|
157
114
|
secondTableStart,
|
|
158
115
|
firstTable,
|
|
159
116
|
secondTable,
|