@opexa/portal-components 0.0.852 → 0.0.853
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.
|
@@ -31,7 +31,6 @@ export function TournamentsCarouselItem({ style, className, startStyle, viewAllU
|
|
|
31
31
|
const tournamentReward = Object.values(tournament.rewardSettings)
|
|
32
32
|
.map(Number)
|
|
33
33
|
.reduce((sum, val) => sum + val, 0);
|
|
34
|
-
const prizeAmountsByRank = Object.values(tournament.rewardSettings).map(Number);
|
|
35
34
|
const styles = isStyleEntries(style, [
|
|
36
35
|
'root',
|
|
37
36
|
'badgeRoot',
|
|
@@ -44,7 +43,7 @@ export function TournamentsCarouselItem({ style, className, startStyle, viewAllU
|
|
|
44
43
|
? { root: className }
|
|
45
44
|
: (className ?? {});
|
|
46
45
|
const isEnded = new Date(tournament.activationEndDateTime) < now;
|
|
47
|
-
return (_jsxs("div", { className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-6 lg:p-5', classNames.root), style: styles.root, children: [_jsx("div", { className: "relative z-1 flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('flex h-fit w-fit items-center gap-1 rounded-full border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('size-3.5 text-utility-brand-500', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsxs("div", { className: "flex flex-col", children: [isEnded && (_jsxs("div", { className: twMerge('mb-2 flex flex-col items-center justify-center whitespace-nowrap rounded-md bg-bg-primary px-2 py-1.5 font-semibold text-[#EAAA08] text-sm', classNames.countdownHeading), children: [_jsx("span", { className: "font-semibold", children: "Ended" }), _jsx("span", { className: twMerge('text-[9px] text-white', classNames.countdownSubheading), children: format(tournament.activationEndDateTime, 'MMMM dd, yyyy') })] })), !isLaunchStarts && !isEnded && (_jsx("div", { className: twMerge('mb-2 flex items-center justify-center rounded-md bg-bg-primary py-1 font-semibold text-[#EAAA08] text-sm', classNames.countdownHeading), children: "Launching Soon" })), !isEnded && (_jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('flex h-fit w-8 flex-col items-center rounded-[0.25rem] bg-bg-primary pb-1.5 text-text-primary-900'), children: [_jsx("span", { className: "font-medium text-base", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-3xs", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-1.5 px-1.5", children: [_jsx("div", { className: "h-1 w-1 rounded-full bg-bg-primary" }), _jsx("div", { className: "h-1 w-1 rounded-full bg-bg-primary" })] }))] }, part.label))) }))] })] }), _jsx("div", { className: "flex justify-between", children: _jsxs("div", { children: [_jsx("div", { className: "text-left font-medium text-lg text-text-primary-900 lg:text-2xl", children: tournament.name }), _jsx("div", { className: "mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
|
|
46
|
+
return (_jsxs("div", { className: twMerge('relative flex w-full shrink-0 rounded-2xl border border-border-primary bg-bg-tertiary p-3 text-center lg:gap-6 lg:p-5', classNames.root), style: styles.root, children: [_jsx("div", { className: "relative z-1 flex flex-1 flex-col", children: _jsx("div", { className: "flex h-full flex-col justify-between", children: _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "flex w-full flex-col", children: [_jsxs("div", { className: "relative flex w-full justify-between", children: [_jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "flex w-full justify-between", children: [_jsxs("div", { style: styles.badgeRoot, className: twMerge('flex h-fit w-fit items-center gap-1 rounded-full border border-utility-brand-200 bg-utility-brand-50 px-2 py-0.5 font-medium text-utility-brand-700 text-xs', classNames.badgeRoot), children: [_jsx(Award01Icon, { style: styles.badgeIcon, className: twMerge('size-3.5 text-utility-brand-500', classNames.badgeIcon) }), _jsx("span", { style: styles.badgeLabel, className: classNames.badgeLabel, children: "Multiplier" })] }), _jsxs("div", { className: "flex flex-col", children: [isEnded && (_jsxs("div", { className: twMerge('mb-2 flex flex-col items-center justify-center whitespace-nowrap rounded-md bg-bg-primary px-2 py-1.5 font-semibold text-[#EAAA08] text-sm', classNames.countdownHeading), children: [_jsx("span", { className: "font-semibold", children: "Ended" }), _jsx("span", { className: twMerge('text-[9px] text-white', classNames.countdownSubheading), children: format(tournament.activationEndDateTime, 'MMMM dd, yyyy') })] })), !isLaunchStarts && !isEnded && (_jsx("div", { className: twMerge('mb-2 flex items-center justify-center rounded-md bg-bg-primary py-1 font-semibold text-[#EAAA08] text-sm', classNames.countdownHeading), children: "Launching Soon" })), !isEnded && (_jsx("div", { className: "flex h-fit", children: timeParts.map((part, idx) => (_jsxs(React.Fragment, { children: [_jsxs("div", { className: twMerge('flex h-fit w-8 flex-col items-center rounded-[0.25rem] bg-bg-primary pb-1.5 text-text-primary-900'), children: [_jsx("span", { className: "font-medium text-base", children: String(part.value).padStart(2, '0') }), _jsx("span", { className: "text-3xs", children: part.label })] }), idx < timeParts.length - 1 && (_jsxs("div", { className: "flex flex-col justify-center gap-1.5 px-1.5", children: [_jsx("div", { className: "h-1 w-1 rounded-full bg-bg-primary" }), _jsx("div", { className: "h-1 w-1 rounded-full bg-bg-primary" })] }))] }, part.label))) }))] })] }), _jsx("div", { className: "flex w-full justify-between", children: _jsxs("div", { className: "w-full", children: [_jsx("div", { className: "w-1/2 text-left font-medium text-lg text-text-primary-900 lg:w-[68%] lg:text-2xl", children: tournament.name }), _jsx("div", { className: "mt-1.5 w-fit rounded-md bg-bg-primary px-2 py-1 font-bold text-2xl text-brand-400 lg:mt-2 lg:text-4xl", children: formatNumber(tournamentReward, {
|
|
48
47
|
currency: localeInfo.currency.code,
|
|
49
48
|
minDecimalPlaces: 2,
|
|
50
49
|
maxDecimalPlaces: 2,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import { Flag06Icon } from '../../../icons/Flag06Icon.js';
|
|
3
4
|
import { XIcon } from '../../../icons/XIcon.js';
|
|
4
5
|
import { Dialog } from '../../../ui/Dialog/index.js';
|
|
5
6
|
import { Portal } from '../../../ui/Portal/index.js';
|
|
7
|
+
import { Prose } from '../../../ui/Prose/index.js';
|
|
6
8
|
import { useTournamentsListItemContext } from './TournamentsListContext.js';
|
|
7
9
|
export function TournamentsListItemRules(props) {
|
|
8
10
|
const tournament = useTournamentsListItemContext();
|
|
9
|
-
return (_jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { asChild: true, children: props.children ?? (_jsx("button", { type: "button", className: "flex font-semibold text-button-tertiary-fg text-sm", children: "Tournament Rules" })) }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "mx-auto h-full w-full items-start overflow-y-auto lg:h-auto lg:w-[640px] lg:rounded-xl", children: [_jsxs("div", { className: "p-3xl", children: [_jsxs("div", { className: "mb-3 flex justify-between", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg border border-border-primary bg-bg-tertiary", children: _jsx(Flag06Icon, { className: "size-full p-3 text-text-tertiary-600" }) }), _jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })] }), _jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: "Tournament Rules" }), _jsx("div", { className: "mt-1 text-sm text-text-tertiary-600", children: "Terms and Conditions" })] }), _jsx("div", { className: "border-gray-800 border-t-1 pb-3", children: _jsx(
|
|
11
|
+
return (_jsxs(Dialog.Root, { lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: [_jsx(Dialog.Trigger, { asChild: true, children: props.children ?? (_jsx("button", { type: "button", className: "flex font-semibold text-button-tertiary-fg text-sm", children: "Tournament Rules" })) }), _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "mx-auto h-full w-full items-start overflow-y-auto lg:h-auto lg:w-[640px] lg:rounded-xl", children: [_jsxs("div", { className: "p-3xl", children: [_jsxs("div", { className: "mb-3 flex justify-between", children: [_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg border border-border-primary bg-bg-tertiary", children: _jsx(Flag06Icon, { className: "size-full p-3 text-text-tertiary-600" }) }), _jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) })] }), _jsx("div", { className: "font-semibold text-lg text-text-primary-900", children: "Tournament Rules" }), _jsx("div", { className: "mt-1 text-sm text-text-tertiary-600", children: "Terms and Conditions" })] }), _jsx("div", { className: "border-gray-800 border-t-1 pb-3", children: _jsx(Prose, { dangerouslySetInnerHTML: {
|
|
12
|
+
__html: tournament.description,
|
|
13
|
+
}, className: twMerge('px-3xl py-3') }) })] }) })] })] }));
|
|
10
14
|
}
|