@opexa/portal-components 0.0.210 → 0.0.211

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.
@@ -10,5 +10,5 @@ type Args = {
10
10
  provider: GameProvider;
11
11
  version?: string;
12
12
  };
13
- export declare function getGameImageUrl<T extends Args>(args: T): string | import("next/image").StaticImageData;
13
+ export declare function getGameImageUrl<T extends Args>(args: T): string;
14
14
  export {};
@@ -1,8 +1,4 @@
1
1
  import { STATIC_ENDPOINT } from '../constants/index.js';
2
- import marbleGameOffline from '../../lib/images/games/marble-game-offline.webp';
3
- import marbleGameOnline from '../../lib/images/games/marble-game.webp';
4
- import rainbowBallOffline from '../../lib/images/games/rainbow-ball-offline.webp';
5
- import rainbowBallOnline from '../../lib/images/games/rainbow-ball-online.webp';
6
2
  const VERSION = '1';
7
3
  export function getGameImageUrl(args) {
8
4
  const id = args.id ?? args.reference;
@@ -11,12 +7,12 @@ export function getGameImageUrl(args) {
11
7
  const now = new Date();
12
8
  const hour = now.getHours();
13
9
  const isBetween3amAnd3pm = hour >= 15 || hour < 3;
14
- console.log(`getGameImageUrl called with id: ${id}, provider: ${provider}, v`);
15
10
  switch (id) {
16
11
  case 'Hwd1wEWHU6Gvfwecuh':
17
- return isBetween3amAnd3pm ? marbleGameOnline : marbleGameOffline;
18
12
  case 'HwdcKd7wDpwSPHGksq':
19
- return isBetween3amAnd3pm ? rainbowBallOnline : rainbowBallOffline;
13
+ return isBetween3amAnd3pm
14
+ ? `${STATIC_ENDPOINT}/images/${provider}/thumbnail-${id}.webp?_v=${version}`
15
+ : `${STATIC_ENDPOINT}/images/${provider}/thumbnail-${id}-offline.webp?_v=${version}`;
20
16
  default:
21
17
  return `${STATIC_ENDPOINT}/images/${provider}/thumbnail-${id}.webp?_v=${version}`;
22
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.210",
3
+ "version": "0.0.211",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",