fansunited-frontend-components 0.0.67 → 0.0.68
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/PlayerOfTheMatch.js +168 -49
- package/index.js +1 -1
- package/package.json +2 -2
package/PlayerOfTheMatch.js
CHANGED
|
@@ -2232,13 +2232,22 @@ const gt = st("X", [
|
|
|
2232
2232
|
}
|
|
2233
2233
|
)
|
|
2234
2234
|
] });
|
|
2235
|
-
}, Ho = (e, t) => t === 0 ? "0%" : `${(e / t * 100).toFixed(1)}%`, zo = ({
|
|
2235
|
+
}, Ho = (e, t) => t === 0 ? "0%" : `${(e / t * 100).toFixed(1)}%`, zo = ({
|
|
2236
|
+
results: e,
|
|
2237
|
+
match: t,
|
|
2238
|
+
showPlayers: n
|
|
2239
|
+
}) => {
|
|
2236
2240
|
const { t: r } = H(), s = z(), [c, g] = I([]), [C, h] = I(0);
|
|
2237
2241
|
O(() => {
|
|
2238
2242
|
if (!(e != null && e.length)) return;
|
|
2239
2243
|
let m = e;
|
|
2240
|
-
n && n.length > 0 && (m = e.filter(
|
|
2241
|
-
|
|
2244
|
+
n && n.length > 0 && (m = e.filter(
|
|
2245
|
+
(d) => n.includes(d.playerId)
|
|
2246
|
+
));
|
|
2247
|
+
const l = m.reduce(
|
|
2248
|
+
(d, x) => d + x.votes,
|
|
2249
|
+
0
|
|
2250
|
+
);
|
|
2242
2251
|
h(l);
|
|
2243
2252
|
const i = [...m].sort((d, x) => d.winner && !x.winner ? -1 : !d.winner && x.winner ? 1 : x.votes - d.votes).slice(0, 3).map((d) => ({
|
|
2244
2253
|
...d,
|
|
@@ -2251,7 +2260,9 @@ const gt = st("X", [
|
|
|
2251
2260
|
var B;
|
|
2252
2261
|
let i = l.lineups.homeTeam.players.find((R) => R.id === m);
|
|
2253
2262
|
if (i || (i = l.lineups.awayTeam.players.find((R) => R.id === m)), !i) return;
|
|
2254
|
-
const d = l.playerStats.find(
|
|
2263
|
+
const d = l.playerStats.find(
|
|
2264
|
+
(R) => R.playerId === m
|
|
2265
|
+
), x = (d == null ? void 0 : d.minutesPlayed) || 0;
|
|
2255
2266
|
return {
|
|
2256
2267
|
id: i.id,
|
|
2257
2268
|
name: i.name,
|
|
@@ -2264,55 +2275,163 @@ const gt = st("X", [
|
|
|
2264
2275
|
};
|
|
2265
2276
|
}, w = (m) => {
|
|
2266
2277
|
var i, d;
|
|
2267
|
-
return t.lineups.homeTeam.players.some(
|
|
2278
|
+
return t.lineups.homeTeam.players.some(
|
|
2279
|
+
(x) => x.id === m
|
|
2280
|
+
) ? ((i = t.homeTeam.assets) == null ? void 0 : i.logo) || te : ((d = t.awayTeam.assets) == null ? void 0 : d.logo) || te;
|
|
2268
2281
|
};
|
|
2269
2282
|
return c.length ? /* @__PURE__ */ b(p, { sx: { pb: s.spacing.xl }, children: [
|
|
2270
2283
|
/* @__PURE__ */ o(p, { sx: { mb: s.spacing.xl }, children: /* @__PURE__ */ o(f, { level: "h3", textAlign: "center", sx: { fontSize: "1.5em" }, children: r("potm.results_title") }) }),
|
|
2271
|
-
/* @__PURE__ */ o(
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2284
|
+
/* @__PURE__ */ o(
|
|
2285
|
+
K,
|
|
2286
|
+
{
|
|
2287
|
+
direction: { xs: "column", sm: "row" },
|
|
2288
|
+
spacing: s.spacing.xl,
|
|
2289
|
+
justifyContent: "center",
|
|
2290
|
+
alignItems: "stretch",
|
|
2291
|
+
useFlexGap: !0,
|
|
2292
|
+
children: c.map((m, l) => {
|
|
2293
|
+
var u, D, y, T;
|
|
2294
|
+
const i = m.winner === !0, d = c.filter((P) => !P.winner).indexOf(m), x = !i && d === 0, B = !i && d === 1, R = () => i ? "warning" : "neutral", v = () => i ? "🏆" : x ? "🥈" : B ? "🥉" : "", A = c.filter(
|
|
2295
|
+
(P) => P.winner === !0
|
|
2296
|
+
).length, a = i && A > 1, Y = i ? c.filter((P) => P.winner === !0).indexOf(m) : void 0;
|
|
2297
|
+
return m.playerDetails ? /* @__PURE__ */ b(
|
|
2298
|
+
Se,
|
|
2299
|
+
{
|
|
2300
|
+
variant: "outlined",
|
|
2301
|
+
sx: Ht(
|
|
2302
|
+
i,
|
|
2303
|
+
x,
|
|
2304
|
+
B,
|
|
2305
|
+
l,
|
|
2306
|
+
Y,
|
|
2307
|
+
s
|
|
2308
|
+
),
|
|
2309
|
+
children: [
|
|
2310
|
+
/* @__PURE__ */ o(p, { sx: zt(i, s), children: v() }),
|
|
2311
|
+
/* @__PURE__ */ o(
|
|
2312
|
+
"img",
|
|
2313
|
+
{
|
|
2314
|
+
src: w(m.playerId),
|
|
2315
|
+
style: Ft,
|
|
2316
|
+
alt: "Team logo"
|
|
2317
|
+
}
|
|
2318
|
+
),
|
|
2319
|
+
/* @__PURE__ */ o(
|
|
2320
|
+
N,
|
|
2321
|
+
{
|
|
2322
|
+
src: ((u = m.playerDetails) == null ? void 0 : u.image) || ve,
|
|
2323
|
+
alt: ((D = m.playerDetails) == null ? void 0 : D.name) || "Player",
|
|
2324
|
+
sx: Qt(i, s)
|
|
2325
|
+
}
|
|
2326
|
+
),
|
|
2327
|
+
/* @__PURE__ */ o(
|
|
2328
|
+
p,
|
|
2329
|
+
{
|
|
2330
|
+
sx: {
|
|
2331
|
+
width: "100%",
|
|
2332
|
+
mb: s.spacing.md,
|
|
2333
|
+
mt: s.spacing.xs,
|
|
2334
|
+
px: s.spacing.xs
|
|
2335
|
+
},
|
|
2336
|
+
children: /* @__PURE__ */ o(
|
|
2337
|
+
p,
|
|
2338
|
+
{
|
|
2339
|
+
sx: Zt(i, s),
|
|
2340
|
+
children: /* @__PURE__ */ o(
|
|
2341
|
+
p,
|
|
2342
|
+
{
|
|
2343
|
+
sx: Wt(
|
|
2344
|
+
i,
|
|
2345
|
+
m.percent,
|
|
2346
|
+
s
|
|
2347
|
+
)
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
}
|
|
2351
|
+
)
|
|
2352
|
+
}
|
|
2353
|
+
),
|
|
2354
|
+
/* @__PURE__ */ o(
|
|
2355
|
+
f,
|
|
2356
|
+
{
|
|
2357
|
+
level: "title-lg",
|
|
2358
|
+
sx: {
|
|
2359
|
+
mb: s.spacing["2xs"],
|
|
2360
|
+
textAlign: "center",
|
|
2361
|
+
fontSize: "1.25em"
|
|
2362
|
+
},
|
|
2363
|
+
children: ((y = m.playerDetails) == null ? void 0 : y.name) || ((T = m.playerDetails) == null ? void 0 : T.name) || "Unknown Player"
|
|
2364
|
+
}
|
|
2365
|
+
),
|
|
2366
|
+
a && /* @__PURE__ */ o(
|
|
2367
|
+
f,
|
|
2368
|
+
{
|
|
2369
|
+
level: "body-xs",
|
|
2370
|
+
sx: {
|
|
2371
|
+
mb: s.spacing["2xs"],
|
|
2372
|
+
textAlign: "center",
|
|
2373
|
+
color: s.colors.warning,
|
|
2374
|
+
fontWeight: "bold",
|
|
2375
|
+
textTransform: "uppercase",
|
|
2376
|
+
letterSpacing: "0.03em",
|
|
2377
|
+
fontSize: "0.75em"
|
|
2378
|
+
},
|
|
2379
|
+
children: r("potm.tied_winner", "Tied Winner")
|
|
2380
|
+
}
|
|
2381
|
+
),
|
|
2382
|
+
/* @__PURE__ */ o(
|
|
2383
|
+
f,
|
|
2384
|
+
{
|
|
2385
|
+
level: "body-sm",
|
|
2386
|
+
sx: {
|
|
2387
|
+
mb: s.spacing.xs,
|
|
2388
|
+
color: s.colors.dim,
|
|
2389
|
+
fontSize: "0.875em"
|
|
2390
|
+
},
|
|
2391
|
+
children: m.playerDetails ? r(`potm.${m.playerDetails.position}`) : ""
|
|
2392
|
+
}
|
|
2393
|
+
),
|
|
2394
|
+
/* @__PURE__ */ b(
|
|
2395
|
+
K,
|
|
2396
|
+
{
|
|
2397
|
+
direction: "row",
|
|
2398
|
+
spacing: s.spacing.xs,
|
|
2399
|
+
alignItems: "center",
|
|
2400
|
+
sx: { mt: s.spacing.xs },
|
|
2401
|
+
children: [
|
|
2402
|
+
/* @__PURE__ */ o(
|
|
2403
|
+
f,
|
|
2404
|
+
{
|
|
2405
|
+
level: "title-md",
|
|
2406
|
+
color: R(),
|
|
2407
|
+
sx: { fontSize: "1em" },
|
|
2408
|
+
children: Ho(m.votes, C)
|
|
2409
|
+
}
|
|
2410
|
+
),
|
|
2411
|
+
/* @__PURE__ */ b(
|
|
2412
|
+
f,
|
|
2413
|
+
{
|
|
2414
|
+
level: "body-sm",
|
|
2415
|
+
sx: { color: s.colors.dim, fontSize: "0.875em" },
|
|
2416
|
+
children: [
|
|
2417
|
+
"(",
|
|
2418
|
+
m.votes,
|
|
2419
|
+
" ",
|
|
2420
|
+
r("potm.votes", { count: m.votes }),
|
|
2421
|
+
")"
|
|
2422
|
+
]
|
|
2423
|
+
}
|
|
2424
|
+
)
|
|
2425
|
+
]
|
|
2426
|
+
}
|
|
2427
|
+
)
|
|
2428
|
+
]
|
|
2299
2429
|
},
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
)
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
/* @__PURE__ */ o(f, { level: "title-md", color: R(), sx: { fontSize: "1em" }, children: Ho(m.votes, C) }),
|
|
2306
|
-
/* @__PURE__ */ b(f, { level: "body-sm", sx: { color: s.colors.dim, fontSize: "0.875em" }, children: [
|
|
2307
|
-
"(",
|
|
2308
|
-
m.votes,
|
|
2309
|
-
" ",
|
|
2310
|
-
r("potm.votes", { count: m.votes }),
|
|
2311
|
-
")"
|
|
2312
|
-
] })
|
|
2313
|
-
] })
|
|
2314
|
-
] }, m.playerId) : null;
|
|
2315
|
-
}) })
|
|
2430
|
+
m.playerId
|
|
2431
|
+
) : null;
|
|
2432
|
+
})
|
|
2433
|
+
}
|
|
2434
|
+
)
|
|
2316
2435
|
] }) : /* @__PURE__ */ o(p, { sx: { textAlign: "center", py: s.spacing.xl }, children: /* @__PURE__ */ o(f, { level: "body-lg", sx: { fontSize: "1.125em" }, children: r("potm.no_votes_yet") }) });
|
|
2317
2436
|
}, Fo = ({ match: e }) => {
|
|
2318
2437
|
const { t } = H(), n = z(), { days: r, hours: s, minutes: c, seconds: g, isExpired: C } = Pe(e.kickoffAt);
|
package/index.js
CHANGED
|
@@ -1837,7 +1837,7 @@ const Ke = "https://sports.fansunitedapi.com/v1", Ye = "https://search.fansunite
|
|
|
1837
1837
|
] });
|
|
1838
1838
|
}, wt = (e) => /* @__PURE__ */ o(St, { ...e, children: /* @__PURE__ */ o(bt, { ...e }) }), Wt = wt;
|
|
1839
1839
|
typeof window < "u" && (window.fansUnitedComponentsVersions = {
|
|
1840
|
-
components: "0.0.
|
|
1840
|
+
components: "0.0.68",
|
|
1841
1841
|
core: Ie
|
|
1842
1842
|
});
|
|
1843
1843
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fansunited-frontend-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68",
|
|
4
4
|
"description": "Various user centric components for Fans United features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"fansunited-frontend-core": "0.0.
|
|
79
|
+
"fansunited-frontend-core": "0.0.68",
|
|
80
80
|
"react": ">=16.8.0",
|
|
81
81
|
"react-dom": ">=16.8.0"
|
|
82
82
|
},
|