@opexa/portal-components 0.0.1072 → 0.0.1073

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.
@@ -48,7 +48,7 @@ export function Promo__client(props) {
48
48
  return (_jsxs("div", { className: classNames.root, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "flex w-fit items-center gap-lg font-semibold text-button-tertiary-fg text-lg", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), promo.banner.url && (_jsx(Image, { src: promo.banner.url, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" })), claimable && (_jsx(Button, { className: "mt-xl lg:mt-6", onClick: () => {
49
49
  globalStore.depositWithdrawal.setOpen(true);
50
50
  globalStore.depositWithdrawal.setPromo(promo.id);
51
- }, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: promo.name }), _jsxs("p", { className: "mt-xl text-text-secondary-700 lg:mt-6", children: ["Ends", ' ', format(promo.activationEndDateTime, 'MM/dd/yyy hh:mm:ss', {
51
+ }, children: "Deposit Now" })), _jsx("h1", { className: "mt-xl font-semibold text-2xl lg:mt-6 lg:text-3xl", children: promo.name }), _jsxs("p", { className: "mt-xl text-text-secondary-700 lg:mt-6", children: ["Ends", ' ', format(promo.daysToClear, 'MM/dd/yyy hh:mm:ss', {
52
52
  in: tz(localeInfo.timezone),
53
53
  })] }), _jsx(Prose, { className: twMerge('mt-2xl lg:mt-6', classNames.promoDescription), dangerouslySetInnerHTML: { __html: descriptionHtml } })] }));
54
54
  }
@@ -1,15 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { endOfDay } from 'date-fns';
2
+ import { useMemo } from 'react';
3
3
  import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
4
4
  import { ClockStopWatchIcon } from '../../icons/ClockStopWatchIcon.js';
5
5
  import { Badge } from '../../ui/Badge/index.js';
6
6
  import { useQuestContext } from './QuestsContext.js';
7
7
  export function RemainingTime({ endOfDay: useEndOfDay = false, className, }) {
8
8
  const quest = useQuestContext();
9
- const targetDateTime = useEndOfDay
10
- ? endOfDay(new Date(quest.endDateTime)).toISOString()
11
- : quest.endDateTime;
12
- const remainingTime = useRemainingTime(targetDateTime);
9
+ const targetDate = useMemo(() => {
10
+ const date = new Date(quest.dateTimeCreated);
11
+ date.setDate(date.getDate() + Number(quest.daysToClear ?? 0));
12
+ return date;
13
+ }, [quest.dateTimeCreated, quest.daysToClear]);
14
+ const remainingTime = useRemainingTime(targetDate);
13
15
  if (quest.status === 'COMPLETED') {
14
16
  return (_jsx(Badge.Root, { size: "lg", colorScheme: "success", round: false, className: className?.completedBadgeRoot, children: _jsx(Badge.Label, { className: className?.completedBadgeLabel, children: "Completed" }) }));
15
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.1072",
3
+ "version": "0.0.1073",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",