@opexa/portal-components 0.0.108 → 0.0.109
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.
- package/dist/client/hooks/useCreateGCashDepositMutation.js +19 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +19 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +19 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +19 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +19 -1
- package/dist/client/hooks/useRemainingTime.d.ts +12 -1
- package/dist/client/hooks/useRemainingTime.js +37 -6
- package/dist/components/Quests/DailyCheckInQuest.d.ts +1 -0
- package/dist/components/Quests/DailyCheckInQuest.js +96 -0
- package/dist/components/Quests/OnboardingQuest.d.ts +1 -0
- package/dist/components/Quests/OnboardingQuest.js +47 -0
- package/dist/components/Quests/Quests.client.d.ts +2 -0
- package/dist/components/Quests/Quests.client.js +6 -6
- package/dist/components/Quests/RemainingTime.d.ts +1 -0
- package/dist/components/Quests/RemainingTime.js +19 -0
- package/dist/components/Quests/WageringQuest.d.ts +1 -0
- package/dist/components/Quests/WageringQuest.js +36 -0
- package/package.json +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
6
|
import { createGCashDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
9
|
import { getCreateGCashDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
-
import {
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
10
12
|
import { getSession } from '../services/getSession.js';
|
|
11
13
|
export const useCreateGCashDepositMutation = (config) => {
|
|
12
14
|
const queryClient = getQueryClient();
|
|
@@ -44,6 +46,22 @@ export const useCreateGCashDepositMutation = (config) => {
|
|
|
44
46
|
error.message = 'Failed to process GCash deposit';
|
|
45
47
|
throw error;
|
|
46
48
|
}
|
|
49
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
50
|
+
if (depositsCount <= 0) {
|
|
51
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
52
|
+
return prev?.map((quest) => {
|
|
53
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
54
|
+
if (quest.type === 'ONBOARDING') {
|
|
55
|
+
return {
|
|
56
|
+
...quest,
|
|
57
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
58
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return quest;
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
47
65
|
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
48
66
|
return res;
|
|
49
67
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
6
|
import { createMayaAppDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
9
|
import { getCreateMayaAppDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
-
import {
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
10
12
|
import { getSession } from '../services/getSession.js';
|
|
11
13
|
export const useCreateMayaAppDepositMutation = (config) => {
|
|
12
14
|
const queryClient = getQueryClient();
|
|
@@ -44,6 +46,22 @@ export const useCreateMayaAppDepositMutation = (config) => {
|
|
|
44
46
|
error.message = 'Failed to process Maya deposit';
|
|
45
47
|
throw error;
|
|
46
48
|
}
|
|
49
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
50
|
+
if (depositsCount <= 0) {
|
|
51
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
52
|
+
return prev?.map((quest) => {
|
|
53
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
54
|
+
if (quest.type === 'ONBOARDING') {
|
|
55
|
+
return {
|
|
56
|
+
...quest,
|
|
57
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
58
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return quest;
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
47
65
|
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
48
66
|
return res;
|
|
49
67
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
6
|
import { createMayaDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
9
|
import { getCreateMayaDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
-
import {
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
10
12
|
import { getSession } from '../services/getSession.js';
|
|
11
13
|
export const useCreateMayaDepositMutation = (config) => {
|
|
12
14
|
const queryClient = getQueryClient();
|
|
@@ -44,6 +46,22 @@ export const useCreateMayaDepositMutation = (config) => {
|
|
|
44
46
|
error.message = 'Failed to process Maya deposit';
|
|
45
47
|
throw error;
|
|
46
48
|
}
|
|
49
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
50
|
+
if (depositsCount <= 0) {
|
|
51
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
52
|
+
return prev?.map((quest) => {
|
|
53
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
54
|
+
if (quest.type === 'ONBOARDING') {
|
|
55
|
+
return {
|
|
56
|
+
...quest,
|
|
57
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
58
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return quest;
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
47
65
|
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
48
66
|
return res;
|
|
49
67
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
6
|
import { createAIOOnlineBankDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
9
|
import { getCreateOnlineBankDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
-
import {
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
10
12
|
import { getSession } from '../services/getSession.js';
|
|
11
13
|
export const useCreateOnlineBankDepositMutation = (config) => {
|
|
12
14
|
const queryClient = getQueryClient();
|
|
@@ -47,6 +49,22 @@ export const useCreateOnlineBankDepositMutation = (config) => {
|
|
|
47
49
|
error.message = 'Failed to process online bank deposit';
|
|
48
50
|
throw error;
|
|
49
51
|
}
|
|
52
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
53
|
+
if (depositsCount <= 0) {
|
|
54
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
55
|
+
return prev?.map((quest) => {
|
|
56
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
57
|
+
if (quest.type === 'ONBOARDING') {
|
|
58
|
+
return {
|
|
59
|
+
...quest,
|
|
60
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
61
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return quest;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
50
68
|
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
51
69
|
return res;
|
|
52
70
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import { clamp } from 'lodash-es';
|
|
3
4
|
import invariant from 'tiny-invariant';
|
|
4
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
5
6
|
import { createAIOQRPHDeposit, getDeposit, } from '../../services/wallet.js';
|
|
6
7
|
import { createPoll } from '../../utils/createPoll.js';
|
|
7
8
|
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
8
9
|
import { getCreateQRPHDepositMutationKey } from '../../utils/mutationKeys.js';
|
|
9
|
-
import {
|
|
10
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
11
|
+
import { getAvailableQuestsQueryKey, getDepositsCountQueryKey, } from '../../utils/queryKeys.js';
|
|
10
12
|
import { getSession } from '../services/getSession.js';
|
|
11
13
|
export const useCreateQRPHDepositMutation = (config) => {
|
|
12
14
|
const queryClient = getQueryClient();
|
|
@@ -47,6 +49,22 @@ export const useCreateQRPHDepositMutation = (config) => {
|
|
|
47
49
|
error.message = 'Failed to process QR PH deposit';
|
|
48
50
|
throw error;
|
|
49
51
|
}
|
|
52
|
+
const depositsCount = queryClient.getQueryData(getDepositsCountQueryKey()) ?? 0;
|
|
53
|
+
if (depositsCount <= 0) {
|
|
54
|
+
queryClient.setQueryData(getAvailableQuestsQueryKey(), (prev) => {
|
|
55
|
+
return prev?.map((quest) => {
|
|
56
|
+
const progressPercentage = clamp(parseDecimal(quest.progressPercentage, 0) + 50, 100);
|
|
57
|
+
if (quest.type === 'ONBOARDING') {
|
|
58
|
+
return {
|
|
59
|
+
...quest,
|
|
60
|
+
status: progressPercentage >= 100 ? 'COMPLETED' : quest.status,
|
|
61
|
+
progressPercentage: progressPercentage.toFixed(2),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return quest;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
50
68
|
queryClient.setQueryData(getDepositsCountQueryKey(), (prev) => prev ? prev + 1 : 1);
|
|
51
69
|
return res;
|
|
52
70
|
},
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
type EventDetails = {
|
|
2
|
+
type: 'EXPIRED';
|
|
3
|
+
};
|
|
4
|
+
type UnsubscribeFn = () => void;
|
|
5
|
+
type Subscriber = (details: EventDetails) => UnsubscribeFn;
|
|
6
|
+
interface UseRemainingTimeOptions {
|
|
7
|
+
onExpired?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function useRemainingTime(value: Date | string | number, options?: UseRemainingTimeOptions): {
|
|
2
10
|
days: number;
|
|
3
11
|
hours: number;
|
|
4
12
|
minutes: number;
|
|
5
13
|
expired: boolean;
|
|
14
|
+
seconds: number;
|
|
6
15
|
toString(): string;
|
|
16
|
+
subscribe: (subscriber: Subscriber) => () => void;
|
|
7
17
|
};
|
|
18
|
+
export {};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import { differenceInDays, differenceInHours, differenceInMinutes, isAfter, } from 'date-fns';
|
|
2
|
-
import { isNumber, isString } from 'lodash-es';
|
|
3
|
-
import { useState } from 'react';
|
|
1
|
+
import { differenceInDays, differenceInHours, differenceInMinutes, differenceInSeconds, isAfter, } from 'date-fns';
|
|
2
|
+
import { isNumber, isString, noop } from 'lodash-es';
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
4
|
import { useInterval } from 'usehooks-ts';
|
|
5
|
-
export function useRemainingTime(value) {
|
|
5
|
+
export function useRemainingTime(value, options = {}) {
|
|
6
|
+
const subscribers = useRef([
|
|
7
|
+
() => {
|
|
8
|
+
options.onExpired?.();
|
|
9
|
+
return noop;
|
|
10
|
+
},
|
|
11
|
+
]);
|
|
12
|
+
const subscribe = (subscriber) => {
|
|
13
|
+
subscribers.current.push(subscriber);
|
|
14
|
+
return () => {
|
|
15
|
+
subscribers.current = subscribers.current.filter((item) => item !== subscriber);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const triggerEvent = (details) => {
|
|
19
|
+
subscribers.current.forEach((subscriber) => {
|
|
20
|
+
subscriber(details);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
6
23
|
const [now, setNow] = useState(new Date());
|
|
7
24
|
const expiration = isString(value) || isNumber(value) ? new Date(value) : value;
|
|
8
25
|
const expired = isAfter(now, expiration);
|
|
@@ -11,14 +28,28 @@ export function useRemainingTime(value) {
|
|
|
11
28
|
const minutes = expired
|
|
12
29
|
? 0
|
|
13
30
|
: differenceInMinutes(expiration, now) - days * 24 * 60 - hours * 60;
|
|
14
|
-
|
|
31
|
+
const seconds = expired
|
|
32
|
+
? 0
|
|
33
|
+
: differenceInSeconds(expiration, now) -
|
|
34
|
+
days * 24 * 60 * 60 -
|
|
35
|
+
hours * 60 * 60 -
|
|
36
|
+
minutes * 60;
|
|
37
|
+
useInterval(() => {
|
|
38
|
+
const d = new Date();
|
|
39
|
+
setNow(d);
|
|
40
|
+
if (isAfter(d, expiration)) {
|
|
41
|
+
triggerEvent({ type: 'EXPIRED' });
|
|
42
|
+
}
|
|
43
|
+
}, expired ? null : 1000);
|
|
15
44
|
return {
|
|
16
45
|
days,
|
|
17
46
|
hours,
|
|
18
47
|
minutes,
|
|
19
48
|
expired,
|
|
49
|
+
seconds,
|
|
20
50
|
toString() {
|
|
21
|
-
return `${days}d:${hours}h:${minutes}m`;
|
|
51
|
+
return `${days}d:${hours}h:${minutes}m:${seconds}s`;
|
|
22
52
|
},
|
|
53
|
+
subscribe,
|
|
23
54
|
};
|
|
24
55
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DailyCheckInQuest(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { addDays, isEqual, startOfDay } from 'date-fns';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { useCheckInDailyCheckInQuestMutation } from '../../client/hooks/useCheckInDailyCheckInQuestMutation.js';
|
|
6
|
+
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
7
|
+
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
8
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
9
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
10
|
+
import { toaster } from '../../client/utils/toaster.js';
|
|
11
|
+
import { CalendarIcon } from '../../icons/CalendarIcon.js';
|
|
12
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
13
|
+
import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
|
|
14
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
15
|
+
import { Button } from '../../ui/Button/index.js';
|
|
16
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
17
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
18
|
+
import { dataAttr } from '../../utils/dataAttr.js';
|
|
19
|
+
import { formatNumber } from '../../utils/formatNumber.js';
|
|
20
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
21
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
22
|
+
import { getAvailableQuestsQueryKey } from '../../utils/queryKeys.js';
|
|
23
|
+
import { useQuestContext } from './QuestsContext.js';
|
|
24
|
+
import { RemainingTime } from './RemainingTime.js';
|
|
25
|
+
export function DailyCheckInQuest() {
|
|
26
|
+
const quest = useQuestContext();
|
|
27
|
+
const disclosure = useDisclosure();
|
|
28
|
+
const localeInfo = useLocaleInfo();
|
|
29
|
+
const { name, description, status, lastCheckInDate, progressPercentage, checkInStreak, thirdDayBonusAmount, sixthDayBonusAmount, seventhDayBonusAmount, endDateTime, id, } = quest;
|
|
30
|
+
const today = startOfDay(new Date());
|
|
31
|
+
const hasCheckedInToday = lastCheckInDate
|
|
32
|
+
? isEqual(today, startOfDay(new Date(lastCheckInDate)))
|
|
33
|
+
: false;
|
|
34
|
+
const checkedInRewards = {
|
|
35
|
+
3: parseDecimal(thirdDayBonusAmount, 0),
|
|
36
|
+
6: parseDecimal(sixthDayBonusAmount, 0),
|
|
37
|
+
7: parseDecimal(seventhDayBonusAmount, 0),
|
|
38
|
+
};
|
|
39
|
+
const dailyCheckedInData = Array.from({ length: 7 }, (_, i) => {
|
|
40
|
+
const day = i + 1;
|
|
41
|
+
return {
|
|
42
|
+
day,
|
|
43
|
+
reward: checkedInRewards[day] ? checkedInRewards[day] : null,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const checkInDailyQuestMutation = useCheckInDailyCheckInQuestMutation({
|
|
47
|
+
onSuccess() {
|
|
48
|
+
toaster.success({
|
|
49
|
+
title: 'Check-in successful 🎉',
|
|
50
|
+
description: 'You’ve successfully checked in for today! Keep it up to maintain your streak!',
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onError(e) {
|
|
54
|
+
toaster.error({
|
|
55
|
+
title: 'Check-in successful 🎉',
|
|
56
|
+
description: e.message ?? 'Check-In Failed',
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const remainingTime = useRemainingTime(endDateTime);
|
|
61
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsx("div", { className: "grid grid-cols-7", children: dailyCheckedInData.map((item) => {
|
|
62
|
+
const reward = item.reward
|
|
63
|
+
? `+${formatNumber(item.reward, {
|
|
64
|
+
currency: localeInfo.currency.code,
|
|
65
|
+
minDecimalPlaces: 0,
|
|
66
|
+
maxDecimalPlaces: 0,
|
|
67
|
+
})}`
|
|
68
|
+
: '-';
|
|
69
|
+
return (_jsx("div", { className: twMerge('flex items-center justify-center', item.day <= (checkInStreak || 0)
|
|
70
|
+
? 'text-brand-400'
|
|
71
|
+
: 'text-text-secondary-700'), children: _jsx("p", { children: reward }) }, item.day));
|
|
72
|
+
}) }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) }), _jsx("div", { className: "grid grid-cols-7 place-items-center", children: dailyCheckedInData.map((item) => (_jsxs("div", { className: "text-text-secondary-700 ui-active:text-brand-400 group relative size-fit", "data-active": dataAttr(item.day <= (checkInStreak ?? 0)), children: [_jsx(CalendarIcon, { className: "h-4.5 w-auto" }), _jsx("p", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-2xs leading-none", children: item.day })] }, item.day))) })] }), _jsx(Button, { onClick: () => checkInDailyQuestMutation.mutate(id), className: "disabled:bg-bg-primary disabled:text-text-disabled", disabled: status === 'COMPLETED' ||
|
|
73
|
+
status === 'FAILED' ||
|
|
74
|
+
remainingTime.expired ||
|
|
75
|
+
hasCheckedInToday ||
|
|
76
|
+
checkInDailyQuestMutation.isPending, children: hasCheckedInToday && status === 'IN_PROGRESS' ? (_jsx(RemainingTimeTilTomorrow, {})) : (_jsx("span", { children: "Check-In" })) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
|
|
77
|
+
}
|
|
78
|
+
function RemainingTimeTilTomorrow() {
|
|
79
|
+
const queryClient = getQueryClient();
|
|
80
|
+
const remainingTime = useRemainingTime(startOfDay(addDays(new Date(), 1)), {
|
|
81
|
+
onExpired() {
|
|
82
|
+
queryClient.invalidateQueries({
|
|
83
|
+
queryKey: getAvailableQuestsQueryKey(),
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
return (_jsxs("div", { className: "flex items-center space-x-0.5", children: [_jsx(CheckIcon, { className: "size-5" }), _jsx("p", { children: remainingTime.toString() })] }));
|
|
88
|
+
}
|
|
89
|
+
function Rules(props) {
|
|
90
|
+
const [open, setOpen] = useControllableState({
|
|
91
|
+
value: props.open,
|
|
92
|
+
defaultValue: props.defaultOpen ?? false,
|
|
93
|
+
onChange: props.onOpenChange,
|
|
94
|
+
});
|
|
95
|
+
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: "Daily Check-In Rules" }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn rewards just for checking in each day!" }), _jsx("li", { children: "Stay consistent to unlock special rewards on the 3rd, 5th, and 7th day." }), _jsx("li", { children: "Missing a day will reset your streak, starting again from Day 1." }), _jsx("li", { children: "Each check-in unlocks the next one on the following day." }), _jsx("li", { children: "Successfully check in for 7 consecutive days to complete the quest and reset the cycle." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function OnboardingQuest(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { noop } from 'lodash-es';
|
|
3
|
+
import { useShallow } from 'zustand/shallow';
|
|
4
|
+
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
5
|
+
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
6
|
+
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
8
|
+
import { CheckIcon } from '../../icons/CheckIcon.js';
|
|
9
|
+
import { CoinsHandIcon } from '../../icons/CoinsHandIcon.js';
|
|
10
|
+
import { FileCheck02Icon } from '../../icons/FileCheck02Icon.js';
|
|
11
|
+
import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
|
|
12
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Checkbox } from '../../ui/Checkbox/index.js';
|
|
15
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
16
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
17
|
+
import { useQuestContext } from './QuestsContext.js';
|
|
18
|
+
import { RemainingTime } from './RemainingTime.js';
|
|
19
|
+
export function OnboardingQuest() {
|
|
20
|
+
const quest = useQuestContext();
|
|
21
|
+
const disclosure = useDisclosure();
|
|
22
|
+
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
23
|
+
kyc: ctx.kyc,
|
|
24
|
+
depositWithdrawal: ctx.depositWithdrawal,
|
|
25
|
+
})));
|
|
26
|
+
const remainingTime = useRemainingTime(quest.endDateTime);
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("h2", { className: "text-xl font-semibold", children: quest.name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: quest.description } })] }), _jsxs("div", { className: "w-full grow space-y-2", children: [_jsxs(Checkbox.Root, { checked: quest.accountVerificationCompleted, onCheckedChange: noop, children: [_jsx(Checkbox.Control, { className: "bg-transparent", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { className: "text-sm font-medium leading-tight", children: "Complete personal verification" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Checkbox.Root, { checked: quest.firstDepositCompleted, onCheckedChange: noop, children: [_jsx(Checkbox.Control, { className: "bg-transparent", children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { className: "text-sm font-medium leading-tight", children: "Make your first deposit" }), _jsx(Checkbox.HiddenInput, {})] })] }), _jsxs("div", { className: "flex gap-lg", children: [_jsxs(Button, { size: "sm", onClick: () => {
|
|
28
|
+
globalStore.kyc.setOpen(true);
|
|
29
|
+
}, disabled: quest.accountVerificationCompleted ||
|
|
30
|
+
quest.status === 'COMPLETED' ||
|
|
31
|
+
quest.status === 'FAILED' ||
|
|
32
|
+
remainingTime.expired, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: [quest.accountVerificationCompleted ? (_jsx(CheckIcon, { className: "size-5" })) : (_jsx(FileCheck02Icon, { className: "size-5" })), "Verify"] }), _jsxs(Button, { size: "sm", onClick: () => {
|
|
33
|
+
globalStore.depositWithdrawal.setTab('DEPOSIT');
|
|
34
|
+
globalStore.depositWithdrawal.setOpen(true);
|
|
35
|
+
}, disabled: quest.firstDepositCompleted ||
|
|
36
|
+
quest.status === 'COMPLETED' ||
|
|
37
|
+
quest.status === 'FAILED' ||
|
|
38
|
+
remainingTime.expired, className: "disabled:bg-bg-primary disabled:text-text-disabled", children: [_jsx(CoinsHandIcon, { className: "size-5" }), "Deposit"] })] })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
|
|
39
|
+
}
|
|
40
|
+
function Rules(props) {
|
|
41
|
+
const [open, setOpen] = useControllableState({
|
|
42
|
+
value: props.open,
|
|
43
|
+
defaultValue: props.defaultOpen ?? false,
|
|
44
|
+
onChange: props.onOpenChange,
|
|
45
|
+
});
|
|
46
|
+
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: "Welcome Quest Rules" }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Begin your quest whenever you're ready" }), _jsx("li", { children: "Tackle the tasks in any order you like" }), _jsx("li", { children: "Finish all tasks and we'll credit your reward automatically!" })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
47
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type CSSProperties } from 'react';
|
|
1
2
|
export interface QuestsProps {
|
|
2
3
|
/** @default "Quests" */
|
|
3
4
|
heading?: string;
|
|
4
5
|
className?: string;
|
|
6
|
+
style?: CSSProperties;
|
|
5
7
|
}
|
|
6
8
|
export declare function Quests__client(props: QuestsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,10 +7,10 @@ import { useAvailableQuestsQuery } from '../../client/hooks/useAvailableQuestsQu
|
|
|
7
7
|
import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
|
|
8
8
|
import closeChest from '../../images/close-chest.png';
|
|
9
9
|
import { SegmentGroup } from '../../ui/SegmentGroup/index.js';
|
|
10
|
-
import { DailyCheckInQuest } from './DailyCheckInQuest
|
|
11
|
-
import { OnboardingQuest } from './OnboardingQuest
|
|
10
|
+
import { DailyCheckInQuest } from './DailyCheckInQuest.js';
|
|
11
|
+
import { OnboardingQuest } from './OnboardingQuest.js';
|
|
12
12
|
import { QuestContext } from './QuestsContext.js';
|
|
13
|
-
import { WageringQuest } from './WageringQuest
|
|
13
|
+
import { WageringQuest } from './WageringQuest.js';
|
|
14
14
|
const QUEST_COMPONENT_MAP = {
|
|
15
15
|
DAILY_CHECKIN: DailyCheckInQuest,
|
|
16
16
|
ONBOARDING: OnboardingQuest,
|
|
@@ -28,12 +28,12 @@ export function Quests__client(props) {
|
|
|
28
28
|
: quest.status === 'IN_PROGRESS';
|
|
29
29
|
});
|
|
30
30
|
if (questsQuery.isLoading) {
|
|
31
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx(SpinnerIcon, { className: "mx-auto size-5 h-[50vh]" })] }));
|
|
31
|
+
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsx("h2", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsx(SpinnerIcon, { className: "mx-auto size-5 h-[50vh]" })] }));
|
|
32
32
|
}
|
|
33
33
|
if (!questsQuery.data?.length) {
|
|
34
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { src: closeChest, width: 100, height: 100, alt: "No Quests Available", className: "mix-blend-luminosity", quality: 100 }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: "No available quests. Please check back later!" })] })] }));
|
|
34
|
+
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsx("h2", { className: "mb-3 text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs("div", { className: "mt-11 flex flex-col items-center justify-center", children: [_jsx(Image, { src: closeChest, width: 100, height: 100, alt: "No Quests Available", className: "mix-blend-luminosity", quality: 100 }), _jsx("div", { className: "text-text-primary-900 mt-4 text-base font-semibold", children: props.heading ?? 'Quests' }), _jsx("div", { className: "text-text-tertiary-600 mt-1 text-center text-sm", children: "No available quests. Please check back later!" })] })] }));
|
|
35
35
|
}
|
|
36
|
-
return (_jsxs("div", { className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
36
|
+
return (_jsxs("div", { style: props.style, className: props.className, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Quests' }), _jsxs(SegmentGroup.Root, { value: tab, onValueChange: (details) => {
|
|
37
37
|
setTab(TabDefinition.catch('AVAILABLE').parse(details.value));
|
|
38
38
|
}, className: "mt-3 w-full overflow-x-auto lg:mt-4.5 lg:w-fit", children: [_jsxs(SegmentGroup.Item, { value: "AVAILABLE", className: "w-full lg:w-fit", children: [_jsx(SegmentGroup.ItemText, { children: "Available" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsxs(SegmentGroup.Item, { value: "COMPLETED", className: "w-full lg:w-fit", children: [_jsx(SegmentGroup.ItemText, { children: "Completed" }), _jsx(SegmentGroup.ItemControl, {}), _jsx(SegmentGroup.ItemHiddenInput, {})] }), _jsx(SegmentGroup.Indicator, {})] }), _jsx("div", { className: "mt-3xl grid gap-3xl lg:mt-lg lg:grid-cols-3", children: quests.map((quest) => {
|
|
39
39
|
const QuestComponent = QUEST_COMPONENT_MAP[quest.type];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RemainingTime(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
3
|
+
import { ClockStopWatchIcon } from '../../icons/ClockStopWatchIcon.js';
|
|
4
|
+
import { Badge } from '../../ui/Badge/index.js';
|
|
5
|
+
import { useQuestContext } from './QuestsContext.js';
|
|
6
|
+
export function RemainingTime() {
|
|
7
|
+
const quest = useQuestContext();
|
|
8
|
+
const remainingTime = useRemainingTime(quest.endDateTime);
|
|
9
|
+
if (quest.status === 'COMPLETED') {
|
|
10
|
+
return (_jsx(Badge.Root, { size: "lg", colorScheme: "success", round: false, children: _jsx(Badge.Label, { children: "Completed" }) }));
|
|
11
|
+
}
|
|
12
|
+
if (quest.status === 'FAILED') {
|
|
13
|
+
return (_jsx(Badge.Root, { size: "lg", colorScheme: "danger", round: false, children: _jsx(Badge.Label, { children: "Failed" }) }));
|
|
14
|
+
}
|
|
15
|
+
if (remainingTime.expired) {
|
|
16
|
+
return (_jsx(Badge.Root, { size: "lg", colorScheme: "danger", round: false, children: _jsx(Badge.Label, { children: "Expired" }) }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs(Badge.Root, { size: "lg", colorScheme: "brand", round: false, children: [_jsx(Badge.Icon, { children: _jsx(ClockStopWatchIcon, {}) }), _jsx(Badge.Label, { children: remainingTime.toString() })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function WageringQuest(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useControllableState } from '../../client/hooks/useControllableState.js';
|
|
5
|
+
import { useDisclosure } from '../../client/hooks/useDisclosure.js';
|
|
6
|
+
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
7
|
+
import { useRemainingTime } from '../../client/hooks/useRemainingTime.js';
|
|
8
|
+
import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
|
|
9
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
10
|
+
import { Button } from '../../ui/Button/index.js';
|
|
11
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
12
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
13
|
+
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
14
|
+
import { useQuestContext } from './QuestsContext.js';
|
|
15
|
+
import { RemainingTime } from './RemainingTime.js';
|
|
16
|
+
export function WageringQuest() {
|
|
17
|
+
const quest = useQuestContext();
|
|
18
|
+
const disclosure = useDisclosure();
|
|
19
|
+
const localeInfo = useLocaleInfo();
|
|
20
|
+
const { progressPercentage, turnover, targetTurnover, name, description, endDateTime, bonus, status, } = quest;
|
|
21
|
+
const remainingTime = useRemainingTime(endDateTime);
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "border-border-primary bg-bg-tertiary flex h-full w-full flex-col space-y-6 rounded-2xl border px-4 pb-6 pt-5", children: [_jsxs("div", { className: "flex flex-col space-y-2", children: [_jsxs("div", { className: "flex max-h-7.5 items-start justify-between", children: [_jsx(RemainingTime, {}), _jsx("button", { type: "button", className: "bg-bg-primary border-border-secondary flex size-9 cursor-pointer items-center justify-center rounded-md border", onClick: () => disclosure.setOpen(true), "aria-label": "View Rules", children: _jsx(InfoCircleIcon, { className: "text-text-disabled size-5" }) })] }), _jsx("p", { className: "text-xl font-semibold", children: name }), _jsx("p", { className: "text-text-secondary-700 text-wrap text-sm font-normal", dangerouslySetInnerHTML: { __html: description } })] }), _jsxs("div", { className: "flex w-full flex-col space-y-2", children: [_jsxs("div", { className: "text-text-primary-brand group flex items-center justify-between", children: [_jsxs("p", { children: ["Progress ", parseDecimal(progressPercentage, 0).toFixed(2), "%"] }), _jsxs("p", { children: [turnover, _jsxs("span", { className: "text-text-quarterary-brand", children: ["/", targetTurnover, " ", localeInfo.currency.code] })] })] }), _jsx("div", { className: "bg-bg-primary h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: "bg-utility-brand-600 h-full rounded-full transition-all duration-300", style: { width: `${progressPercentage}%` } }) })] }), _jsx("div", { className: "flex h-full items-end", children: _jsx("div", { className: "bg-button-secondary-bg border-bg-primary-hover w-full rounded-md border px-3.5 py-2.5 text-center text-white", children: _jsxs("p", { className: twMerge(remainingTime.expired ||
|
|
23
|
+
status === 'COMPLETED' ||
|
|
24
|
+
status === 'FAILED'
|
|
25
|
+
? 'opacity-50 grayscale'
|
|
26
|
+
: ''), children: ["Complete to get ", _jsxs("span", { className: "text-brand-400", children: ["\u20B1", bonus] }), ' ', "bonus!"] }) }) })] }), _jsx(Rules, { open: disclosure.open, onOpenChange: disclosure.setOpen })] }));
|
|
27
|
+
}
|
|
28
|
+
function Rules(props) {
|
|
29
|
+
const quest = useQuestContext();
|
|
30
|
+
const [open, setOpen] = useControllableState({
|
|
31
|
+
value: props.open,
|
|
32
|
+
defaultValue: props.defaultOpen ?? false,
|
|
33
|
+
onChange: props.onOpenChange,
|
|
34
|
+
});
|
|
35
|
+
return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: open, onOpenChange: (details) => setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "min-h-auto mx-auto max-w-[343px] rounded-xl px-4 pb-0 pt-5", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col space-y-5", children: [_jsx("h2", { className: "text-text-primary-900 text-lg font-semibold", children: quest.name }), _jsxs("ol", { className: "text-text-tertiary-600 group list-disc text-wrap pl-4 text-sm font-normal", children: [_jsx("li", { children: "Earn extra rewards just by playing Slots, every bet counts, win or lose!" }), _jsx("li", { children: "Reach the wagering requirement in bets to complete the quest and claim your reward." })] })] }), _jsx("div", { className: "pb-4 pt-6", children: _jsx(Button, { onClick: () => setOpen(false), children: "Ok" }) })] }) })] }) }));
|
|
36
|
+
}
|