From 55cdc36b50867b95803799ec24fe0be6cb9ec505 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 00:38:51 +0100
Subject: [PATCH 01/47] test :: heroku build using build-2;
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e117688d0..251c18a92 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
},
"scripts": {
"start": "node build/index.js",
- "build": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") vite build",
+ "build": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"build-2": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"test": "npm run test:integration && npm run test:unit",
"svelte-check": "svelte-check --tsconfig ./tsconfig.json",
From b1556a7ae57a0412f05a125e8268989e1cea1d44 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 00:43:29 +0100
Subject: [PATCH 02/47] test :: heroku build using build-2;
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 251c18a92..22cb47b80 100644
--- a/package.json
+++ b/package.json
@@ -9,8 +9,8 @@
},
"scripts": {
"start": "node build/index.js",
- "build": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
- "build-2": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
+ "build": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
+ "build-2": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build",
"test": "npm run test:integration && npm run test:unit",
"svelte-check": "svelte-check --tsconfig ./tsconfig.json",
"svelte-check::watch": "svelte-check --tsconfig ./tsconfig.json --watch",
From 7aa301626c17352bc70dd8abd6eb433b6a461384 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 01:22:37 +0100
Subject: [PATCH 03/47] add :: check for players with null links;
---
src/lib/utils/platform-functions.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lib/utils/platform-functions.ts b/src/lib/utils/platform-functions.ts
index 2935ac178..dea1c2108 100644
--- a/src/lib/utils/platform-functions.ts
+++ b/src/lib/utils/platform-functions.ts
@@ -1188,6 +1188,8 @@ export function cleanUrl
url: string
): string
{
+ if (url == null) return '';
+
url = url.replace
(
'https://scores.betarena.com',
From 35dc58c3f2a08323af407b7ca4d4b6153bf0c9d9 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 01:29:18 +0100
Subject: [PATCH 04/47] add :: correct page data variable property name;
---
src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
index 9d0f4aa98..a7ddc799a 100644
--- a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
+++ b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
@@ -210,7 +210,7 @@ export async function load
FIXTURE_LINEUPS_TRANSLATION,
FIXTURE_INCIDENTS,
FXITURE_INCIDENTS_TRANSLATION,
- FEATURED_BETTING_SITES_WIDGET_DATA_SEO,
+ B_FEATB_T,
FIXTURE_STATISTICS,
FIXTURE_STATISTICS_TRANSLATION,
FIXTURE_CONTENT,
@@ -322,7 +322,7 @@ export async function load
FIXTURE_LINEUPS_TRANSLATION,
FIXTURE_INCIDENTS,
FXITURE_INCIDENTS_TRANSLATION,
- FEATURED_BETTING_SITES_WIDGET_DATA_SEO,
+ B_FEATB_T,
FIXTURE_STATISTICS,
FIXTURE_STATISTICS_TRANSLATION,
FIXTURE_CONTENT,
From 7e0f0881b83f8cdf404407eaba1d862056c81ead Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 04:35:27 +0100
Subject: [PATCH 05/47] core :: /[fixture=fixture] +page.svelte update;
---
.../[sport]/[fixture=fixture]/+page.svelte | 43 ++++++++++++++++---
1 file changed, 37 insertions(+), 6 deletions(-)
diff --git a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.svelte b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.svelte
index 2a686548e..860009e8c 100644
--- a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.svelte
+++ b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.svelte
@@ -1,11 +1,42 @@
-
+
+
-
+
+
\ No newline at end of file
From b4d2874ba37852e42c573429b082fec60f3f722a Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 04:35:34 +0100
Subject: [PATCH 06/47] core :: /[fixture=fixture] +page.ts update;
---
.../[sport]/[fixture=fixture]/+page.ts | 531 ++++++++++--------
1 file changed, 302 insertions(+), 229 deletions(-)
diff --git a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
index 9d0f4aa98..7412a7aca 100644
--- a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
+++ b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
@@ -1,9 +1,14 @@
-// #region ➤ [MAIN] Package Imports
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+// ▓▓ 📝 DESCRIPTION ▓▓
+// ▓▓ Server Endpoint for Home Page (Prefetch) Data Load ▓▓
+// ▓▓ 🎟️ FILE TEMPLATE STRUCTURE VERSION ▓▓
+// ▓▓ v.7.0 ➤ (+page.ts) ▓▓
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
-import { error } from '@sveltejs/kit';
+// #region ➤ 📦 Package Imports
import { ERROR_CODE_INVALID, FIXTURE_PAGE_ERROR_MSG, dlog } from '$lib/utils/debug';
-import { PRELOAD_invalid_data, promiseUrlsPreload, promiseValidUrlCheck } from '$lib/utils/platform-functions.js';
+import { PRELOAD_exitPage, promiseUrlsPreload, promiseValidUrlCheck } from '$lib/utils/platform-functions.js';
import type { B_ABT_D, B_ABT_T } from '@betarena/scores-lib/types/about.js';
import type { B_CONT_D, B_CONT_T } from '@betarena/scores-lib/types/content.js';
@@ -17,12 +22,13 @@ import type { B_FS_D, B_FS_T } from '@betarena/scores-lib/types/scoreboard.js';
import type { B_SAP_D1, B_SAP_FP_D, B_SAP_FP_T } from '@betarena/scores-lib/types/seo-pages.js';
import type { B_STA_D, B_STA_T } from '@betarena/scores-lib/types/standings.js';
import type { B_ST_D, B_ST_T } from '@betarena/scores-lib/types/statistics.js';
+import type { B_FIX_COMP_TS } from '@betarena/scores-lib/types/types.fixture.competition.js';
import type { B_VOT_D, B_VOT_T } from '@betarena/scores-lib/types/votes.js';
import type { PageLoad } from './$types';
-// #endregion ➤ [MAIN] Package Imports
+// #endregion ➤ 📦 Package Imports
-const PAGE_LOG = '⏳ [FIXTURE] PRELOAD';
+// #region ➤ 🔄 LIFECYCLE [SVELTE]
/** @type {import('./$types').PageLoad} */
export async function load
@@ -35,9 +41,8 @@ export async function load
): Promise < PageLoad >
{
- const t0 = performance.now();
-
- //#region [0] IMPORTANT EXTRACT URL DATA
+ // ▓▓ [🐞]
+ const t0: number = performance.now();
const
{
@@ -54,11 +59,11 @@ export async function load
const fixture_id = url.pathname.match(/\d+$/);
- //#endregion [0] IMPORTANT EXTRACT URL DATA
-
- //#region [0] IMPORTANT VALID URL CHECK
+ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+ // ▓▓ 📌 VALIDATE URL ▓▓
+ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- const validUrlCheck = await promiseValidUrlCheck
+ const validUrlCheck: boolean = await promiseValidUrlCheck
(
fetch,
{
@@ -66,143 +71,28 @@ export async function load
sportUrl: sport,
fixtureUrl: fixture
}
- )
+ );
- // EXIT;
+ // ▓▓ CHECK
+ // ▓▓ for exit.
if (!validUrlCheck)
{
- exitPage
+ PRELOAD_exitPage
(
- t0
+ t0,
+ '[fixture=fixture]',
+ ERROR_CODE_INVALID,
+ FIXTURE_PAGE_ERROR_MSG
);
}
- //#endregion [0] IMPORTANT VALID URL CHECK
-
- //#region [0] IMPORTANT (PRE) PRE-LOAD DATA
+ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+ // ▓▓ 📌 PREFETCH DATA ▓▓
+ // ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- // [1] FIXTURE (CRITICAL) page data;
-
- type PP_PROMISE_0 =
- [
- B_SAP_FP_D | undefined
- ]
-
- const data_0 = await promiseUrlsPreload
- (
- [`/api/data/main/seo-pages?fixture_id=${fixture_id}&page=fixtures&hasura=true&decompress`],
- fetch
- ) as PP_PROMISE_0;
-
- const
- [
- FIXTURE_INFO
- ] = data_0;
-
- const id = FIXTURE_INFO?.data?.id == undefined ? undefined : FIXTURE_INFO?.data?.id.toString();
- const league_id = FIXTURE_INFO?.league_id;
- const league_name = FIXTURE_INFO?.data?.league_name;
- const country_id = FIXTURE_INFO?.data?.country_id;
- const homeTeamName = FIXTURE_INFO?.data?.home_team_name;
- const awayTeamName = FIXTURE_INFO?.data?.away_team_name;
- const fixture_day = FIXTURE_INFO?.data?.fixture_day == undefined ? undefined : FIXTURE_INFO?.data?.fixture_day.replace('T00:00:00', '');
- const venue_name = FIXTURE_INFO?.data?.venue_name;
- const venue_city = FIXTURE_INFO?.data?.venue_city;
- const teamIds: string = FIXTURE_INFO?.data?.team_ids;
-
- // [2] FIXTURE (CRITICAL) page data;
-
- type PP_PROMISE_1 =
- [
- B_SAP_D1 | undefined
- ]
-
- const data_1 = await promiseUrlsPreload
- (
- [`/api/data/main/seo-pages?country_id=${country_id}&decompress`],
- fetch
- ) as PP_PROMISE_1;
-
- const
- [
- COUNTRY_TRANSLATION
- ] = data_1;
-
- const country = COUNTRY_TRANSLATION?.translations[urlLang];
-
- FIXTURE_INFO.data.country = country;
- FIXTURE_INFO.data.sport = 'football';
-
- // TODO: add sports translation (get)
- // TODO: similar to that of country (above)
-
- //#endregion [0] IMPORTANT (PRE) PRE-LOAD DATA
-
- //#region [1] IMPORTANT PRE-LOAD DATA
-
- type PP_PROMISE_2 =
- [
- B_SAP_FP_T | undefined,
- B_FS_D | undefined,
- B_FS_T | undefined,
- B_LIN_D | undefined,
- B_LIN_T | undefined,
- B_INC_D | undefined,
- B_INC_T | undefined,
- B_FEATB_T | undefined,
- B_ST_D | undefined,
- B_ST_T | undefined,
- B_CONT_D | undefined,
- B_CONT_T | undefined,
- B_ABT_D | undefined,
- B_ABT_T | undefined,
- B_VOT_D | undefined,
- B_VOT_T | undefined,
- B_PR_D | undefined,
- B_PR_T | undefined,
- B_FO_T | undefined,
- B_H2H_D | undefined,
- B_H2H_T | undefined,
- B_STA_T | undefined,
- B_STA_D | undefined
- ]
-
- const urls: string[] =
- [
- `/api/data/main/seo-pages?lang=${urlLang}&page=fixtures&decompress`,
- `/api/data/fixture/scoreboard?fixture_id=${fixture_id}`,
- `/api/data/fixture/scoreboard?lang=${urlLang}`,
- `/api/data/fixture/lineups?fixture_id=${fixture_id}`,
- `/api/data/fixture/lineups?lang=${urlLang}`,
- `/api/data/fixture/incidents?fixture_id=${fixture_id}`,
- `/api/data/fixture/incidents?lang=${urlLang}`,
- `/api/data/home/feat-betsite?lang=${urlLang}&decompress`,
- `/api/data/fixture/statistics?fixture_id=${fixture_id}`,
- `/api/data/fixture/statistics?lang=${urlLang}`,
- `/api/data/fixture/content?fixture_id=${fixture_id}&lang=${urlLang}`,
- `/api/data/fixture/content?lang=${urlLang}`,
- `/api/data/fixture/about?fixture_id=${fixture_id}&lang=${urlLang}`,
- `/api/data/fixture/about?lang=${urlLang}`,
- `/api/data/fixture/votes?fixture_id=${fixture_id}`,
- `/api/data/fixture/votes?lang=${urlLang}`,
- `/api/data/fixture/probability?fixture_id=${fixture_id}`,
- `/api/data/fixture/probability?lang=${urlLang}`,
- // TODO: clean up;
- `/api/data/league/fix-odds?lang=${urlLang}`,
- `/api/data/fixture/h2h?teamIds=${teamIds}`,
- `/api/data/fixture/h2h?lang=${urlLang}`,
- `/api/data/league/standings?lang=${urlLang}`,
- `/api/data/league/standings?league_id=${league_id}`
- ];
-
- const data = await promiseUrlsPreload
- (
- urls,
- fetch
- ) as PP_PROMISE_2;
-
- const
+ let
[
+ FIXTURE_INFO,
PAGE_SEO,
FIXTURE_SCOREBOARD,
FIXTURE_SCOREBOARD_TRANSLATION,
@@ -225,86 +115,30 @@ export async function load
FIXTURE_H2H,
FIXTURE_H2H_TRANSLATION,
STANDINGS_T,
- STANDINGS_DATA
- ] = data;
-
- //#endregion [1] IMPORTANT PRE-LOAD DATA
-
- //#region [2] IMPORTANT REGEX + DATA INJECT
-
- PAGE_SEO.main_data = JSON.parse(
- JSON.stringify(PAGE_SEO.main_data)
- .replace(/{id}/g, id)
- .replace(/{lang}/g, lang)
- .replace(/{sport}/g, sport)
- .replace(/{country}/g, country)
- .replace(/{name}/g, league_name)
- .replace(/{home_team_name}/g, homeTeamName)
- .replace(/{away_team_name}/g, awayTeamName)
- .replace(/{fixtures_day}/g, fixture_day)
- .replace(/{data.venue.data.name}/g, venue_name)
- .replace(/{data.venue.data.city}/g, venue_city)
- );
-
- PAGE_SEO.twitter_card = JSON.parse(
- JSON.stringify(PAGE_SEO.twitter_card)
- .replace(/{id}/g, id)
- .replace(/{lang}/g, lang)
- .replace(/{sport}/g, sport)
- .replace(/{country}/g, country)
- .replace(/{name}/g, league_name)
- .replace(/{home_team_name}/g, homeTeamName)
- .replace(/{away_team_name}/g, awayTeamName)
- .replace(/{fixtures_day}/g, fixture_day)
- .replace(/{data.venue.data.name}/g, venue_name)
- .replace(/{data.venue.data.city}/g, venue_city)
- );
-
- PAGE_SEO.opengraph = JSON.parse(
- JSON.stringify(PAGE_SEO.opengraph)
- .replace(/{id}/g, id)
- .replace(/{lang}/g, lang)
- .replace(/{sport}/g, sport)
- .replace(/{country}/g, country)
- .replace(/{name}/g, league_name)
- .replace(/{home_team_name}/g, homeTeamName)
- .replace(/{away_team_name}/g, awayTeamName)
- .replace(/{fixtures_day}/g, fixture_day)
- .replace(/{data.venue.data.name}/g, venue_name)
- .replace(/{data.venue.data.city}/g, venue_city)
- );
-
- const enItemAlt = FIXTURE_INFO?.alternate_data?.[lang];
- PAGE_SEO.main_data.canonical = enItemAlt;
- FIXTURE_INFO.data.fixture_time = FIXTURE_SCOREBOARD?.fixture_time;
-
- //#endregion [2] IMPORTANT REGEX + DATA INJECT
-
- //#region [3] IMPORTANT RETURN
-
- const INVALID_PAGE_DATA_POINTS: boolean = data.includes(undefined);
-
- // EXIT;
- if (INVALID_PAGE_DATA_POINTS)
- {
- exitPage
- (
- t0
- );
- }
+ STANDINGS_DATA,
+ B_FIX_COMP_TS,
+ ] = await fetchData
+ (
+ fetch,
+ urlLang,
+ fixture_id as unknown as string,
+ );
- PRELOAD_invalid_data
+ PAGE_SEO = mutateSeoData
(
- data,
- urls
+ FIXTURE_INFO,
+ PAGE_SEO,
+ lang,
+ sport,
);
- const t1 = performance.now();
+ // ▓▓ [🐞]
+ const t1: number = performance.now();
- // [🐞]
+ // ▓▓ [🐞]
dlog
(
- `${PAGE_LOG} ${((t1 - t0) / 1000).toFixed(2)} sec`,
+ `⏳ FIXTURE preload ${((t1 - t0) / 1000).toFixed(2)} sec`,
true
);
@@ -338,30 +172,269 @@ export async function load
// extra
FIXTURES_ODDS_T,
STANDINGS_T,
- STANDINGS_DATA
+ STANDINGS_DATA,
+ B_FIX_COMP_TS
};
- //#endregion [3] IMPORTANT RETURN
-
}
-function exitPage
+// #endregion ➤ 🔄 LIFECYCLE [SVELTE]
+
+// #region ➤ 🛠️ METHODS
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 INTERFACE
+ * @description
+ * 📌 Target `types` for `_this_` page required at preload.
+ */
+type PP_PROMISE_0 =
+[
+ B_SAP_FP_D | undefined
+];
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 INTERFACE
+ * @description
+ * 📌 Target `types` for `_this_` page required at preload.
+ */
+type PP_PROMISE_1 =
+[
+ B_SAP_D1 | undefined
+];
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 INTERFACE
+ * @description
+ * 📌 Target `types` for `_this_` page required at preload.
+ */
+type PP_PROMISE_2 =
+[
+ B_SAP_FP_T | undefined,
+ B_FS_D | undefined,
+ B_FS_T | undefined,
+ B_LIN_D | undefined,
+ B_LIN_T | undefined,
+ B_INC_D | undefined,
+ B_INC_T | undefined,
+ B_FEATB_T | undefined,
+ B_ST_D | undefined,
+ B_ST_T | undefined,
+ B_CONT_D | undefined,
+ B_CONT_T | undefined,
+ B_ABT_D | undefined,
+ B_ABT_T | undefined,
+ B_VOT_D | undefined,
+ B_VOT_T | undefined,
+ B_PR_D | undefined,
+ B_PR_T | undefined,
+ B_FO_T | undefined,
+ B_H2H_D | undefined,
+ B_H2H_T | undefined,
+ B_STA_T | undefined,
+ B_STA_D | undefined,
+ B_FIX_COMP_TS | undefined,
+];
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 INTERFACE
+ * @description
+ * 📌 Target `types` for `_this_` page required at preload.
+ */
+type PP_PROMISE_FINAL =
+[
+ ...PP_PROMISE_0,
+ ...PP_PROMISE_2
+]
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 HELPER
+ * @description
+ * 📌 Fetches target data for `_this_` page.
+ * @param { any } fetch
+ * Target instance of `fetch` object.
+ * @param { string } _lang
+ * Target `language`.
+ * @param { string } _fixtureId
+ * Target `fixture id`.
+ * @returns { Promise < PP_PROMISE_0 > }
+ */
+async function fetchData
(
- t0: number,
- // (optional)
- reason?: string
-): void
+ fetch: any,
+ _lang: string,
+ _fixtureId: string
+): Promise < PP_PROMISE_FINAL >
{
- // [🐞]
- const t1 = performance.now();
+
+ // ### [🐞]
dlog
(
- `${PAGE_LOG} ${((t1 - t0) / 1000).toFixed(2)} sec`,
+ `🚏 checkpoint [PRL] ➤ src/routes/[[lang=lang]]/[sport]/[fixture=fixture] fecthData(..)`,
true
);
- throw error
+
+ const
+ [
+ FIXTURE_INFO
+ ] = await promiseUrlsPreload
(
- ERROR_CODE_INVALID,
- reason || FIXTURE_PAGE_ERROR_MSG
- );
-}
\ No newline at end of file
+ [`/api/data/main/seo-pages?fixture_id=${_fixtureId}&page=fixtures&hasura=true&decompress`],
+ fetch
+ ) as PP_PROMISE_0;
+
+ const leagueId: number = FIXTURE_INFO?.league_id;
+ const teamIds: string = FIXTURE_INFO?.data?.team_ids;
+
+ const
+ [
+ COUNTRY_TRANSLATION
+ ] = await promiseUrlsPreload
+ (
+ [`/api/data/main/seo-pages?country_id=${FIXTURE_INFO?.data?.country_id}&decompress`],
+ fetch
+ ) as PP_PROMISE_1;
+
+ FIXTURE_INFO.data.country = COUNTRY_TRANSLATION?.translations?.[_lang];
+ FIXTURE_INFO.data.sport = 'football';
+
+ // ▓▓ TODO:
+ // ▓▓ add sports translation (get)
+ // ▓▓ similar to that of country (above)
+
+ const urls_2: string[] =
+ [
+ `/api/data/main/seo-pages?lang=${_lang}&page=fixtures&decompress`,
+ `/api/data/fixture/scoreboard?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/scoreboard?lang=${_lang}`,
+ `/api/data/fixture/lineups?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/lineups?lang=${_lang}`,
+ `/api/data/fixture/incidents?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/incidents?lang=${_lang}`,
+ `/api/data/home/feat-betsite?lang=${_lang}&decompress`,
+ `/api/data/fixture/statistics?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/statistics?lang=${_lang}`,
+ `/api/data/fixture/content?fixture_id=${_fixtureId}&lang=${_lang}`,
+ `/api/data/fixture/content?lang=${_lang}`,
+ `/api/data/fixture/about?fixture_id=${_fixtureId}&lang=${_lang}`,
+ `/api/data/fixture/about?lang=${_lang}`,
+ `/api/data/fixture/votes?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/votes?lang=${_lang}`,
+ `/api/data/fixture/probability?fixture_id=${_fixtureId}`,
+ `/api/data/fixture/probability?lang=${_lang}`,
+ `/api/data/league/fix-odds?lang=${_lang}`,
+ `/api/data/fixture/h2h?teamIds=${teamIds}`,
+ `/api/data/fixture/h2h?lang=${_lang}`,
+ `/api/data/league/standings?lang=${_lang}`,
+ `/api/data/league/standings?league_id=${leagueId}`,
+ `/api/data/fixture/competition?lang=${_fixtureId}&decompress`,
+ ];
+
+ const data_2 = await promiseUrlsPreload
+ (
+ urls_2,
+ fetch
+ ) as PP_PROMISE_2;
+
+ FIXTURE_INFO.data.fixture_time = data_2?.[1]?.fixture_time;
+
+ const finalData: PP_PROMISE_FINAL =
+ [
+ FIXTURE_INFO,
+ ...data_2
+ ];
+
+ return finalData;
+}
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🔹 HELPER | IMPORTANT
+ * @param { B_SAP_FP_D } pageData
+ * competition (page) target - `seo` / `translations` data.
+ * @param { B_SAP_FP_T } pageSeo
+ * competition (page) target - critical data.
+ * @param { string } _lang
+ * competition (page) target `language` _translation_.
+ * @param { string } _sport
+ * competition (page) target `sport` _translation_.
+ * @returns { B_SAP_CTP_T }
+ * a mutated data `object`.
+ */
+function mutateSeoData
+(
+ pageData: B_SAP_FP_D,
+ pageSeo: B_SAP_FP_T,
+ _lang: string,
+ _sport: string,
+): B_SAP_FP_T
+{
+
+ pageSeo.main_data = JSON.parse
+ (
+ JSON.stringify(pageSeo?.main_data)
+ ?.replace(/{id}/g, pageData?.data?.id == undefined ? undefined : pageData?.data?.id.toString())
+ ?.replace(/{lang}/g, _lang)
+ ?.replace(/{sport}/g, _sport)
+ ?.replace(/{country}/g, pageData.data.country)
+ ?.replace(/{name}/g, pageData?.data?.league_name)
+ ?.replace(/{home_team_name}/g, pageData?.data?.home_team_name)
+ ?.replace(/{away_team_name}/g, pageData?.data?.away_team_name)
+ ?.replace(/{fixtures_day}/g, pageData?.data?.fixture_day == undefined ? undefined : pageData?.data?.fixture_day.replace('T00:00:00', ''))
+ ?.replace(/{data.venue.data.name}/g, pageData?.data?.venue_name)
+ ?.replace(/{data.venue.data.city}/g, pageData?.data?.venue_city)
+ );
+
+ pageSeo.twitter_card = JSON.parse
+ (
+ JSON.stringify(pageSeo?.twitter_card)
+ ?.replace(/{id}/g, pageData?.data?.id == undefined ? undefined : pageData?.data?.id.toString())
+ ?.replace(/{lang}/g, _lang)
+ ?.replace(/{sport}/g, _sport)
+ ?.replace(/{country}/g, pageData.data.country)
+ ?.replace(/{name}/g, pageData?.data?.league_name)
+ ?.replace(/{home_team_name}/g, pageData?.data?.home_team_name)
+ ?.replace(/{away_team_name}/g, pageData?.data?.away_team_name)
+ ?.replace(/{fixtures_day}/g, pageData?.data?.fixture_day == undefined ? undefined : pageData?.data?.fixture_day.replace('T00:00:00', ''))
+ ?.replace(/{data.venue.data.name}/g, pageData?.data?.venue_name)
+ ?.replace(/{data.venue.data.city}/g, pageData?.data?.venue_city)
+ );
+
+ pageSeo.opengraph = JSON.parse
+ (
+ JSON.stringify(pageSeo?.opengraph)
+ ?.replace(/{id}/g, pageData?.data?.id == undefined ? undefined : pageData?.data?.id.toString())
+ ?.replace(/{lang}/g, _lang)
+ ?.replace(/{sport}/g, _sport)
+ ?.replace(/{country}/g, pageData.data.country)
+ ?.replace(/{name}/g, pageData?.data?.league_name)
+ ?.replace(/{home_team_name}/g, pageData?.data?.home_team_name)
+ ?.replace(/{away_team_name}/g, pageData?.data?.away_team_name)
+ ?.replace(/{fixtures_day}/g, pageData?.data?.fixture_day == undefined ? undefined : pageData?.data?.fixture_day.replace('T00:00:00', ''))
+ ?.replace(/{data.venue.data.name}/g, pageData?.data?.venue_name)
+ ?.replace(/{data.venue.data.city}/g, pageData?.data?.venue_city)
+ );
+
+ const enItemAlt = pageData?.alternate_data?.[_lang];
+ pageSeo.main_data.canonical = enItemAlt;
+
+ return pageSeo;
+}
+
+// #endregion ➤ 🛠️ METHODS
\ No newline at end of file
From 3707f9c42a16b1189f71d18f75b647b6da46cd5c Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 04:35:56 +0100
Subject: [PATCH 07/47] feat :: data widget fixutre/competition (stable);
---
.../api/data/fixture/competition/+server.ts | 236 ++++++++++++++++++
1 file changed, 236 insertions(+)
create mode 100644 src/routes/api/data/fixture/competition/+server.ts
diff --git a/src/routes/api/data/fixture/competition/+server.ts b/src/routes/api/data/fixture/competition/+server.ts
new file mode 100644
index 000000000..a9d8e9bff
--- /dev/null
+++ b/src/routes/api/data/fixture/competition/+server.ts
@@ -0,0 +1,236 @@
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+// ▓▓ 📝 DESCRIPTION ▓▓
+// ▓▓ Application Server Endpoint for Competiton Data Fetch + Handle ▓▓
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+
+// #region ➤ 📦 Package Imports
+
+import { json } from '@sveltejs/kit';
+
+import { FIXCOMP_HP_ENTRY, FIXCOMP_HP_ENTRY_1 } from '@betarena/scores-lib/dist/functions/func.fixture.competition.js';
+import { FEATM_C_T_A } from '@betarena/scores-lib/dist/redis/config.js';
+import dotenv from 'dotenv';
+import LZString from 'lz-string';
+import { get_target_hset_cache_data } from '../../../../../lib/redis/std_main';
+
+import type { B_FIX_COMP_D, B_FIX_COMP_TS } from '@betarena/scores-lib/types/types.fixture.competition.js';
+
+// #endregion ➤ 📦 Package Imports
+
+// #region ➤ 📌 VARIABLES
+
+dotenv.config();
+
+// #endregion ➤ 📌 VARIABLES
+
+// #region ➤ 🛠️ METHODS
+
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+// ▓▓ ENDPOINT ENTRY ▓▓
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+
+export async function GET
+(
+ req: any
+): Promise < unknown >
+{
+ try
+ {
+ // ▓▓ NOTE:
+ // ▓▓ handle url-query data
+ const lang: string = req?.url?.searchParams?.get('lang');
+ const fixtureId: string = req?.url?.searchParams?.get('fixtureId');
+ const hasura: string = req?.url?.searchParams?.get('hasura');
+
+ // ▓▓ NOTE:
+ // ▓▓ gathers Featured Match Widget Main data.
+ // ▓▓ NOTE:
+ // ▓▓ contains [HASURA] Fallback.
+ const if_M_0: boolean =
+ fixtureId != null
+ ;
+ if (if_M_0)
+ {
+ let data: unknown;
+ let loadType: string = "cache";
+
+ // ▓▓ CHECK | IMPORTANT
+ // ▓▓ for existance in cache.
+ // if (!hasura)
+ // {
+ // data = await get_target_hset_cache_data
+ // (
+ // FEATM_C_D_A,
+ // geoPos
+ // );
+ // }
+
+ // ▓▓ CHECK | IMPORTANT
+ // ▓▓ for default in Hasura.
+ if (!data || hasura)
+ {
+ data = await fallbackMainData
+ (
+ fixtureId
+ );
+ loadType = 'HASURA'
+ }
+
+ // ▓▓ [🐞]
+ // console.log(`📌 loaded [HFEATM] with: ${loadType}`);
+
+ if (data != null)
+ {
+ const compressed: string = LZString.compress(JSON.stringify(data));
+
+ // ▓▓ [🐞]
+ console.log(JSON.parse(LZString.decompress(compressed)));
+
+ return json
+ (
+ {
+ data: compressed,
+ loadType
+ }
+ );
+ };
+ }
+
+ // ▓▓ NOTE:
+ // ▓▓ gathers Featured Match Widget Translation data.
+ // ▓▓ [+] contains [HASURA] Fallback.
+ const if_M_1: boolean =
+ lang != null
+ ;
+ if (if_M_1)
+ {
+ let data: unknown;
+ let loadType: string = "cache";
+
+ // ▓▓ CHECK | IMPORTANT
+ // ▓▓ for existance in cache.
+ if (!hasura)
+ {
+ data = await get_target_hset_cache_data
+ (
+ FEATM_C_T_A,
+ lang
+ );
+ }
+
+ // ▓▓ CHECK | IMPORTANT
+ // ▓▓ for default in Hasura.
+ if (!data || hasura)
+ {
+ data = await fallbackMainData_1
+ (
+ lang
+ );
+ loadType = 'HASURA'
+ }
+
+ // ▓▓ [🐞]
+ // console.log(`📌 loaded [HFEATM] with: ${loadType}`)
+
+ if (data != null)
+ {
+ const compressed: string = LZString.compress(JSON.stringify(data));
+
+ // ▓▓ [🐞]
+ // console.log(JSON.parse(LZString.decompress(compressed)));
+
+ return json
+ (
+ {
+ data: compressed,
+ loadType
+ }
+ );
+ };
+ }
+
+ // ▓▓ IMPORTANT
+ return json
+ (
+ null
+ );
+ }
+ catch (ex)
+ {
+ console.error
+ (
+ '❌ Err: ',
+ ex
+ );
+ return json
+ (
+ null,
+ {
+ status: 400,
+ statusText: 'Uh-oh! There has been an error'
+ }
+ );
+ }
+}
+
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+// ▓▓ METHOD(s) ▓▓
+// ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🟥 MAIN | 🔹 HELPER
+ * @description
+ * 📌 Fallback logic for **Competition** Main Data.
+ * @param { string } fixtureId
+ * Target `fixtureId`.
+ * @returns { Promise < B_FIX_COMP_D > }
+ */
+async function fallbackMainData
+(
+ fixtureId: string
+): Promise < B_FIX_COMP_D >
+{
+ const dataRes0: [ Map < number, B_FIX_COMP_D >, string[] ] = await FIXCOMP_HP_ENTRY
+ (
+ parseInt(fixtureId)
+ );
+
+ if (dataRes0?.[0].size == 0)
+ return null;
+ ;
+
+ return dataRes0?.[0].get(parseInt(fixtureId));
+}
+
+/**
+ * @author
+ * @migbash
+ * @summary
+ * 🟥 MAIN | 🔹 HELPER
+ * @description
+ * 📌 Fallback logic for **Competition** Translation Data.
+ * @param { string } lang
+ * Target `language`.
+ * @returns { Promise < B_FIX_COMP_TS > }
+ */
+async function fallbackMainData_1
+(
+ lang: string
+): Promise < B_FIX_COMP_TS >
+{
+ const dataRes0: [ Map < string, B_FIX_COMP_TS >, string[] ] = await FIXCOMP_HP_ENTRY_1
+ (
+ [lang]
+ );
+
+ if (dataRes0?.[0].size == 0)
+ return null;
+ ;
+
+ return dataRes0?.[0].get(lang);
+}
+
+// #endregion ➤ 🛠️ METHODS
\ No newline at end of file
From 713d14574b461c4fef38fb258bd7a1fe5ba87235 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 04:36:21 +0100
Subject: [PATCH 08/47] doc :: /[...competition_fill] +page.ts clean;
---
.../[...competition_fill]/+page.ts | 28 ++++++++-----------
1 file changed, 11 insertions(+), 17 deletions(-)
diff --git a/src/routes/[[lang=lang]]/[competitions=competitions]/[...competition_fill]/+page.ts b/src/routes/[[lang=lang]]/[competitions=competitions]/[...competition_fill]/+page.ts
index 5f5ceeb5f..5f4f102c1 100644
--- a/src/routes/[[lang=lang]]/[competitions=competitions]/[...competition_fill]/+page.ts
+++ b/src/routes/[[lang=lang]]/[competitions=competitions]/[...competition_fill]/+page.ts
@@ -5,9 +5,9 @@ import { PRELOAD_exitPage, promiseUrlsPreload, promiseValidUrlCheck } from '$lib
import type { B_SAP_CTP_D, B_SAP_CTP_T, B_SAP_D1, B_SAP_D3 } from '@betarena/scores-lib/types/seo-pages.js';
import type { B_COMP_MAIN_S, B_COMP_MAIN_T } from '@betarena/scores-lib/types/types.competition.main.js';
+import type { B_COMP_RULES_T } from '@betarena/scores-lib/types/types.competition.rules.js';
import type { ServerLoadEvent } from '@sveltejs/kit';
import type { PageLoad } from '../$types.js';
-import type { B_COMP_RULES_T } from '@betarena/scores-lib/types/types.competition.rules.js';
// #endregion ➤ 📦 Package Imports
@@ -70,8 +70,6 @@ export async function load
}
);
- console.log('🟩', validUrlCheck);
-
// ### CHECK
// ### for exit.
if (!validUrlCheck)
@@ -84,8 +82,6 @@ export async function load
);
}
- console.log('🟥');
-
let
[
B_SAP_CTP_T,
@@ -262,19 +258,17 @@ async function fetchData
}
/**
+ * @author
+ * @migbash
* @summary
- * 🔹 HELPER | IMPORTANT
- *
- * @param
- * { B_SAP_CTP_T } data - competition (page) target - `seo` / `translations` data.
- *
- * @param
- * { B_SAP_CTP_D } data2 - competition (page) target - critical data.
- *
- * @param
- * { string } pathname - competition (page) target current pathname.
- *
- * @returns
+ * 🔹 HELPER | IMPORTANT
+ * @param { B_SAP_CTP_T } data
+ * competition (page) target - `seo` / `translations` data.
+ * @param { B_SAP_CTP_D } data2
+ * competition (page) target - critical data.
+ * @param { string } pathname
+ * competition (page) target current pathname.
+ * @returns { B_SAP_CTP_T }
* a mutated data `object`.
*/
function mutateSeoData
From 5af8ed1e009378377bdb5755737dc2228220097c Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 04:36:39 +0100
Subject: [PATCH 09/47] feat :: widget parent (stable);
---
.../competition/Competition-Widget.svelte | 228 ++++++++++++++++++
1 file changed, 228 insertions(+)
create mode 100755 src/lib/components/page/fixture/competition/Competition-Widget.svelte
diff --git a/src/lib/components/page/fixture/competition/Competition-Widget.svelte b/src/lib/components/page/fixture/competition/Competition-Widget.svelte
new file mode 100755
index 000000000..28121841c
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/Competition-Widget.svelte
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{#await widgetInit()}
+
+
+
+{:then data}
+
+
+
+
+
+
+{:catch error}
+
+
+{/await}
\ No newline at end of file
From 3101c0e61c91b9116f0370123fcbbad8f05a2164 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 08:58:54 +0100
Subject: [PATCH 10/47] add :: necessary assets;
---
.../competition/assets/icon-facebook-hover.svg | 3 +++
.../competition/assets/icon-facebook-white.svg | 3 +++
.../fixture/competition/assets/icon-facebook.svg | 3 +++
.../competition/assets/icon-green-thumbs-up.svg | 4 ++++
.../fixture/competition/assets/icon-grey-draw.svg | 4 ++++
.../competition/assets/icon-grey-thumbs-down.svg | 4 ++++
.../competition/assets/icon-orange-thumbs-down.svg | 5 +++++
.../competition/assets/icon-orange-thumbs-up.svg | 4 ++++
.../competition/assets/icon-profile-avatar.svg | 13 +++++++++++++
.../competition/assets/icon-red-thumbs-down.svg | 4 ++++
.../page/fixture/competition/assets/icon-trophy.svg | 7 +++++++
.../competition/assets/icon-twitter-hover.svg | 3 +++
.../competition/assets/icon-twitter-white.svg | 3 +++
.../fixture/competition/assets/icon-twitter.svg | 3 +++
14 files changed, 63 insertions(+)
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-grey-draw.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-profile-avatar.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-trophy.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
create mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter.svg
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
new file mode 100755
index 000000000..9feb65e0d
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
new file mode 100755
index 000000000..b68478e80
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook.svg
new file mode 100755
index 000000000..66b7b66a2
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-facebook.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg b/src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg
new file mode 100755
index 000000000..ecac08f20
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-grey-draw.svg b/src/lib/components/page/fixture/competition/assets/icon-grey-draw.svg
new file mode 100755
index 000000000..811ec622f
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-grey-draw.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg
new file mode 100755
index 000000000..6ae0614dd
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg
@@ -0,0 +1,4 @@
+
\ No newline at end of file
diff --git a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg
new file mode 100755
index 000000000..c2719eca1
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg
new file mode 100755
index 000000000..2356e2c99
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-profile-avatar.svg b/src/lib/components/page/fixture/competition/assets/icon-profile-avatar.svg
new file mode 100755
index 000000000..16a025ca5
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-profile-avatar.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg
new file mode 100755
index 000000000..69fb1a7b9
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-trophy.svg b/src/lib/components/page/fixture/competition/assets/icon-trophy.svg
new file mode 100755
index 000000000..2d5336aee
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-trophy.svg
@@ -0,0 +1,7 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
new file mode 100755
index 000000000..49d7d5c89
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
new file mode 100755
index 000000000..f305efc2c
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter.svg
new file mode 100755
index 000000000..4d75eba82
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-twitter.svg
@@ -0,0 +1,3 @@
+
From 6d837ed28cfbbc4be0d4385432fa8e53d1f5ebc3 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 08:59:29 +0100
Subject: [PATCH 11/47] add :: fixture team translation + update data;
---
.../[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
index 7fe8eb746..aa675d8b7 100644
--- a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
+++ b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts
@@ -19,7 +19,7 @@ import type { B_INC_D, B_INC_T } from '@betarena/scores-lib/types/incidents.js';
import type { B_LIN_D, B_LIN_T } from '@betarena/scores-lib/types/lineups.js';
import type { B_PR_D, B_PR_T } from '@betarena/scores-lib/types/probabilities.js';
import type { B_FS_D, B_FS_T } from '@betarena/scores-lib/types/scoreboard.js';
-import type { B_SAP_D1, B_SAP_FP_D, B_SAP_FP_T } from '@betarena/scores-lib/types/seo-pages.js';
+import type { B_SAP_D1, B_SAP_D3, B_SAP_FP_D, B_SAP_FP_T } from '@betarena/scores-lib/types/seo-pages.js';
import type { B_STA_D, B_STA_T } from '@betarena/scores-lib/types/standings.js';
import type { B_ST_D, B_ST_T } from '@betarena/scores-lib/types/statistics.js';
import type { B_FIX_COMP_TS } from '@betarena/scores-lib/types/types.fixture.competition.js';
@@ -117,6 +117,7 @@ export async function load
STANDINGS_T,
STANDINGS_DATA,
B_FIX_COMP_TS,
+ B_SAP_D3_TEAM_M
] = await fetchData
(
fetch,
@@ -173,7 +174,8 @@ export async function load
FIXTURES_ODDS_T,
STANDINGS_T,
STANDINGS_DATA,
- B_FIX_COMP_TS
+ B_FIX_COMP_TS,
+ B_SAP_D3_TEAM_M
};
}
@@ -242,6 +244,7 @@ type PP_PROMISE_2 =
B_STA_T | undefined,
B_STA_D | undefined,
B_FIX_COMP_TS | undefined,
+ B_SAP_D3 | undefined,
];
/**
@@ -342,6 +345,7 @@ async function fetchData
`/api/data/league/standings?lang=${_lang}`,
`/api/data/league/standings?league_id=${leagueId}`,
`/api/data/fixture/competition?lang=${_fixtureId}&decompress`,
+ `/api/data/main/seo-pages?term=team&decompress`,
];
const data_2 = await promiseUrlsPreload
@@ -431,8 +435,7 @@ function mutateSeoData
?.replace(/{data.venue.data.city}/g, pageData?.data?.venue_city)
);
- const enItemAlt = pageData?.alternate_data?.[_lang];
- pageSeo.main_data.canonical = enItemAlt;
+ pageSeo.main_data.canonical = pageData?.alternate_data?.[_lang];
return pageSeo;
}
From bf931ca162fcef3d892c776cf64f8deee49070e3 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 09:00:00 +0100
Subject: [PATCH 12/47] add :: pre-liminary modal shared comp. data;
---
.../shared/COMP-Modal-Multiple.svelte | 576 ++++++++++++++++++
1 file changed, 576 insertions(+)
create mode 100755 src/lib/components/shared/COMP-Modal-Multiple.svelte
diff --git a/src/lib/components/shared/COMP-Modal-Multiple.svelte b/src/lib/components/shared/COMP-Modal-Multiple.svelte
new file mode 100755
index 000000000..207721701
--- /dev/null
+++ b/src/lib/components/shared/COMP-Modal-Multiple.svelte
@@ -0,0 +1,576 @@
+
+
+
+
+
+
+
+
closeModal()}
+/>
+
+
+
+
+
+ {#if viewType == 'confirm'}
+
+
+
+ Confirm that you wish to Join Yes and be charged for
+ {balanceDeductAmount} BTA from your current balance.
+
+
+
+
+
+
+
+
+
+
+
+ {/if}
+
+
+ {#if viewType == 'insufficient'}
+
+
+
+ You do not have enough balance to participate on this competition.
+
+
+
+
+
+
+
+ Please deposit to continue and be able to participate.
+
+
+
+
+
+
+
+ {/if}
+
+
+ {#if viewType == 'geo-restriction'}
+
+
+
+ The competitions are not yet available at your Geo location.
+
+
+
+
+
+
+
+ We will be launching new competitions
+ that will be available at your country. Be patient, thanks.
+
+
+
+
+
+
+
+
+
+
+
+ {/if}
+
+
+ {#if viewType == 'not-authenticated'}
+
+
+
+ Uh-oh! It looks like you are not a signed in.
+
+
+
+
+
+
+
+ Please sign in to your Betarena Account and/or register to participate in competitions.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/if}
+
+
+
+
+
+
From 769fbd6303b3fee2b8b397a5f29be415240223cf Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 09:00:29 +0100
Subject: [PATCH 13/47] update :: decompression for fixture/competition w;
---
.../page/fixture/competition/Competition-Widget.svelte | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Widget.svelte b/src/lib/components/page/fixture/competition/Competition-Widget.svelte
index 28121841c..c2c27b0b4 100755
--- a/src/lib/components/page/fixture/competition/Competition-Widget.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Widget.svelte
@@ -117,7 +117,10 @@
const response = await get
(
- `/api/data/fixture/competition?fixtureId=${miscFixturePageData?.data?.id}&decompress`
+ `/api/data/fixture/competition?fixtureId=${miscFixturePageData?.data?.id}&decompress`,
+ null,
+ true,
+ true,
) as B_FIX_COMP_D;
widgetDataMain = response;
@@ -212,6 +215,7 @@
-->
+
+
+
+
+
+
+{#if showModal}
+
showModal = false}
+ on:confirmEntry={() => joinCompetition()}
+ />
+{/if}
+
+
+
+
+
+
+
+
+
+
+
+ {#if
+ (!isJoinedThis || isJoinedNotThis)
+ && !['canceled', 'finished'].includes(competitionStatus)
+ }
+
+
+
+
+ {:else}
+
+
+
+
+ {#if competitionStatus == 'finished' && winnerGroup == viewType}
+
+ {/if}
+
+
+
+ {#if
+ isJoinedThis
+ && !['canceled', 'finished'].includes(competitionStatus)
+ }
+ {WIDGET_T_DATA?.title_joined ?? 'Joined'}
+ {:else if competitionStatus == 'canceled'}
+ {WIDGET_T_DATA?.title_canceled ?? 'Canceled'}
+ {:else if competitionStatus == 'finished'}
+ {winnerGroup == viewType ? (WIDGET_T_DATA?.title_won ?? 'WON') : (WIDGET_T_DATA?.title_lost ?? 'LOST')}
+ {/if}
+
+
+
+
+ {/if}
+
+
+
+
+
+
+
+
+ {WIDGET_T_DATA?.title_pool_prize ?? translationObject?.pool_prize}
+
+
+
+ {toDecimalFix(totalPrize, 2, true)} BTA
+
+ (${toDecimalFix(totalPrize, 2, true)})
+
+
+
+
+
+
+
+
+
+
+
+
From d9b5059ffa7ae59b089c2e90a482a1506914fbf8 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 09:01:22 +0100
Subject: [PATCH 15/47] add :: (fixture) competition main (stable);
---
.../competition/Competition-Main.svelte | 933 ++++++++++++++++++
1 file changed, 933 insertions(+)
create mode 100755 src/lib/components/page/fixture/competition/Competition-Main.svelte
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
new file mode 100755
index 000000000..4117af7bd
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -0,0 +1,933 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {B_SAP_D3_TEAM_M?.[$sessionStore?.serverLang]}
+
+
+
+
+
+ {WIDGET_DATA?.team_name ?? ''}
+
+
+
+
+
+ {WIDGET_T_DATA?.term_is_going_to_a ?? 'is going to'}
+
+
+
+
+
+
+
+
+
+
+
+
+ {#if prediction_type == 'win'}
+ {WIDGET_T_DATA?.prediction?.[1] ?? 'Win'}
+ {:else if prediction_type == 'loose'}
+ {WIDGET_T_DATA?.prediction?.[2] ?? 'Lose'}
+ {:else}
+ {WIDGET_T_DATA?.prediction?.x ?? 'Draw'}
+ {/if}
+
+
+
+
+
+ {#if WIDGET_DATA?.competition?.data?.prediction == '1'}
+ {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.home, 0)}%
+ {:else if WIDGET_DATA?.competition?.data?.prediction == '2'}
+ {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.away, 0)}%
+ {:else}
+ {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.draw, 0)}%
+ {/if}
+ {WIDGET_T_DATA?.title_prob ?? 'probability'}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 103a32d859ac122682ef13236b2a4fbbd39e13b2 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 09:01:47 +0100
Subject: [PATCH 16/47] add :: fixture layout competition widget;
---
src/lib/components/page/fixture/Layout.svelte | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lib/components/page/fixture/Layout.svelte b/src/lib/components/page/fixture/Layout.svelte
index de5cff8b5..61d50cd2d 100644
--- a/src/lib/components/page/fixture/Layout.svelte
+++ b/src/lib/components/page/fixture/Layout.svelte
@@ -29,6 +29,7 @@
import SvelteSeo from 'svelte-seo';
import FeatBetSiteWidget from '../home/feat-bet-site/FeatBetSite-Widget.svelte';
import Breadcrumb from './Breadcrumb.svelte';
+ import CompetitionWidget from './competition/Competition-Widget.svelte';
import LineupsWidget from './lineups/Lineups-Widget.svelte';
import StandingsWidget from './standings/Standings-Widget.svelte';
@@ -406,6 +407,7 @@ NOTE: [HINT] use (CTRL+SPACE) to select a (class) (id) style
>
+
From b87d21f227243ac6298e7e2b0031cf108e0c6251 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Mon, 16 Oct 2023 09:02:19 +0100
Subject: [PATCH 17/47] doc :: OpenApi update;
---
openapi.yaml | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/openapi.yaml b/openapi.yaml
index 0be057b7a..259db5796 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -1083,6 +1083,43 @@ paths:
description:
Target fixture H2H widget data
+ # ▓▓ ➤ FP Competition (widget)
+ /api/data/fixture/competition:
+ get:
+ summary:
+ Fixture ➤ Competition Widget
+
+ parameters:
+ - name: filter
+ in: query
+ description:
+ Fetch target fixture competition widget data.
+ required: true
+ style: form
+ explode: true
+ schema:
+ type: object
+ properties:
+ # ▓▓ ?fixtureId=[...]
+ fixtureId:
+ type: string
+ example: 18946409
+ # ▓▓ ?lang=[...]
+ lang:
+ type: string
+ example: es
+ additionalProperties: false
+ oneOf:
+ # ▓▓ translation
+ - required: [lang]
+ # ▓▓ data (main)
+ - required: [fixtureId]
+
+ responses:
+ 200:
+ description:
+ Success
+
# ===================
# 🤾 PLAYER PAGE
# ===================
From f1b0b2b572c089c8acbdb0d12a6059f165fe6dca Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:31:23 +0200
Subject: [PATCH 18/47] feat :: fixture layout competition widget (cont);
---
src/lib/components/page/fixture/Layout.svelte | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lib/components/page/fixture/Layout.svelte b/src/lib/components/page/fixture/Layout.svelte
index 61d50cd2d..534f7870a 100644
--- a/src/lib/components/page/fixture/Layout.svelte
+++ b/src/lib/components/page/fixture/Layout.svelte
@@ -12,6 +12,7 @@
import { onMount } from 'svelte';
import { createFixtureOddsPath, onceTargetLivescoreNowFixtureGet, targetLivescoreNowFixtureListen, targetLivescoreNowFixtureOddsListen } from '$lib/firebase/common.js';
+ import { subscribeCompetitionsAllListen } from '$lib/graphql/graphql.common.js';
import sessionStore from '$lib/store/session.js';
import userBetarenaSettings from '$lib/store/user-settings.js';
import { dlog } from '$lib/utils/debug';
@@ -278,6 +279,9 @@
{
await kickstartLivescore();
await kickstartLiveOdds();
+
+ subscribeCompetitionsAllListen();
+
resizeAction();
addEventListeners();
}
@@ -373,6 +377,7 @@ NOTE: [HINT] use (CTRL+SPACE) to select a (class) (id) style
class="grid-display-column"
class:display-none={$sessionStore.fixture_select_view == 'news'}
>
+
From 5a8ff0d55229b4ae7010a62237e43511e53cd60c Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:31:44 +0200
Subject: [PATCH 19/47] feat :: necessary assets (cont);
---
.../fixture/competition/assets/icon-facebook-hover.svg | 3 ---
.../fixture/competition/assets/icon-facebook-white.svg | 3 ---
.../page/fixture/competition/assets/icon-facebook.svg | 3 ---
.../competition/assets/icon-probability-green.svg | 10 ++++++++++
.../competition/assets/icon-probability-red.svg | 10 ++++++++++
.../competition/assets/icon-thumbs-down-white.svg | 4 ++++
.../competition/assets/icon-thumbs-up-white.svg | 4 ++++
.../fixture/competition/assets/icon-twitter-hover.svg | 3 ---
.../fixture/competition/assets/icon-twitter-white.svg | 3 ---
.../page/fixture/competition/assets/icon-twitter.svg | 3 ---
10 files changed, 28 insertions(+), 18 deletions(-)
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-facebook.svg
create mode 100644 src/lib/components/page/fixture/competition/assets/icon-probability-green.svg
create mode 100644 src/lib/components/page/fixture/competition/assets/icon-probability-red.svg
create mode 100644 src/lib/components/page/fixture/competition/assets/icon-thumbs-down-white.svg
create mode 100644 src/lib/components/page/fixture/competition/assets/icon-thumbs-up-white.svg
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
delete mode 100755 src/lib/components/page/fixture/competition/assets/icon-twitter.svg
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
deleted file mode 100755
index 9feb65e0d..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-facebook-hover.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
deleted file mode 100755
index b68478e80..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-facebook-white.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-facebook.svg b/src/lib/components/page/fixture/competition/assets/icon-facebook.svg
deleted file mode 100755
index 66b7b66a2..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-facebook.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-probability-green.svg b/src/lib/components/page/fixture/competition/assets/icon-probability-green.svg
new file mode 100644
index 000000000..1d126fcc9
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-probability-green.svg
@@ -0,0 +1,10 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-probability-red.svg b/src/lib/components/page/fixture/competition/assets/icon-probability-red.svg
new file mode 100644
index 000000000..956c6d1a1
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-probability-red.svg
@@ -0,0 +1,10 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-white.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-white.svg
new file mode 100644
index 000000000..28a0eaed3
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-white.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-white.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-white.svg
new file mode 100644
index 000000000..7226a7088
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-white.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
deleted file mode 100755
index 49d7d5c89..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-twitter-hover.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
deleted file mode 100755
index f305efc2c..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-twitter-white.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-twitter.svg b/src/lib/components/page/fixture/competition/assets/icon-twitter.svg
deleted file mode 100755
index 4d75eba82..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-twitter.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
From f0d557fee9768126a9aa8844a8680703d336ef78 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:32:00 +0200
Subject: [PATCH 20/47] feat :: (fixture) competition main (cont);
---
.../competition/Competition-Main.svelte | 925 +++++++++++++-----
1 file changed, 664 insertions(+), 261 deletions(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index 4117af7bd..31a15061f 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -1,4 +1,4 @@
-
+
-
-
+
+
+
-
-
+
+
+
-
+
+
-
+
- {B_SAP_D3_TEAM_M?.[$sessionStore?.serverLang]}
-
-
-
+ {B_SAP_D3_TEAM_M?.[$sessionStore?.serverLang]}
+
+
+
+
+
+ {WIDGET_DATA?.team_name ?? ''}
+
+
+
+
+
+
+
+
+
+ {WIDGET_T_DATA?.term_is_going_to_a ?? 'is going to'}
+
+
+
+
+
+
+
+
+ {#if prediction_type == 'win'}
+ {WIDGET_T_DATA?.prediction?.[1] ?? 'Win'}
+ {:else if prediction_type == 'loose'}
+ {WIDGET_T_DATA?.prediction?.[2] ?? 'Lose'}
+ {:else}
+ {WIDGET_T_DATA?.prediction?.x ?? 'Draw'}
+ {/if}
+
+
+
+
+
+
+
+ {#if WIDGET_DATA?.competition?.data?.status != 'pending' && !isViewMobile}
+
+ {/if}
+
+
+
+
+ {#if isViewMobile}
+
+
+
+ >
+
+
+ {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+
+
+
+
+ {toDecimalFix(mirrorProbability, 0)}%
+
+
+
50 ? icon_probability_green : icon_probability_red}
+ alt='probability_icon'
+ title='Probability'
+ loading='lazy'
+ />
+
+
+
+
+ {/if}
+
+
-
+
+
+
+ {#if !isViewMobile}
+
+
+
+
+
+ {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+
+
+
+
+ {toDecimalFix(mirrorProbability, 0)}%
+
+
+
50 ? icon_probability_green : icon_probability_red}
+ alt='probability_icon'
+ title='Probability'
+ loading='lazy'
+ />
+
+
+
+
+ {/if}
+
+
+
+
+
+ {WIDGET_T_DATA?.title_entry_fee ?? 'Entry Fee'}
+
+
+
- {WIDGET_DATA?.team_name ?? ''}
-
+ {WIDGET_DATA?.competition?.data?.entry_fee ?? ''} BTA
+
+ (${WIDGET_DATA?.competition?.data?.entry_fee ?? ''})
+
+
-
+
- {WIDGET_T_DATA?.term_is_going_to_a ?? 'is going to'}
-
+
+
+ {WIDGET_T_DATA?.title_total_prize ?? 'Total prize'}
+
+
+
+
+ {#if !counterTotalAnimated}
+ {toDecimalFix((WIDGET_DATA?.competition?.data?.total_prize - WIDGET_DATA?.competition?.data?.betarena_commission), 2, true) ?? ''} BTA
+ {:else}
+ {toDecimalFix(counterTotalPrize, 2, true)} BTA
+ {/if}
+
+
+ {#if !counterTotalAnimated}
+ (${toDecimalFix((WIDGET_DATA?.competition?.data?.total_prize - WIDGET_DATA?.competition?.data?.betarena_commission), 2, true) ?? ''})
+ {:else}
+ (${toDecimalFix(counterTotalPrize, 2, true)})
+ {/if}
+
+
+
+
+
+ {#if WIDGET_DATA?.competition?.data?.status != 'pending' && isViewMobile}
+
+ {/if}
+
+
+
+
+
+
+
+
+ 0
+ ? ((WIDGET_DATA?.competition?.data?.participants?.no?.length * WIDGET_DATA?.competition?.data?.entry_fee) - (WIDGET_DATA?.competition?.data?.betarena_commission))
+ : 0
+ ) ?? 0
+ }
+ winnerGroup={WIDGET_DATA?.competition?.data?.winner_group}
+ viewType={'yes'}
+ participantList={WIDGET_DATA?.competition?.data?.participants?.yes}
+ {participantsMap}
+ />
+
+
+ 0
+ ? ((WIDGET_DATA?.competition?.data?.participants?.yes?.length * WIDGET_DATA?.competition?.data?.entry_fee) - (WIDGET_DATA?.competition?.data?.betarena_commission))
+ : 0
+ ) ?? 0
+ }
+ winnerGroup={WIDGET_DATA?.competition?.data?.winner_group}
+ viewType={'no'}
+ participantList={WIDGET_DATA?.competition?.data?.participants?.no}
+ {participantsMap}
+ />
+
+
+
+
+
+
+
-
+ >
+ Type
+
- {#if prediction_type == 'win'}
- {WIDGET_T_DATA?.prediction?.[1] ?? 'Win'}
- {:else if prediction_type == 'loose'}
- {WIDGET_T_DATA?.prediction?.[2] ?? 'Lose'}
- {:else}
- {WIDGET_T_DATA?.prediction?.x ?? 'Draw'}
- {/if}
+
+ Single Predictor
-
+
- {#if WIDGET_DATA?.competition?.data?.prediction == '1'}
- {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.home, 0)}%
- {:else if WIDGET_DATA?.competition?.data?.prediction == '2'}
- {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.away, 0)}%
- {:else}
- {toDecimalFix(WIDGET_DATA?.fixture?.probabilities?.draw, 0)}%
+
+
+ {WIDGET_DATA?.competition?.data?.participants?.yes?.length ?? 0}
+ {WIDGET_T_DATA?.title_participants ?? translationObject?.participants}
+
+
+ {#if WIDGET_DATA?.competition?.data?.participants?.yes?.length > 0}
+
+
+
+ {#each WIDGET_DATA?.competition?.data?.participants?.yes?.slice(0, (isViewTablet ? 3 : 5)) ?? [] as uid}
+
+
+
+ {/each}
+
+
+
{/if}
- {WIDGET_T_DATA?.title_prob ?? 'probability'}
-
+
+
@@ -685,13 +1190,6 @@ COMPETITION MAIN
-
-
-
-
-
{#if showModal}
-
showModal = false}
on:confirmEntry={() => joinCompetition()}
/>
{/if}
{#if
(!isJoinedThis || isJoinedNotThis)
@@ -313,11 +276,22 @@ PARTICIPANTS VOTE LIST
class:color-grey={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
disabled={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
>
- {viewType == 'yes' ? (WIDGET_T_DATA?.title_join_yes ?? 'Yes') : (WIDGET_T_DATA?.title_join_no ?? 'No')}
+
+ Join {viewType == 'yes' ? (WIDGET_T_DATA?.title_join_yes ?? 'Yes') : (WIDGET_T_DATA?.title_join_no ?? 'No')}
{:else}
@@ -393,27 +367,31 @@ PARTICIPANTS VOTE LIST
-
{WIDGET_T_DATA?.title_pool_prize ?? translationObject?.pool_prize}
@@ -424,7 +402,6 @@ PARTICIPANTS VOTE LIST
s-16
color-black-2
w-500
- m-t-5
"
>
{toDecimalFix(totalPrize, 2, true)} BTA
@@ -447,60 +424,35 @@ PARTICIPANTS VOTE LIST
From d22b8ecec15d74677491675ce8033767c541d522 Mon Sep 17 00:00:00 2001
From: migbash <20924663+migbash@users.noreply.github.com>
Date: Tue, 17 Oct 2023 13:32:56 +0200
Subject: [PATCH 22/47] feat :: pre-liminary modal shared comp. modal;
---
.../shared/COMP-Modal-Multiple.svelte | 168 ++++++++++--------
1 file changed, 93 insertions(+), 75 deletions(-)
diff --git a/src/lib/components/shared/COMP-Modal-Multiple.svelte b/src/lib/components/shared/COMP-Modal-Multiple.svelte
index 207721701..03aefcaaf 100755
--- a/src/lib/components/shared/COMP-Modal-Multiple.svelte
+++ b/src/lib/components/shared/COMP-Modal-Multiple.svelte
@@ -1,27 +1,27 @@
diff --git a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
index 8f4d4c5f1..da26b7f1e 100755
--- a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
@@ -35,7 +35,9 @@
import CompModalMultiple from '../../../shared/COMP-Modal-Multiple.svelte';
+ import icon_thumbs_down_grey from './assets/icon-thumbs-down-grey.svg';
import icon_thumbs_down_white from './assets/icon-thumbs-down-white.svg';
+ import icon_thumbs_up_grey from './assets/icon-thumbs-up-grey.svg';
import icon_thumbs_up_white from './assets/icon-thumbs-up-white.svg';
import icon_trophy from './assets/icon-trophy.svg';
@@ -88,8 +90,6 @@
WIDGET_T_DATA: B_COMP_MAIN_T,
/** @description competition (main) | show / hide main modal information */
showModal: boolean = false,
- /** @description competition (main) | view type */
- modalViewType: 'confirm' | 'insufficient' | 'geo-restriction' | 'not-authenticated' = 'confirm',
/** @description competition (main) | disabled buttons */
disabledJoinBtn: boolean = true
;
@@ -213,7 +213,7 @@
-->
{#if showModal}
{#if
(!isJoinedThis || isJoinedNotThis)
@@ -277,7 +277,7 @@ POOL SELECTION ➡ MAIN
>
{:else}
@@ -302,18 +302,18 @@ POOL SELECTION ➡ MAIN
"
class:green=
{
- isJoinedThis && !['canceled', 'finished'].includes(competitionStatus)
- || competitionStatus == 'finished' && winnerGroup == viewType
+ (isJoinedThis && !['canceled', 'finished'].includes(competitionStatus))
+ || (competitionStatus == 'finished' && winnerGroup == viewType)
}
class:disabled=
{
competitionStatus == 'canceled'
- || competitionStatus == 'finished' && winnerGroup != viewType
+ || (competitionStatus == 'finished' && winnerGroup != viewType)
}
>
{#if competitionStatus == 'finished' && winnerGroup == viewType}
+ {#if isJoinedThis && !['canceled', 'finished'].includes(competitionStatus)}
+
+ {/if}
+
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg
deleted file mode 100755
index 6ae0614dd..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-grey-thumbs-down.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
\ No newline at end of file
diff --git a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg
deleted file mode 100755
index c2719eca1..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-down.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg b/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg
deleted file mode 100755
index 2356e2c99..000000000
--- a/src/lib/components/page/fixture/competition/assets/icon-orange-thumbs-up.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-grey.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-grey.svg
new file mode 100644
index 000000000..02c2d95bd
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-grey.svg
@@ -0,0 +1,4 @@
+
diff --git a/src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-down-red.svg
old mode 100755
new mode 100644
similarity index 100%
rename from src/lib/components/page/fixture/competition/assets/icon-red-thumbs-down.svg
rename to src/lib/components/page/fixture/competition/assets/icon-thumbs-down-red.svg
diff --git a/src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-green.svg
old mode 100755
new mode 100644
similarity index 100%
rename from src/lib/components/page/fixture/competition/assets/icon-green-thumbs-up.svg
rename to src/lib/components/page/fixture/competition/assets/icon-thumbs-up-green.svg
diff --git a/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-grey.svg b/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-grey.svg
new file mode 100644
index 000000000..16adf8b2c
--- /dev/null
+++ b/src/lib/components/page/fixture/competition/assets/icon-thumbs-up-grey.svg
@@ -0,0 +1,4 @@
+
diff --git a/static/app.css b/static/app.css
index 98f538cd4..8d3a13cfa 100644
--- a/static/app.css
+++ b/static/app.css
@@ -161,6 +161,7 @@ p {
--dark-theme-1-2-shade: #737373;
--dark-theme-1-3-shade: #999999;
--dark-theme-1-4-shade: #383838;
+ --dark-theme-1-7-shade: #313131;
--dark-theme-1-5-shade: #161616;
--dark-theme-1-5-shade-o-0-2: rgba(22, 22, 22, 0.2);
/*
@@ -830,7 +831,7 @@ FLEX DISPLAYS
*/
.flex-start
{
- align-items: flex-start;
+ align-items: flex-start !important;
}
.row-space-out {
display: flex;
From 04002a9f41ea7a7833db16f76b2abf3ebf9cf84b Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Thu, 19 Oct 2023 02:15:20 +0100
Subject: [PATCH 31/47] #1764 :: fix
---
src/lib/components/_main_/header/Header.svelte | 1 +
.../competition/Competition-Pool-Selection.svelte | 11 +++++------
src/lib/store/session.ts | 1 +
src/lib/types/types.scores.d.ts | 5 +++++
4 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/lib/components/_main_/header/Header.svelte b/src/lib/components/_main_/header/Header.svelte
index 3a799b9cf..d8a3fce39 100644
--- a/src/lib/components/_main_/header/Header.svelte
+++ b/src/lib/components/_main_/header/Header.svelte
@@ -474,6 +474,7 @@
($sessionStore.livescoreShowCalendar && isViewMobile)
|| $sessionStore.withdrawModal
|| $sessionStore.showUserguide1
+ || $sessionStore.isShowFixtureCompetitionJoinModal
;
$: if (if_R_4)
{
diff --git a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
index da26b7f1e..1be079a56 100755
--- a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
@@ -32,6 +32,7 @@
import userBetarenaSettings from '$lib/store/user-settings.js';
import { checkNull, toDecimalFix } from '$lib/utils/platform-functions.js';
import { translationObject } from '$lib/utils/translation.js';
+ import sessionStore from '$lib/store/session.js';
import CompModalMultiple from '../../../shared/COMP-Modal-Multiple.svelte';
@@ -88,8 +89,6 @@
let
/** @augments B_COMP_MAIN_T */
WIDGET_T_DATA: B_COMP_MAIN_T,
- /** @description competition (main) | show / hide main modal information */
- showModal: boolean = false,
/** @description competition (main) | disabled buttons */
disabledJoinBtn: boolean = true
;
@@ -136,7 +135,7 @@
{
if (!browser) return;
- showModal = false
+ $sessionStore.isShowFixtureCompetitionJoinModal = false;
// ▓▓ [🐞]
// alert('Joining Competition');
@@ -215,13 +214,13 @@
-{#if showModal}
+{#if $sessionStore.isShowFixtureCompetitionJoinModal}
showModal = false}
+ on:closeModal={() => $sessionStore.isShowFixtureCompetitionJoinModal = false}
on:confirmEntry={() => joinCompetition()}
/>
{/if}
@@ -270,7 +269,7 @@
w-500
btn-primary-v2
"
- on:click={() => showModal = true}
+ on:click={() => $sessionStore.isShowFixtureCompetitionJoinModal = true}
class:disabled={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
class:color-grey={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
disabled={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
diff --git a/src/lib/store/session.ts b/src/lib/store/session.ts
index ea0fd458f..0fa1f84f5 100644
--- a/src/lib/store/session.ts
+++ b/src/lib/store/session.ts
@@ -31,6 +31,7 @@ const sessionStoreObj: Platform_Session =
showUserguide1: false,
showUserguide1Conf: false,
showFixtureCompetition: false,
+ isShowFixtureCompetitionJoinModal: false,
// ### NOTE:
// ### variables for language handle.
lang_intent: undefined,
diff --git a/src/lib/types/types.scores.d.ts b/src/lib/types/types.scores.d.ts
index 749c78152..bdf1776cb 100644
--- a/src/lib/types/types.scores.d.ts
+++ b/src/lib/types/types.scores.d.ts
@@ -228,6 +228,11 @@ export interface Platform_Session
* 📌 Toggle `visibility` (show/hide) of Fixture Competition (widget) access.
*/
showFixtureCompetition?: boolean;
+ /**
+ * @description
+ * 📌 Toggle `visibility` (show/hide) of Fixture Competition (widget) Modal View.
+ */
+ isShowFixtureCompetitionJoinModal?: boolean;
// ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
// NOTE: SPORTBOOK DATA ◼️
From 008fa6b144502b120565669f9a1c748077d130ea Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Thu, 19 Oct 2023 02:20:21 +0100
Subject: [PATCH 32/47] #1770 :: fix / feat
---
.../competition/Competition-Main.svelte | 584 +++++++++---------
1 file changed, 294 insertions(+), 290 deletions(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index 97b3d0f0f..06bf398e9 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -579,187 +579,316 @@
-
-
-
+
+
+
+
+ {B_SAP_D3_TEAM_M?.[$sessionStore?.serverLang]}
+
+
+
+
+
+
+
+ {WIDGET_T_DATA?.term_is_going_to_a ?? 'is going to'}
+
+
+
+
+
+
+
+
+
- {B_SAP_D3_TEAM_M?.[$sessionStore?.serverLang]}
+ {WIDGET_DATA?.team_name ?? ''}
-
+
+ >
-
+
-
-
- {WIDGET_T_DATA?.term_is_going_to_a ?? 'is going to'}
-
+
+ {#if prediction_type == 'win'}
+ {WIDGET_T_DATA?.prediction?.[1] ?? 'Win'}
+ {:else if prediction_type == 'loose'}
+ {WIDGET_T_DATA?.prediction?.[2] ?? 'Lose'}
+ {:else}
+ {WIDGET_T_DATA?.prediction?.x ?? 'Draw'}
+ {/if}
+
+
+
+
+
-
+ {#if isViewMobile}
-
- {WIDGET_DATA?.team_name ?? ''}
-
+
+
+ {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+
+
+
+
+ {toDecimalFix(mirrorProbability, 0)}%
+
+
+
50 ? icon_probability_green : icon_probability_red}
+ alt='probability_icon'
+ title='Probability'
+ loading='lazy'
+ />
+
+
+
+
+ {/if}
+
+
+
+
+
+
+
+ {#if !isViewMobile}
-
+ >
+ {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+
-
- {#if prediction_type == 'win'}
- {WIDGET_T_DATA?.prediction?.[1] ?? 'Win'}
- {:else if prediction_type == 'loose'}
- {WIDGET_T_DATA?.prediction?.[2] ?? 'Lose'}
- {:else}
- {WIDGET_T_DATA?.prediction?.x ?? 'Draw'}
- {/if}
-
-
-
+
+ {toDecimalFix(mirrorProbability, 0)}%
+
-
+ 50 ? icon_probability_green : icon_probability_red}
+ alt='probability_icon'
+ title='Probability'
+ loading='lazy'
+ />
+
-
+
-
- {#if isViewMobile}
+ {/if}
- {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+ {WIDGET_T_DATA?.title_entry_fee ?? 'Entry Fee'}
-
-
- {toDecimalFix(mirrorProbability, 0)}%
-
-
-
50 ? icon_probability_green : icon_probability_red}
- alt='probability_icon'
- title='Probability'
- loading='lazy'
- />
-
+ (${WIDGET_DATA?.competition?.data?.entry_fee ?? ''})
+
+
- {/if}
-
-
-
-
-
-
-
- {#if !isViewMobile}
-
- {WIDGET_T_DATA?.title_prob ?? 'Probability'}
+ {WIDGET_T_DATA?.title_total_prize ?? 'Total prize'}
-
-
- {toDecimalFix(mirrorProbability, 0)}%
-
+ {#if !counterTotalAnimated}
+ (${toDecimalFix((WIDGET_DATA?.competition?.data?.total_prize - WIDGET_DATA?.competition?.data?.betarena_commission), 2, true) ?? ''})
+ {:else}
+ (${toDecimalFix(counterTotalPrize, 2, true)})
+ {/if}
+
-
50 ? icon_probability_green : icon_probability_red}
- alt='probability_icon'
- title='Probability'
- loading='lazy'
- />
-
+
- {/if}
-
-
-
-
-
- {WIDGET_T_DATA?.title_entry_fee ?? 'Entry Fee'}
-
-
-
- {WIDGET_DATA?.competition?.data?.entry_fee ?? ''} BTA
-
- (${WIDGET_DATA?.competition?.data?.entry_fee ?? ''})
-
-
-
-
-
-
- {WIDGET_T_DATA?.title_total_prize ?? 'Total prize'}
-
-
-
-
- {#if !counterTotalAnimated}
- {toDecimalFix((WIDGET_DATA?.competition?.data?.total_prize - WIDGET_DATA?.competition?.data?.betarena_commission), 2, true) ?? ''} BTA
- {:else}
- {toDecimalFix(counterTotalPrize, 2, true)} BTA
- {/if}
-
-
- {#if !counterTotalAnimated}
- (${toDecimalFix((WIDGET_DATA?.competition?.data?.total_prize - WIDGET_DATA?.competition?.data?.betarena_commission), 2, true) ?? ''})
- {:else}
- (${toDecimalFix(counterTotalPrize, 2, true)})
- {/if}
-
-
-
-
-
+
+
+ {/if}
-
-
- {#if WIDGET_DATA?.competition?.data?.status != 'pending'}
-
-
-
- {/if}
-
-
+
-
-
- Type
-
-
-
- Single Predictor
-
+
+ Type
+
-
+
+
+ Single Predictor
+
+
+
+
+
+
+
+
+ {`${langPrefix()}${miscFixturePageData1?.[$sessionStore?.serverLang]}`}
+
+
+
+ {widgetDataSeo?.data?.competition_url}
+
-{#if $sessionStore.isShowFixtureCompetitionJoinModal}
+{#if $sessionStore.isShowFixtureCompetitionJoinModal && showModal}
$sessionStore.isShowFixtureCompetitionJoinModal = false}
+ on:closeModal={() => { $sessionStore.isShowFixtureCompetitionJoinModal = false; showModal = false; }}
on:confirmEntry={() => joinCompetition()}
/>
{/if}
@@ -269,7 +273,7 @@
w-500
btn-primary-v2
"
- on:click={() => $sessionStore.isShowFixtureCompetitionJoinModal = true}
+ on:click={() => { $sessionStore.isShowFixtureCompetitionJoinModal = true; showModal = true; }}
class:disabled={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
class:color-grey={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
disabled={isJoinedNotThis || competitionStatus != 'pending' || disabledJoinBtn}
diff --git a/src/lib/components/shared/COMP-Modal-Multiple.svelte b/src/lib/components/shared/COMP-Modal-Multiple.svelte
index 5a1937f46..92a1524ab 100755
--- a/src/lib/components/shared/COMP-Modal-Multiple.svelte
+++ b/src/lib/components/shared/COMP-Modal-Multiple.svelte
@@ -29,6 +29,8 @@
import sessionStore from '$lib/store/session.js';
import userBetarenaSettings from '$lib/store/user-settings.js';
+ import type { B_C_COMP_DATA_Prediction_Group } from '@betarena/scores-lib/types/_HASURA_.js';
+
// #endregion ➤ 📦 Package Imports
// #region ➤ 📌 VARIABLES
@@ -47,7 +49,9 @@
/** @description competition (main) | amount entry fee */
balanceDeductAmount: number,
/** @description competition (main) | imposed geo-location restriction */
- geoLocationRestrictions: string[]
+ geoLocationRestrictions: string[],
+ /** @description target casted vote on competition by user */
+ targetVote: B_C_COMP_DATA_Prediction_Group
;
const
@@ -219,7 +223,7 @@ MODAL - DYNAMIC
color-black-2
"
>
- Confirm that you wish to Join Yes and be charged for
+ Confirm that you wish to Join {targetVote} and be charged for
{balanceDeductAmount} BTA from your current balance.
From 71f2c1b666f11ed6938ef52f18a32c5d384b2280 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Thu, 19 Oct 2023 20:09:19 +0100
Subject: [PATCH 43/47] #1788 :: fix
---
.../components/page/fixture/competition/Competition-Main.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index a3a1d6485..b1de48c03 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -1329,7 +1329,7 @@
div#fixture⮕competition⮕w⮕main⮕participants img.participant-main-img
{
/* 🎨 style */
- margin-right: -15px;
+ margin-right: -9px;
border-radius: 32px;
border: 2px solid var(--whitev2);
}
From 25fdf5a7dcece42fab6862cc0aa4f0502fddaacf Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Thu, 19 Oct 2023 22:50:47 +0100
Subject: [PATCH 44/47] fix :: #1765,#1785,#1767;
---
.../page/fixture/competition/Competition-Pool-Selection.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
index 7a1a3b1a5..f662d31df 100755
--- a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
@@ -545,7 +545,7 @@
.dark-background-1 .disabled
{
/* 🎨 style */
- background-color: var(--dark-theme-1-7-shade) !important;
+ background-color: rgba(49, 49, 49, 0.5) !important;
}
From d0e23df4d3fde107f73dbeeb6464f5ebd3810d1e Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Sat, 21 Oct 2023 08:36:50 +0100
Subject: [PATCH 45/47] #1794 :: fix;
---
.../components/page/fixture/competition/Competition-Main.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index b1de48c03..ddf913b84 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -81,7 +81,7 @@
/** @description 📱 MOBILE */
VIEWPORT_MOBILE_INIT = 581,
/** @description 💻 TABLET */
- VIEWPORT_TABLET_INIT = 658,
+ VIEWPORT_TABLET_INIT = 820,
/** @description 📌 `this` component **main** `id` and `data-testid` prefix. */
CNAME = 'fixture⮕competition⮕w⮕main'
;
From b36bbe0f42f2f99177d027f703b0ba63b1f66c0a Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Sat, 21 Oct 2023 08:42:01 +0100
Subject: [PATCH 46/47] #1793 :: fix;
---
.../page/fixture/competition/Competition-Main.svelte | 4 ++--
.../fixture/competition/Competition-Pool-Selection.svelte | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index ddf913b84..395608fa2 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -1331,7 +1331,7 @@
/* 🎨 style */
margin-right: -9px;
border-radius: 32px;
- border: 2px solid var(--whitev2);
+ border: 1px solid var(--whitev2);
}
div#fixture⮕competition⮕w⮕main⮕participants img.participant-main-img:last-child
{
@@ -1443,7 +1443,7 @@
.dark-background-1 div#fixture⮕competition⮕w⮕main⮕participants img.participant-main-img
{
/* 🎨 style */
- border: 2px solid var(--dark-theme-1-4-shade);
+ border: 1px solid var(--dark-theme-1-4-shade);
}
diff --git a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
index f662d31df..82fc6fbe7 100755
--- a/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Pool-Selection.svelte
@@ -399,6 +399,7 @@
class:row-space-out={!isViewTablet}
style=
"
+ {isViewMobile ? 'width: 50%;' : ''}
{isViewTablet ? 'align-items: flex-start;' : ''}
"
>
From dca3040556618bf70ad39595cb718fa8f811a8d7 Mon Sep 17 00:00:00 2001
From: MigBash <20924663+migbash@users.noreply.github.com>
Date: Sat, 21 Oct 2023 08:43:30 +0100
Subject: [PATCH 47/47] #1792 :: fix;
---
.../components/page/fixture/competition/Competition-Main.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/components/page/fixture/competition/Competition-Main.svelte b/src/lib/components/page/fixture/competition/Competition-Main.svelte
index 395608fa2..5ef8314f2 100755
--- a/src/lib/components/page/fixture/competition/Competition-Main.svelte
+++ b/src/lib/components/page/fixture/competition/Competition-Main.svelte
@@ -1121,7 +1121,7 @@
class:m-b-5={isViewMobile}
class:m-r-12={!isViewMobile}
>
- Type
+ {WIDGET_T_DATA?.title_type ?? 'Type'}