@opexa/portal-components 0.0.1071 → 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.
|
@@ -32,7 +32,6 @@ import { Badge } from '../../ui/Badge/index.js';
|
|
|
32
32
|
import { Drawer } from '../../ui/Drawer/index.js';
|
|
33
33
|
import { Popover } from '../../ui/Popover/index.js';
|
|
34
34
|
import { Portal } from '../../ui/Portal/index.js';
|
|
35
|
-
import { capitalize } from '../../utils/capitalize.js';
|
|
36
35
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
37
36
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
38
37
|
import { getSessionQueryKey } from '../../utils/queryKeys.js';
|
|
@@ -102,9 +101,19 @@ function Profile() {
|
|
|
102
101
|
return 'danger';
|
|
103
102
|
}
|
|
104
103
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
const getVerificationStatusLabel = (status) => {
|
|
105
|
+
switch (status) {
|
|
106
|
+
case 'VERIFIED':
|
|
107
|
+
return 'Verified';
|
|
108
|
+
case 'APPROVED':
|
|
109
|
+
return 'Verified';
|
|
110
|
+
case 'PENDING':
|
|
111
|
+
return 'Pending';
|
|
112
|
+
default:
|
|
113
|
+
return 'Unverified';
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: accountProps.avatar || avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "font-semibold text-text-secondary-700 leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsxs("p", { className: "grow items-center text-text-tertiary-600 leading-tight", children: ["ID: ", account?.id] }), accountProps.shouldShowAccountStatus && (_jsxs(Badge.Root, { colorScheme: getVerificationColorScheme(account?.verification?.status), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: getVerificationStatusLabel(account?.verification?.status) })] }))] })] })] }));
|
|
108
117
|
}
|
|
109
118
|
function Links({ router, classNames, }) {
|
|
110
119
|
const accountProps = useAccountPropsContext();
|
|
@@ -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.
|
|
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 {
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
}
|