@opexa/portal-components 0.0.1076 → 0.0.1078
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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { App } from '@capacitor/app';
|
|
4
|
+
import { Capacitor } from '@capacitor/core';
|
|
3
5
|
import Image from 'next/image';
|
|
4
6
|
import Link from 'next/link';
|
|
5
7
|
import { useEffect, useRef, useState } from 'react';
|
|
@@ -50,6 +52,9 @@ export function DisclaimerV1(props) {
|
|
|
50
52
|
globalStore.termsAndConditions.setAccepted(false);
|
|
51
53
|
disclaimer.close();
|
|
52
54
|
}, disabled: !checked, "data-testid": "disclaimer-v1-accept-btn", children: "Accept" }), _jsx(Button, { variant: "outline", type: "button", className: "mt-lg", "data-testid": "disclaimer-v1-exit-btn", onClick: () => {
|
|
55
|
+
if (Capacitor.isNativePlatform()) {
|
|
56
|
+
App.exitApp();
|
|
57
|
+
}
|
|
53
58
|
if (props.exitRedirect) {
|
|
54
59
|
window.location.href = props.exitRedirect;
|
|
55
60
|
return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { App } from '@capacitor/app';
|
|
3
4
|
import { Capacitor } from '@capacitor/core';
|
|
4
5
|
import { isString } from 'lodash-es';
|
|
5
6
|
import Image from 'next/image';
|
|
@@ -93,6 +94,7 @@ export function DisclaimerV2(props) {
|
|
|
93
94
|
},
|
|
94
95
|
});
|
|
95
96
|
}
|
|
97
|
+
App.exitApp(); // close app on mobile
|
|
96
98
|
}
|
|
97
99
|
signOutMutation.mutate();
|
|
98
100
|
if (props.redirectUrlOnNoConsent) {
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { endOfDay } from 'date-fns';
|
|
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
|
-
|
|
13
|
-
}, [quest.dateTimeCreated, quest.daysToClear]);
|
|
14
|
-
const remainingTime = useRemainingTime(targetDate);
|
|
9
|
+
const targetDateTime = useEndOfDay
|
|
10
|
+
? endOfDay(new Date(quest.endDateTime)).toISOString()
|
|
11
|
+
: quest.endDateTime;
|
|
12
|
+
const remainingTime = useRemainingTime(targetDateTime);
|
|
15
13
|
if (quest.status === 'COMPLETED') {
|
|
16
14
|
return (_jsx(Badge.Root, { size: "lg", colorScheme: "success", round: false, className: className?.completedBadgeRoot, children: _jsx(Badge.Label, { className: className?.completedBadgeLabel, children: "Completed" }) }));
|
|
17
15
|
}
|