@opexa/portal-components 0.0.1074 → 0.0.1075

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.
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { clamp } from 'lodash-es';
4
4
  import Image from 'next/image';
5
5
  import Link from 'next/link';
6
+ import { useMemo } from 'react';
6
7
  import { useBonusQuery } from '../../client/hooks/useBonusQuery.js';
7
8
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
8
9
  import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
@@ -23,7 +24,14 @@ export function Bonus__client(props) {
23
24
  const gameProviders = props.gameProviders ?? [];
24
25
  const enabledGameProviders = bonus?.enabledGameProviders ?? [];
25
26
  const localeInfo = useLocaleInfo();
26
- const remainingTime = useRemainingTime(bonus?.promo.daysToClear ?? new Date());
27
+ const targetDate = useMemo(() => {
28
+ if (!bonus)
29
+ return new Date();
30
+ const date = new Date(bonus.dateTimeLastUpdated);
31
+ date.setDate(date.getDate() + bonus.promo.daysToClear);
32
+ return date;
33
+ }, [bonus]);
34
+ const remainingTime = useRemainingTime(targetDate);
27
35
  if (!bonus)
28
36
  return null;
29
37
  const turnoverRequirement = parseDecimal(bonus.turnoverRequirement, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.1074",
3
+ "version": "0.0.1075",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",